This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Follow TCP stream

0

I understand that "follow tcp stream" allows packets from a single tcp stream to be displayed in order. I captured a Bittorrent traffic that contains more than 30 tcp streams. How can I display all packets from all the tcp streams in order at the same time?

asked 21 Apr '11, 07:47

catfish's gravatar image

catfish
1111
accept rate: 0%


One Answer:

0

"Follow TCP Stream" selects one TCP conversation and opens an additional window with the payload of that one conversation. So I think what you want to do is to have all conversations display their reconstructed payload, and not just the packets themselves (because for that I'd simply answer: "just filter on tcp" :-))

As far as I know there is now way to open multiple payload windows without manual interaction; maybe tshark can help. Synbit? Any ideas? :-)

answered 21 Apr '11, 08:01

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

Thanks for your reply.

What I really want to do is to put all the packets from all the tcp streams shown in the packet list pane IN ORDER (as seen at application level), so my program can analyze them. I don't need to open multiple payload windows. Using filter "tcp" does not resolve packet ordering problem, right?

(21 Apr '11, 08:19) catfish

Using a filter like this, "tcp.stream eq 0 or tcp.stream eq 1 ... or tcp.stream eq n" seems to do the trick.

(21 Apr '11, 09:12) catfish

I don't think that filter is eliminating retransmissions or reordering out-of-order packets for you though...

(21 Apr '11, 09:44) Jasper ♦♦

(@catfish: I converted your "answers" to "comments, as that is the way this Q&A site works best, see the FAQ)

(21 Apr '11, 14:06) SYN-bit ♦♦

Follow TCP stream does not put the packet list in tcp sequence number order. It just filters out one tcp stream and then, for that stream, puts the tcp payload in order as the application would have received it from the tcp buffers.

Does your program need the network packets as input, or does it need the tcp payload as input. In case of the first, that is really not easily done when there are out-of-order packets, duplicates, retransmissions and maybe even missing packets.

In case of the latter, you could use tcpflow

(21 Apr '11, 14:10) SYN-bit ♦♦

I know this conversation is quite old, but SYN-bit's answer caught my attention, because I really need a solution like the one he called "really not easily done" and I'd like to know whether somebody knows how to do thos with missing packets, retransmissions, etc

(12 Feb '14, 06:34) tonivalac

what about the mentioned tcpflow?

(12 Feb '14, 06:40) Kurt Knochner ♦

According to the documentation this tool can only capture data not analyse cap/pcap files or did I miss something?

(12 Feb '14, 06:50) tonivalac

it can also read pcap files (option -r).

Anyway, I believe the current wireshark/tshark "Follow TCP stream" function, does take care about missing and out-of-order frames, at least that's what I have seen with a small test capture file.

(12 Feb '14, 06:52) Kurt Knochner ♦

Okay, I missed that there is a new branch of tcpflow. Well, I guess I'll try the current version of wireshark first. By the way is there a tcpflow version for windows?

(12 Feb '14, 06:59) tonivalac
(12 Feb '14, 07:02) Kurt Knochner ♦
showing 5 of 11 show 6 more comments