2

I have a setup of Cisco CSR 1000v routers. I established a GRE tunnel between 2 routers, where the tunnel's source is the GigabitEthernet1 interface.

I aim to measure the load on that GRE tunnel. The load value can be calculated as the following:

Load (%) = Traffic (bps) / bandwidth or capacity (bps)

Where Traffic(bps) is the amount of traffic sent and bandwidth or capacity (bps) is the tunnel's capacity.

Literally, that information can be got from the router, but I got confused which one must be used in such calculation.

The GRE tunnel got the following configuration, and I know the amount of traffic I want to send which is 100Mbps:

interface Tunnel0
 bandwidth 256
 ip address 10.10.1.1 255.255.255.252
 load-interval 30
 ....
 ....
!

Is it correct to calculate the load as I showed above?

I found also the following information on the interface from the CLIcsr1000v#sh interfaces gigabitEthernet1:

csr1000v#show interfaces  gigabitEthernet 1
GigabitEthernet1 is up, line protocol is up 
...
  reliability 255/255, txload 3/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full Duplex, 1000Mbps, link type is auto, media type is Virtual
  output flow-control is unsupported, input flow-control is unsupported
  ...
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  30 second input rate 1000 bits/sec, 3 packets/sec
  30 second output rate 4000 bits/sec, 1 packets/sec
     1003836 packets input, 174201781 bytes, 0 no buffer
     Received 0 broadcasts (0 IP multicasts)
    ...
     169446 packets output, 80281698 bytes, 0 underruns
     ....

There is this txload and rxload values, would be used somehow to measure the loads?

5

rxload/txload are something like "sliding averages" over load-interval with some particularities to the algorithm used; the same can be said about the input/output rate values of the interface.

Furthermore, the rxload/txload value is relative to the bandwidth property of the given interface, which itself is implicitely derived from interface's speed value or manually overwritten with the bandwidth command on the interface.

So in your example, bandwidth 256 (in extenso: 256kbit/s) on the tunnel interface will lead to some very high rx/txload values when there will be a 100Mbit/s flow across that tunnel interface.

input/output rate or rx/txload are good for human-interactive use, but they can be somewhat skewed. For instance, after a large/long transfer at high throughput, it takes quite some time (way longer than load-interval) for the intput/output rate value to "cool down" again, even after the large flow already stopped.

For programmatical use, I suggest to do as SNMP traffic graphers do: Every so often (the polling interval you choose), use SNMP to read the interface's ifInOctets/ifOutOctets (or even better their 64bit variants ifHCInOctets/ifHCOutOctets), and calculate the difference, then report over your polling interval. Optionally, put the values obtained into relation with the interface's bandwidth property (which is also accessible via SNMP), to get something like a percentage.

Suggested reading: https://standalone-sysadmin.com/are-you-monitoring-your-switchports-the-right-way-1d3098ec8938

As suggested in our thread/chat few weeks back - don't bother parsing CLI output to get at these values. That's what SNMP was invented for, and you should be able to find suitable scripts/libraries/tools easily.

  • 1
    Actually, the bandwidth command is only used by higher-layer protocols, e.g. routing protocols or QoS, and it has no actual effect on the load measurements or what the actual interface bandwidth is – Ron Maupin May 24 at 3:01
  • 1
    @RonMaupin The bandwidth command also sets the upper baseline for the device's own rxload/txload calculation. Wheter rx/txload calculation are to be considered 'higher-layer protocols` might be subject of debate - I can see points for both yay and nay. bandwidth also does have an (indirect) effect on load measurements (if load is to be represented as percentage), because SNMP graphers also take the value as their upper baseline, against which they compare the input/output rates they derive from the octet counters. – Marc 'netztier' Luethi May 24 at 6:24
  • @Marc'netztier'Luethi Thanks a lot! Well, I'm using RESTCONF with Yang Model in order to get this information from the tunnel. I just read again the chat we had months ago. I understand fully your point here. I will read about SNMP, if you have other tutorials about how to use it (similar to my study), I would be thankful. – Khalil Mebarkia May 24 at 14:30
6

The answer depends on what you're really trying to measure.

The load (or utilization) can be expressed as amount of data received, data transmitted, or the sum of the two. Which one you choose depends in part on the underlying media.

You also need to decide if you're measuring the traffic in the tunnel, or on the physical interface that the tunnel uses. the latter will include the tunnel overhead, plus any other non-tunneled traffic.

  • Thanks for the explanation. You are absolutely right! I believe I should measure the traffic in the tunnel. However, I still confused which metrics I shall use? the one I have explained or the ones in the csr1000v#sh interfaces Tunnel0. If using the statistics shown in the CLI, how it can be used? – Khalil Mebarkia May 23 at 13:59
  • 2
    To use txload and rxload, divide the numerator by the denominator to get a percentage. – Ron Trunk May 23 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.