i have a large pcap with more than 1000 tcp flows. i want to filter major flows say with packets greater than 100. if i go to conversations and right click on those flows, i can filter those flows, but then i have to do it several times and since i have huge pcap, it may exceed 100. is there any other quick display filter i can use which will give me flows having number of packets > n (n being any +ve integer).
say some filter like :
flow.num_pkt > 100
which can give me all such flows.
thanks a lot,
any help will be greatly appreciated.
Bro is an apt tool for connection-oriented analysis. To find the number of packets per flow, you run simply run Bro on the trace and extract the value from the logs:
This gives the following output:
The tool
bro-cut
ships with Bro and provides a convenient way to extract certain named columns from the logs. For this task, you want:id.orig_h
: IP of the connection originator (source)id.orig_p
: Transport-layer port of the connection originator (source)id.resp_h
: IP of the connection responder (destination)id.resp_p
: Transport-layer port of the connection responder (source)orig_pkts
: Number of packets sent by the originatorresp_pkts
: Number of packets sent by the responderNote the
awk
filter expression:It restricts the output to those connections that have a total number of packets greater than 100.
Unless you have fixed-size packets, I encourage you to also investigate other metrics, such as packet size (IP or TCP payload). These are readily in the connection logs via the
orig_bytes
andresp_bytes
columns.