[c-nsp] understanding interface traffic counters of Cisco router and Cisco switch

Martin T m4rtntns at gmail.com
Wed Nov 9 17:02:36 EST 2011


I made a following setup:

http://img828.imageshack.us/img828/5736/interfacestrafficcounte.png

..and executed "iperf -s -u -fm" in "ubuntu" machine and "iperf -c
10.10.11.2 -fm -u -d -b 10m -t600" in "PE860" machine. Before the test
I cleared all interface counters. Iperf results were following:

root at PE860:~# iperf -c 10.10.11.2 -fm -u -d -b 10m -t600
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 0.12 MByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 10.10.11.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 0.12 MByte (default)
------------------------------------------------------------
[  3] local 10.10.10.2 port 44911 connected with 10.10.11.2 port 5001
[  4] local 10.10.10.2 port 5001 connected with 10.10.11.2 port 49469
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  4]  0.0-600.0 sec    715 MBytes  10.0 Mbits/sec  0.008 ms    0/510205 (0%)
[  4]  0.0-600.0 sec  1 datagrams received out-of-order
[  3]  0.0-600.0 sec    715 MBytes  10.0 Mbits/sec
[  3] Sent 510206 datagrams
[  3] Server Report:
[  3]  0.0-600.0 sec    715 MBytes  10.0 Mbits/sec  0.026 ms
2/510205 (0.00039%)
[  3]  0.0-600.0 sec  1 datagrams received out-of-order
root at PE860:~#


For some reason, the interface counters in switch(Fa0/1, Fa0/2, Fa0/23
and Fa0/24):

Cisco2950#show interfaces Fa0/1 | i packets input|packets output
     510227 packets input, 773472188 bytes, 0 no buffer
     510236 packets output, 773484380 bytes, 0 underruns
Cisco2950#show interfaces Fa0/2 | i packets input|packets output
     510225 packets input, 773476416 bytes, 0 no buffer
     510223 packets output, 773471932 bytes, 0 underruns
Cisco2950#show interfaces Fa0/23 | i packets input|packets output
     510230 packets input, 773476736 bytes, 0 no buffer
     510233 packets output, 773479832 bytes, 0 underruns
Cisco2950#show interfaces Fa0/24 | i packets input|packets output
     510222 packets input, 773471868 bytes, 0 no buffer
     510226 packets output, 773476480 bytes, 0 underruns
Cisco2950#

..show little bit different results than router counters:

C3640#show interfaces Fa2/0 | i packets input|packets output
     510228 packets input, 771431340 bytes
     510230 packets output, 771435816 bytes, 0 underruns
C3640#show interfaces Fa3/0 | i packets input|packets output
     510226 packets input, 771435576 bytes
     510222 packets output, 771430980 bytes, 0 underruns
C3640#

I tried this test multiple times with different bandwidth(-b) values
and always the difference between router counters and switch counters
were ~0.3%. If the difference were 1.2% - 1.3% then it would make
sense because probably in this case router counts only up to IP
header, but switch includes L2 header as well, but what might cause
this 0.3% difference?


regards,
martin


More information about the cisco-nsp mailing list