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

How to filter TCP conversations without any error packet ?

0

When investigating a large trace, it is easy to point an error packet filtering on tcp.analysis.flags and "Follow TCP stream" for some of them.

Is there a way to get a summary of TCP Conversations for only TCP streams that contain no error packet ?

I got the following idea but have no clue how to implement it:

  • get the list of tcp.stream IDs for packets filtered on tcp.analysis.flags
  • exclude all packets for that streams

asked 30 Oct '15, 05:02

ymartin's gravatar image

ymartin
6113
accept rate: 0%


2 Answers:

1

I got the following idea but have no clue how to implement it:

Please take a look at the examples in the answers of the following questions.

https://ask.wireshark.org/questions/14811/follow-tcp-stream-with-tshark-still-can-not-in-batch-mode
https://ask.wireshark.org/questions/4677/easy-way-to-save-tcp-streams

Both examples wil work on Linux. You'll have to adapt it to your use case.

for stream in `tshark -nr input.pcap -Y "tcp.analysis.flags" -T fields -e tcp.stream | sort -n | uniq`
do
    echo $stream
    tshark -r input.pcap -w stream-$stream.pcap -Y "tcp.stream eq $stream"
done

Then merge all of the pcap files with mergecap and create the conversation statistics in Wireshark or tshark.

tshark -nr merged.pcap -q -z conv,tcp > output.txt

You can also export the conversation stats in the loop

for stream in `tshark -nr input.pcap -Y "tcp.analysis.flags" -T fields -e tcp.stream | sort -n | uniq`
do
    echo $stream
    tshark -nr input.pcap -Y "tcp.stream eq $stream" -q -z conv,tcp >> output.txt
done

Regards
Kurt

answered 02 Nov '15, 04:32

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

0

Hm, you could just try to do it this way, using the standard Wireshark statistics functionality:

  1. filter for not tcp.analysis.flags
  2. open Statistics -> Conversation
  3. select "TCP"
  4. check "Limit to display filter".

You should end up with a list of all conversations that have no error packet (or, more exact, no packet that a TCP analysis was diagnosed for)

answered 31 Oct '15, 10:10

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

Thought the same. But it hasn´t worked for me, at least in my try.
Example: If I have a session where only one packet has the field tcp.analysis.flags (The other 100 have that field not) Then only this packet is not displayed in TCP conversation(with the limit to display...)
At least in my try....

Now, I think this case, which I have described, could be solved with a small script.

(31 Oct '15, 11:15) Christian_R

I agree. My two bullets idea would consist in almost two tshark commands invocation. Any proposal ?

(01 Nov '15, 23:50) ymartin

About what kind of OS do we talk?

(02 Nov '15, 00:11) Christian_R