I have captured opening of news web site main page with wireshark 2.0.1. GET request is parsed by wireshark but response is not. Wireshark shows the following output:
Then "TCP segment of reassembled PDU" appears again and again (same pattern as above). If I select "Follow TCP stream" wireshark decodes the conversation. E.g.:
… (Entire conversation is 163K) I am under impression that the problem is in “Transfer-Encoding: chunked” ( no length is given, chunks are used) Is it a bug in Wireshark or have I missed some settings to dissect chunked HTML? I’ve expected to see the settings which controls max length of the HTML payload being dissected but do not see any. “Resemble chunked transfer-coded bodies” is set. Thanks beforehand! asked 12 Jan ‘16, 07:48 Vitaly R |
One Answer:
Possibly because your capture is missing some frames from the server? For example. see frames 27-29. Frame 27 sends data setting the expected tcp sequence no. to 20380, but frame 28 sends data with a sequence number 26172. There's 5792 bytes missing, likely to be 2 tcp segments given that some of the segments are transporting 2896 bytes of tcp data. Frame 29 shows the client acking sequence no. 29068, that is all data including frame 28, so the client has seen the data, but you didn't capture it. answered 12 Jan '16, 09:07 grahamb ♦ showing 5 of 6 show 1 more comments |
This looks strange. I have just repeated the experiment.
Now I've made measurements from different machine (and different country). And got similar results: see pcap file
The commands I have used to capture it:
How can it be that the client have seen the data but wireshark has not?
I have also made a comparison of the index.html file I've got and the response which is shown in the "Follow TCP stream" window. I do see that size of the conversation captured by wireshark is bigger that what wget saved. And meld does not show missed parts.
The server response is (probably) not standard compliant. If you replace fc4 with CRLFs, Wireshark is able to parse the response.
Regards
Kurt
The second capture still seems to be missing packets, see frame 92 where it has a tcp sequence number of 56936, but the expected value was 55528. Another 1408 bytes of payload missing.
The client then acks subsequent frames, extending its window size to accommodate the new data until frame 113 where the client can no longer increase its window size.
Then in frame 200 the server sends the missing segment.
However things go wrong again in frame 230, the missing segment is sent in frame 272, and the server now resends a lot of the date it transmitted between 230 and 272. In frame 307 the client finally acks the highest sequence number seen and closes the connection.
See it seems that all the data is there, but due to the dropped and retransmitted frames Wireshark’s tcp and\or http dechunking reassembly has got a bit confused.
@grahamb:
Possibly because your capture is missing some frames from the server?
The capture summary shows the follwing stats:
My side question is: What does this dropped packets statistic mean?
Does it mean the amount of packets dropped only for the capture (So that we are just not able to see them but there have been reached the system),
or mean the number of dropped packets at this interface (so the system hasn´t seen this packets, too)?
Seems that I found the answer to my side question: https://ask.wireshark.org/questions/2095/what-does-packets-dropped-really-mean
So if understand it right, this could be the explanation for the missing frames in the tracefile.
Yep. It looks like the root of the problem is in dissectors/packet-tcp.c:
desegment_tcp function:
When one of the packets is not coming in a proper time, wireshark finds msp structure but it fails the test msp->nxtpdu > seq. As a result, new dissection starts for the newly arrived packet and hence the whole logic breaks. The missed packet comes later but it is too late to process it.
Failed part: