Hello, My objective is to generate a script that can output network throughput over time by network stream "Sender IP to Receiver IP". Currently I can do that for a single sender and a single receiver using the script below. However, I have one more additional use case where I have 5 senders and one receiver and my current script will not work for that. My question is using multiple sender IP's and a single receiver IP is there an easy way to generate throughput data overtime for each stream? tshark -r $file -T fields -e frame.time -e frame.len -2 -R "udp"|\ sed -e 's/..\t/\t/' |\ awk -F"\t" '$1==last {sum += $2; next} {printf("%s# %8d bytes/s# %6.2f Mbit/s#\n",last,sum,sum8/1024/1024);last=$1;sum=$2}' output : Jul 27, 2015 12:07:42 579387 bytes/s ( 4.42 Mbit/s) Jul 27, 2015 12:07:43 597240 bytes/s ( 4.56 Mbit/s) Jul 27, 2015 12:07:44 596070 bytes/s ( 4.55 Mbit/s) Jul 27, 2015 12:07:45 595728 bytes/s ( 4.55 Mbit/s) ... .... Thanks, Joe asked 12 Aug '15, 12:35 danjoemart |
One Answer:
There are many ways to do that. Option #1: Use the tshark stats
Output:
Then parse the output with a script to extract the column with the bytes (per second). A more complex example, with filters for different sessions.
Option #2: use tshark in a more generic way
then use a more complex script to extract whatever you need. You can also combine the whole thing with a display filter.
Regards answered 15 Aug '15, 03:11 Kurt Knochner ♦ |