One way to do it is using tshark
.
Do the following :
- Capture traffic with relevant filters on both sides using tshark/tcpdump/whatever produces a pcap formatted file.
- Once finished, run
tshark
option -z
over capture files.
Then :
to get packet and byte rates per second :
tshark -q -r myfile.cap -z io,stat,1
This will produce something like this :
=============================
| IO Statistics |
| |
| Interval size: 1 secs |
| Col 1: Frames and bytes |
|---------------------------|
| |1 |
| Interval | Frames | Bytes |
|---------------------------|
| 0 <> 1 | 29 | 2026 |
| 1 <> 2 | 35 | 2440 |
| 2 <> 3 | 35 | 2440 |
| 3 <> 4 | 43 | 2920 |
| 4 <> 5 | 93 | 5776 |
| 5 <> 5 | 77 | 25758 |
=============================
to get packet and byte aggregation as well as average TCP window :
tshark -q -r myfile.cap -z io,stat,0,"AVG(tcp.window_size)tcp.window_size"
The result will be something of this kind :
==============================================
| IO Statistics |
| |
| Interval size: 5.109 secs (dur) |
| Col 1: Frames and bytes |
| 2: AVG(tcp.window_size)tcp.window_size |
|--------------------------------------------|
| |1 |2 | |
| Interval | Frames | Bytes | AVG | |
|-----------------------------------------| |
| 0.000 <> 5.109 | 312 | 41360 | 41363 | |
==============================================
Now, if you get TCP's window average size out of the equation (you won't get this metric without a tool inspecting traffic), you can use standard monitoring tools to graph whatever you want about packet rates/aggregation on any protocol using for instance cacti.
Edit : Not sure what you meant by sliding window given the (upvoted) other answers. If you meant average of metrics for a given period of time starting at some date (and not TCP window size), then you can do the whole thing by throwing in a date filter with tshark commands.
But it seems you are simply seeking a global monitoring solution. Cacti, collectd, zabbix, shinken, nagios (with icinga or something like that) should be okay for your needs and customizable enough to filter on specific traffic if needed.