Manual:TE tunnel auto bandwidth

From MikroTik Wiki
Jump to: navigation, search

Overview

By default MPLS TE tunnels do not apply any rate limitation on traffic that is sent over the TE tunnel. In this way the "bandwidth" settings for MPLS TE enabled interfaces and TE tunnels are only used for reservation accounting. There is also no means to adjust the bandwidth that is reserved for a TE tunnel other than by changing the tunnel configuration regardless of the actual amount of traffic sent over the tunnel. To make TE tunnels more flexible and easy to use, the following features have therefore been introduced:

  • Bandwidth limitation
  • Automatic bandwidth adjustment

These features operate on the tunnel head end (ingress) router. These features can either be used alone or in combination.

Bandwidth limitation

The TE tunnel can be configured to limit the rate at which traffic is allowed to enter the tunnel. Limit is specified on the ingress router as a percentage of the tunnel bandwidth. E.g. creating the following tunnel:

[admin@R1] /interface traffic-eng> add name=te1 from-address=9.9.9.1 to-address=9.9.9.5 \
   bandwidth=100000 bandwidth-limit=120 primary-path=stat

means that the TE tunnel will reserve a bandwidth of 100 kilobits per second across the MPLS backbone from 9.9.9.1 to 9.9.9.5 and that the ingress router will limit the rate of traffic entering the tunnel to 120 kilobits per second (as 120% of 100 kilobits per second bandwidth is 120kbps). This can be confirmed by monitoring tunnel interface:

[admin@R1] /interface traffic-eng> monitor te1
              tunnel-id: 3
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 1
           active-label: 20
     reserved-bandwidth: 100.0kbps
             rate-limit: 120.0kbps
     rate-measured-last: 0bps
  rate-measured-highest: 0bps

Note that by default, any limiting is disabled. By specifying the limit as a percentage of the tunnel bandwidth, TE tunnel bandwidth limits can be configured in various flexible ways - some tunnels can be configured to hard limit while others can be configured with a reasonable reserve, thus achieving different classes of service.

Automatic bandwidth adjustment

Auto bandwidth adjustment feature enables the MPLS TE network to follow the changes of the amount of data transmitted over the tunnel. Bandwidth adjustment feature works as follows:

  • Actual amount of data entering tunnel during averaging interval (auto-bandwidth-avg-interval) is measured, producing average rate.
  • Tunnel keeps track of highest average rate seen during update interval (auto-bandwidth-update-interval)
  • When update interval expires, TE tunnel bandwidth is updated to highest observed average rate, taking into account specified range over which bandwidth is allowed to change (auto-bandwidth-range)

Auto bandwidth adjustment feature gets enabled by specifying auto-bandwidth-range. For example, by adding the following tunnel:

[admin@R1] /interface traffic-eng> add name=te1 from-address=9.9.9.1 to-address=9.9.9.5 \
  bandwidth=100000 primary-path=stat auto-bandwidth-range=10000-500000 \
  auto-bandwidth-avg-interval=10s auto-bandwidth-update-interval=1m

means that the tunnel will measure the average rate over 10 second periods and once a minute it will update the bandwidth in a range from 10 to 500 kilobits per second. Tunnel bandwidth setting specifies the initial bandwidth of the tunnel. The above tunnel in the complete absence of any data over it after 1 minute will change its bandwidth to the specified minimum 10 kbps:

[admin@R1] /interface traffic-eng> monitor te1
              tunnel-id: 3
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 2
           active-label: 21
     reserved-bandwidth: 10.0kbps
             rate-limit: 12.0kbps
     rate-measured-last: 0bps
  rate-measured-highest: 0bps

Additionally, a TE tunnel can be configured to reserve more bandwidth than that measured. This can be achieved with auto-bandwidth-reserve setting which specifies the percentage of additional bandwidth to reserve - so, setting auto-bandwith-reserve to 10 means that the tunnel will reserve 10% more bandwidth than that measured (but it will still obey the auto-bandwidth-range). For example changing the above tunnel and running a constant stream of 50kbps through it will yield the following results:

[admin@R1] /interface traffic-eng> set te1 auto-bandwidth-reserve=30

To begin with, tunnel reserves its initially specified bandwidth:

[admin@R1] /interface traffic-eng> monitor te1
              tunnel-id: 6
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 1
           active-label: 27
     reserved-bandwidth: 100.0kbps
             rate-limit: 120.0kbps
     rate-measured-last: 48.8kbps
  rate-measured-highest: 48.8kbps

After the update period and after previous reservations are torn down, notice how the reserved bandwidth exceeds the average rate by 30%. Also notice that rate-limit correctly changes to 120% of reserved-bandwidth:

[admin@R1] /interface traffic-eng> monitor te1
              tunnel-id: 6
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 2
           active-label: 28
     reserved-bandwidth: 64.4kbps
             rate-limit: 77.3kbps
     rate-measured-last: 48.8kbps
  rate-measured-highest: 48.8kbps

Note that in the case where a reservation must be updated to a lower value, for a brief period after update period reserved-bandwidth will still display the previous reservation value. The reason for this is that the new reservation is made without disrupting the previous tunnel and therefore shares its reservation until the old reservation is torn down. rate-limit in turn is correctly updated to the intended value. In the above example, after stopping the 50kbps stream and after the update period has passed with the tunnel being idle, for a brief period after an update the tunnel info can be:

[admin@R1] /interface traffic-eng> monitor te1
              tunnel-id: 6
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 2
           active-label: 34
     reserved-bandwidth: 63.4kbps
             rate-limit: 12.0kbps
     rate-measured-last: 0bps
  rate-measured-highest: 0bps

After previous reservation (63.4kbps) is torn down, reserved-bandwidth correctly changes to 10kbps:

[admin@R1] /interface traffic-eng> monitor 1
              tunnel-id: 6
     primary-path-state: established
           primary-path: stat
   secondary-path-state: not-necessary
            active-path: stat
           active-lspid: 2
           active-label: 34
     reserved-bandwidth: 10.0kbps
             rate-limit: 12.0kbps
     rate-measured-last: 0bps
  rate-measured-highest: 0bps

Note that auto-bandwidth-reserve is applied to the actual measured bandwidth, before range checking according to auto-bandwidth-range - therefore 10kbps gets reserved, instead of 13kbps.

Combining bandwidth limitation with automatic bandwidth adjustment

Auto bandwidth adjustment can be used in combination with the bandwidth limit feature - bandwidth-limit setting will apply to the bandwidth actually reserved for the tunnel. In order to successfully combine both features, actual bandwidth must be allowed to fluctuate to some extent - e.g. if bandwidth-limit is configured to 100% (this effectively means that the rate will be limited to the bandwidth reserved for the tunnel), then the tunnel will not have any chance to increase it's reservation. Therefore either bandwidth-limit should be configured to more than 100%, or auto-bandwidth-reserve should be configured to more than 0%.