0

Linux has the ability to display protocol statistics with netstat -s. The output looks something like:

Excerpt:

7487 times unabled to send RST due to no memory
TCPDSACKIgnoredOld: 817
TCPDSACKIgnoredNoUndo: 7246527
TCPSpuriousRTOs: 4583587
TCPSackShifted: 15825
TCPSackMerged: 455582

But these are accumulated over all networking interfaces. Is there a way to see these statistics per interface? I know that there are packet level statistics in /sys/class/net/$INTERFACE/statistics, but have not been able to find any protocol related ones.

data
  • 111
  • 1
  • 3

2 Answers2

1

Netstat -s is a more intuitive display of /proc/net/netstat. Counters in it are global and not per interface. To get that kind of information you will need to use/write a monitoring tool using libpcap.

Xavier Lucas
  • 13,095
  • 2
  • 44
  • 50
  • I am aware of it. But as that file isn't necessarily the full extent of statistics that are being kept, I was hoping for something else. Libpcap has too great of an overhead/will not keep up with the data rate, so that solution is out. – data Dec 15 '14 at 18:07
0

The code which captures these statistics is called in the various related TCP/UDP/IP codepaths and increments SNMP MIBs.

There is no information stored about interface or any connection properties like port or IP, it's only a basic counter of the times that codepath has been entered.

netstat -s just reads those counters.

suprjami
  • 3,536
  • 21
  • 29