Is there a way with
Ubuntu 10.4LTS to detect and aggregate the number of packets transmitted over every port?
In other words, I'd like a process to keep track of the number of packets sent to each TCP port (whether or not a connection is established), and aggregate the number of packets, generating output like this:
PORT ATTEMPTS 22: 2535 67: 12424 6135: 1 6136: 1 6137: 1 11211: 244
It wouldn't hurt if the program kept track of other information, such as the packet flags (TCP SYN, connect, ACK, etc.), ideally by percentage.
I'm not aware of any program to do this seemingly fairly simple accounting, but I assume there is one. I'd be grateful for any information about what programs can provide this information.
Thank you for reading.