Dear All, I have question regarding how to understand pcap capture by tcpdump and read by wireshark. Below are the listing between 2 ports and 2 ip. If I understand correctly 103.11.134.43 port 9091 receive 1460 byte of data and then reply to the sender that it has acknowledge the data (frame5) to be accepted. If my understanding is correct, then I should have been able to see the byte sent by frame5 in my Java Socket programming when I do socket.read(byte) - rhetorical question. I do get the next frame7 in my Java Socket programming when I do socket.read(byte). -- by right, I should have been able to read frame5 as it has been acknowledged. It seems there is a skipped (instead of reading frame5, it read frame7) -- this happens in non consistent basis - from time to time I get to read frame5 in my socket.read(byte). Why such inconsistency in TCP part? or in Java Socket part? In my program, I kept getting 0 byte in the server side - while tcpdump and wireshark showed that I actually get 1460 byte - do I get the concept correct?
The next sequence of ACK for the byte 1498
The part that socket.read(byte) got to read is the following (frame7 got read instead of frame5)
asked 24 May ‘14, 21:51 edisonch edited 25 May ‘14, 03:47 grahamb ♦ |
One Answer:
Dear All, It seems I have solve the inconsistency of the problem above by changing the way my Java code do thing. I change the communication protocol. Original Protocol: client's side: 1. send order (order for server including file name and file size - form of String) 2. send the actual file 3. receive server's acknowledgement (form of String) server's side: 1. receive order from client 2. receive the actual file 3. send server's acknowledgement New Protocol client's side: 1. send order 2. receive confirmation 3. send actual file 4. receive server's acknowledgement server's side: 1. receive order 2. send confirmation 3. receive actual file 4. send server's acknowledgement With new protocol, the file consistently send and if there is a miss, the TCP's protocol re transmit the missing frame. Even though the problem is somehow solved, I still don't know what cause such inconsistent send/receive file in TCP's socket programming. Thanks. If anyone can explain the problem above, I would like to thank you in advance. answered 25 May '14, 00:07 edisonch |