Cisco – How exactly is “input rate” calculated in IOS “sh int” output

ciscocisco-commandscisco-iosinterface

Cisco IOS routers display input and output bps and pps values for load-interval time period in sh int output. For example here is load-interval set to 30 seconds:

C1921#sh int Gi0/1 | i rate 
  30 second input rate 0 bits/sec, 0 packets/sec
  30 second output rate 0 bits/sec, 0 packets/sec
C1921#

Am I correct that "input rate" is simply an average value of packets input(for pps) and bytes(for bps) counters for load-interval period of time? Both packets input and bytes counters are seen in sh int output.

Best Answer

Those are the average input and output rates, seen by the interface (in the last 30 seconds, for your example). The load-interval <seconds> command will let you change the time period, but I believe that 30 seconds is the shortest time period accepted.

You are incorrect about it being bytes. It is bits per second (bps). Bytes per second is Bps (upper-case B), but bits per second is bps (lower-case b). That interface is a 1 Gbps (1,000,000,000 bps) interface. If that interface sent the maximum bps for one second during the 30 second interval, and nothing else, you would see 33,333,333 as the output rate. Basically, you take the number of bits transferred in a direction (input or output) and divide it by the load-interval number of seconds to arrive at the bits/sec rate for that direction. The same thing happens for packets.