networking in java for client server communication
===

I need to make a troubleshooting tool in java 

From the java code, i need to communicate with tethereal (linux commands) to help me generate a .pkt file. The .pkt file will contain all the contents of the communication that took place between the client and the server- i.e. all the packet communication between the client and the server.

how should i do that?