aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes tracking TCP packets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "tracking TCP packets? " Watch "tracking TCP packets? " New topic
Author

tracking TCP packets?

Elhanan Maayan
Ranch Hand

Joined: May 04, 2009
Posts: 116
hi..

we have the following setup

to java process communicating by sockets with each other, and another one on an external machine.

from time to time, there seem to be "outages" where one process is unable to communicate with the other, the simply indicate things like "connection refused" exceptions, and while it seems the processes themselves are mis-behaving i'm not sure that is the case.

how can i know for sure the a tcp packet sent from one process (at least in the same machine) was received by another process and vice versa ? that it wasn't blocked by anything else?
i think IPTABLES has this log feature , but not sure how to use it.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19059
    
  40

Elhanan Maayan wrote:hi..

we have the following setup

to java process communicating by sockets with each other, and another one on an external machine.

from time to time, there seem to be "outages" where one process is unable to communicate with the other, the simply indicate things like "connection refused" exceptions, and while it seems the processes themselves are mis-behaving i'm not sure that is the case.

how can i know for sure the a tcp packet sent from one process (at least in the same machine) was received by another process and vice versa ? that it wasn't blocked by anything else?
i think IPTABLES has this log feature , but not sure how to use it.


The only way to make sure from one application that another application has received a message -- is to have the other application report that it received it. And even then, there are edge conditions, such as the other application received it, acknowledge it, but the machine dies before it can process the message. This is doubly an issue, when TCP sockets are connecting and disconnecting, as there are always a chance of loss when connections are torn down.

Henry

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tracking TCP packets?