Here will see how to find out the current network interface throughput statistics on linux. How do I see current kernel snmp counters and network interface statistics on Linux.
Here is the list of command to get statistics details about Linux Network,
nstat command: Network Statistics Tool
nstatis simple tool to monitor kernel snmp counters and network interface statistics.
# nstat
#kernel
IpInReceives 133243 0.0
IpInDelivers 133243 0.0
IpOutRequests 92904 0.0
IcmpOutErrors 97 0.0
IcmpOutTimeExcds 97 0.0
IcmpMsgOutType3 97 0.0
TcpActiveOpens 538 0.0
TcpEstabResets 56 0.0
TcpInSegs 129837 0.0
TcpOutSegs 89720 0.0
TcpRetransSegs 42 0.0
TcpOutRsts 704 0.0
UdpInDatagrams 3255 0.0
UdpNoPorts 97 0.0
UdpOutDatagrams 3270 0.0
Ip6OutNoRoutes 206 0.0
TcpExtTW 141 0.0
TcpExtDelayedACKs 508 0.0
TcpExtDelayedACKLocked 1 0.0
TcpExtDelayedACKLost 42 0.0
TcpExtTCphpHits 117659 0.0
TcpExtTCPPureAcks 2158 0.0
TcpExtTCPHPAcks 605 0.0
TcpExtTCPSackRecovery 1 0.0
TcpExtTCPLossUndo 16 0.0
TcpExtTCPSackFailures 4 0.0
TcpExtTCPFastRetrans 1 0.0
TcpExtTCPSlowStartRetrans 3 0.0
TcpExtTCPTimeouts 33 0.0
TcpExtTCPDSACKOldSent 40 0.0
TcpExtTCPDSACKRecv 5 0.0
TcpExtTCPAbortOnData 120 0.0
TcpExtTCPAbortOnClose 55 0.0
TcpExtTCPSackShiftFallback 9 0.0
IpExtInOctets 180131682 0.0
IpExtOutOctets 7289106 0.0
ss command : Utility To Investigate Sockets
ssis used to dump socket statistics. It allows showing information similar to netstat . It can display more TCP and state informations than other tools.
To check summary of stats
# ss s
Total: 3130 (kernel 3522)
TCP: 120 (estab 2, closed 94, orphaned 0, synrecv 0, timewait 37/0), ports 0
Transport Total IP IPv6
* 3522
RAW 0 0 0
UDP 6 1 5
TCP 26 10 16
INET 32 11 21
FRAG 0 0 0
netstat command : The Old Good Utility To Show Sockets
netstat Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
To see a table of all network interfaces and its summary, enter:
# netstat i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
br-902df 1500 0 373 0 0 0 8 0 0 0 BMRU
docker0 1500 0 18233645 0 0 0 26901596 0 0 0 BMRU
eth0 1500 0 143405830 0 0 0 15774341 0 0 0 BMRU
lo 65536 0 58809 0 0 0 58809 0 0 0 LRU
To see summary statistics for each protocol, enter:
# netstat -s
Ip:
45923465 total packets received
2 with invalid addresses
38259023 forwarded
32721 with unknown protocol
0 incoming packets discarded
7602582 incoming packets delivered
41701239 requests sent out
41 outgoing packets dropped
2 reassemblies required
1 packets reassembled ok
Icmp:
25473 ICMP messages received
4 input ICMP message failed.
ICMP input histogram:
destination unreachable: 89
timeout in transit: 1
echo requests: 25372
echo replies: 11
273699 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 248316
echo request: 11
echo replies: 25372
IcmpMsg:
InType0: 11
InType3: 89
InType8: 25372
InType11: 1
OutType0: 25372
OutType3: 248316
OutType8: 11
Tcp:
303070 active connections openings
295811 passive connection openings
99323 failed connection attempts
86176 connection resets received
2 connections established
3257384 segments received
3129385 segments send out
740 segments retransmited
45 bad segments received.
100902 resets sent
Udp:
54779 packets received
248784 packets to unknown port received.
0 packet receive errors
19669 packets sent
IgnoredMulti: 4016217
UdpLite:
TcpExt:
203279 TCP sockets finished time wait in fast timer
3560 delayed acks sent
5 delayed acks further delayed because of locked socket
Quick ack mode was activated 141 times
12446 packets directly queued to recvmsg prequeue.
900660 bytes directly in process context from backlog
21771279 bytes directly received in process context from prequeue
540284 packet headers predicted
8432 packets header predicted and directly queued to user
950780 acknowledgments not containing data payload received
247347 predicted acknowledgments
16 times recovered from packet loss by selective acknowledgements
44 congestion windows recovered without slow start after partial ack
4 timeouts in loss state
16 fast retransmits
36 retransmits in slow start
128 other TCP timeouts
TCPLossProbes: 754
TCPLossProbeRecovery: 278
2 SACK retransmits failed
152 DSACKs sent for old packets
2 DSACKs sent for out of order packets
42 DSACKs received
12874 connections reset due to unexpected data
86147 connections reset due to early user close
2 connections aborted due to timeout
TCPDSACKIgnoredNoUndo: 41
TCPSpuriousRTOs: 20
TCPSackShiftFallback: 20
TCPDeferAcceptDrop: 18
IPReversePathFilter: 13
TCPRcvCoalesce: 146189
TCPOFOQueue: 13541
TCPOFOMerge: 2
TCPChallengeACK: 47
TCPSYNChallenge: 45
TCPAutoCorking: 8086
TCPFromZeroWindowAdv: 2
TCPToZeroWindowAdv: 2
TCPWantZeroWindowAdv: 11
TCPSynRetrans: 132
TCPOrigDataSent: 1119445
TCPHystartTrainDetect: 28
TCPHystartTrainCwnd: 579
TCPHystartDelayDetect: 11
TCPHystartDelayCwnd: 394
TCPACKSkippedSeq: 21
TCPWinProbe: 16
TCPKeepAlive: 29245
IpExt:
InMcastPkts: 8
OutMcastPkts: 2198
InBcastPkts: 4086966
InOctets: 49122332010
OutOctets: 94816837330
InMcastOctets: 288
OutMcastOctets: 249702