Linux display summary of protocol-level statistics for all network interfaces

by on May 20, 2007 · 0 comments· LAST UPDATED May 20, 2007

in , ,

Q. How do I find out summary of protocol-level (IP, ICMP, TCPetc) statistics for all network interfaces such as eth0, eth1 under Linux?

A. You can use standard netstat command to print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships etc. The same command to -s option displays nice summery summary of protocol-level statistics for all network interfaces

# netstat -s | head -11
Output:

Ip:
    65213088 total packets received
    0 forwarded
    0 incoming packets discarded
    65190740 incoming packets delivered
    69694203 requests sent out
    7 outgoing packets dropped
    7 fragments dropped after timeout
    74 reassemblies required
    31 packets reassembled ok
    7 packet reassembles failed

You can display a table of all network interfaces including send (TX) and received (RX) packets with following command:
# netstat -i
Output:

Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500   0  2111089      0      0      0  3157931      0      0      0 BMRU
eth1       1500   0 24473949      0      0      0 27782130      0      0      0 BMRU
eth1:0     1500   0      - no statistics available -                            BMRU
eth1:1     1500   0      - no statistics available -                            BMRU
eth1:2     1500   0      - no statistics available -                            BMRU
eth1:3     1500   0      - no statistics available -                            BMRU
eth1:4     1500   0      - no statistics available -                            BMRU
lo        16436   0 38978328      0      0      0 38978328      0      0      0 LRU
vmnet8     1500   0        0      0      0      0        5      0      0      0 BMRU

You can display complete report using:
# netstat -s
Output:

Ip:
    65220448 total packets received
    0 forwarded
    0 incoming packets discarded
    65198100 incoming packets delivered
    69701981 requests sent out
    7 outgoing packets dropped
    7 fragments dropped after timeout
    74 reassemblies required
    31 packets reassembled ok
    7 packet reassembles failed
Icmp:
    16896 ICMP messages received
    81 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 6304
        timeout in transit: 513
        redirects: 324
        echo requests: 9728
        echo replies: 2
    28314 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 18586
        echo replies: 9728
Tcp:
    748691 active connections openings
    2147903 passive connection openings
    6902 failed connection attempts
    59598 connection resets received
    7 connections established
    65031695 segments received
    69547445 segments send out
    538462 segments retransmited
    493 bad segments received.
    70494 resets sent
Udp:
    131034 packets received
    18475 packets to unknown port received.
    0 packet receive errors
    135063 packets sent
TcpExt:
    37314 invalid SYN cookies received
    7157 resets received for embryonic SYN_RECV sockets
  20008248 packets directly queued to recvmsg prequeue.
    97028771 packets directly received from backlog
    224583254 packets directly received from prequeue
    23444229 packets header predicted
    27244 packets header predicted and directly queued to user
    TCPPureAcks: 12740601
    TCPHPAcks: 29096274
    TCPRenoRecovery: 85917
    TCPSackRecovery: 0
    TCPSACKReneging: 0
    TCPFACKReorder: 0
    TCPSACKReorder: 0
    TCPRenoReorder: 5140
    TCPTSReorder: 0
    TCPFullUndo: 3
    TCPPartialUndo: 0
    TCPDSACKUndo: 0
    TCPLossUndo: 11
    TCPLoss: 0
    TCPLostRetransmit: 0
    TCPRenoFailures: 25218
    TCPSackFailures: 0
    TCPLossFailures: 25266
    TCPFastRetrans: 134351
    TCPForwardRetrans: 0
    TCPSlowStartRetrans: 172674
    TCPTimeouts: 99808
    TCPRenoRecoveryFail: 32234
    TCPSackRecoveryFail: 0
    TCPSchedulerFailed: 83
    TCPRcvCollapsed: 0
    TCPDSACKOldSent: 0
    TCPDSACKOfoSent: 0
    TCPDSACKRecv: 0
    TCPDSACKOfoRecv: 0
    TCPAbortOnSyn: 0
    TCPAbortOnData: 32369
    TCPAbortOnClose: 12938
    TCPAbortOnMemory: 0
    TCPAbortOnTimeout: 3357
    TCPAbortOnLinger: 0
    TCPAbortFailed: 0
    TCPMemoryPressures: 0
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: