Skip to main content
Version: 7.26

Traffic engineering

A traffic engineering (TE) tunnel is a label switched path that the head-end router sets up with RSVP-TE. The tunnel follows an explicit path, or a path that the head-end router calculates with constraint-based shortest path first (CSPF) from the TE information that OSPF floods: the TE metric and the available bandwidth of each link. Each router along the path reserves the tunnel's bandwidth on its outgoing link.

RouterOS sends VPLS traffic over a TE tunnel when the tunnel ends at the remote endpoint of the pseudowire: an LDP-signalled or BGP-signalled VPLS pseudowire to the router at the tunnel's to-address uses the tunnel instead of the LDP path. A tunnel is not an interface, and routes cannot use it as a gateway: IP traffic to the tunnel's to-address keeps the LDP labels of the IGP path.

The configuration is in /mpls/traffic-eng:

  • interface: the links where RSVP-TE runs, with their reservable bandwidth and TE metric.
  • path: a dynamic (CSPF) path or a list of explicit hops.
  • tunnel: the tunnel on the head-end router, with its destination, bandwidth, primary path and secondary paths.
  • flow: the RSVP sessions that pass through, start or end on the router.

Bandwidth settings, such as bandwidth of a TE interface or a tunnel, are in bits per second.

Prerequisites​

  • An MPLS network with loopback addresses and an IGP, as in the LDP example.
  • For CSPF, OSPF floods TE information in one area: set mpls-te-area (the area ID) and mpls-te-address (the loopback address) on the OSPF instance of every router.
  • A TE interface on every link the tunnels can use, on every router.

Example setup​

The example extends the LDP example with a link between R1 and R4, which closes the four routers into a ring. R2 is the head end of a tunnel to R4. Two paths lead from R2 to R4: through R3 and through R1. The link between R1 and R4 has TE metric 20, so CSPF prefers the path through R3.

graph LR
    R1["<b>R1</b><br/>lo 10.255.255.1"]
    R2["<b>R2</b><br/>lo 10.255.255.2"]
    R3["<b>R3</b><br/>lo 10.255.255.3"]
    R4["<b>R4</b><br/>lo 10.255.255.4"]

    R1 ---|"10.0.12.0/30"| R2
    R2 ---|"10.0.23.0/30"| R3
    R3 ---|"10.0.34.0/30"| R4
    R4 ---|"ether3 - ether3<br/>10.0.14.0/30<br/>TE metric 20"| R1

The new link on R1:

/ip/address
add address=10.0.14.1/30 interface=ether3
/routing/ospf/interface-template
add area=backbone interfaces=ether3 type=ptp
/mpls/ldp/interface
add interface=ether3

On R4:

/ip/address
add address=10.0.14.2/30 interface=ether3
/routing/ospf/interface-template
add area=backbone interfaces=ether3 type=ptp
/mpls/ldp/interface
add interface=ether3

OSPF TE extensions and TE interfaces​

On each router, enable the TE extensions of OSPF in the backbone area (area ID 0.0.0.0) and add the links as TE interfaces with their reservable bandwidth.

R1:

/routing/ospf/instance
set ospf-v2 mpls-te-address=10.255.255.1 mpls-te-area=0.0.0.0
/mpls/traffic-eng/interface
add interface=ether2 bandwidth=1M
add interface=ether3 bandwidth=1M te-metric=20

R2:

/routing/ospf/instance
set ospf-v2 mpls-te-address=10.255.255.2 mpls-te-area=0.0.0.0
/mpls/traffic-eng/interface
add interface=ether2 bandwidth=1M
add interface=ether3 bandwidth=1M

R3:

/routing/ospf/instance
set ospf-v2 mpls-te-address=10.255.255.3 mpls-te-area=0.0.0.0
/mpls/traffic-eng/interface
add interface=ether2 bandwidth=1M
add interface=ether3 bandwidth=1M

R4:

/routing/ospf/instance
set ospf-v2 mpls-te-address=10.255.255.4 mpls-te-area=0.0.0.0
/mpls/traffic-eng/interface
add interface=ether2 bandwidth=1M
add interface=ether3 bandwidth=1M te-metric=20

The TE metric of a link is set on the routers at both of its ends, because each router advertises its own direction of the link. A TE interface without te-metric has TE metric 1, also when the OSPF cost of the link is higher. OSPF floods it in the TE information of the link (metric=1 in the opaque LSA).

Tunnel with a secondary path​

On R2, create a dynamic path that CSPF calculates and an explicit path through R1. Each hop of an explicit path is an address with /strict (the next hop must be this address, directly connected) or /loose. Then create the tunnel to R4 with the dynamic path as the primary path and the explicit path as the secondary path:

/mpls/traffic-eng/path
add name=dynamic use-cspf=yes record-route=yes
add name=via-r1 use-cspf=no record-route=yes \
hops=10.0.12.1/strict,10.0.14.2/strict
/mpls/traffic-eng/tunnel
add name=te-r4 from-address=10.255.255.2 to-address=10.255.255.4 \
bandwidth=200k primary-path=dynamic secondary-paths=via-r1

Check the tunnel​

The F flag shows that the tunnel forwards traffic. forwarding-on shows the path in use, the outgoing interface, the next hop and the label. In primary, ExplRoute is the path the tunnel was signalled with, and RecRoute the recorded route with the label each hop assigned. R4, the egress router, assigned label 0, the explicit null label: a TE tunnel keeps a label up to the egress router. The Bw value in the RSVP data is in bytes per second (25000 bytes per second is 200 kbit/s).

[admin@MikroTik] > /mpls/traffic-eng/tunnel/print detail
Flags: F - FORWARDING
0 F name="te-r4" from-address=10.255.255.2 to-address=10.255.255.4
bandwidth=200kbps primary-path=dynamic secondary-paths=via-r1
session="10.255.255.4|1|10.255.255.2"
forwarding-on="primary, Iface=ether3, Nexthop=10.0.23.2, Label=35"
primary="Path=dynamic, Bw=25000, Sender=10.255.255.2|1,
ExplRoute={10.0.23.2|strict,10.0.34.1|strict,10.0.34.2|strict},
RecRoute={10.0.34.1,*35*,10.0.34.2,*0*}"

The RSVP flows of the tunnel: on R2, the head end, the flow has the N (ingress) and R (reservation) flags:

[admin@MikroTik] > /mpls/traffic-eng/flow/print
Flags: N - INGRESS; R - RESERVATION
Columns: VRF, SESSION, SENDER, BW
# VRF SESSION SENDER BW
0 NR main 10.255.255.4|1|10.255.255.2 10.255.255.2|1 200.0kbps

On R4, the tail end, it has the E (egress) flag:

[admin@MikroTik] > /mpls/traffic-eng/flow/print
Flags: E - EGRESS
Columns: VRF, SESSION, SENDER, BW
# VRF SESSION SENDER BW
0 E main 10.255.255.4|1|10.255.255.2 10.255.255.2|1 200.0kbps

VPLS over the tunnel​

The VPLS example has an LDP-signalled pseudowire b-r4 from R2 to R4. With the tunnel up, the pseudowire uses it: te-tunnel shows the tunnel, and the transport label is the tunnel's label.

[admin@MikroTik] > /interface/vpls/monitor b-r4 once
remote-label: 21
local-label: 21
remote-status:
te-tunnel: te-r4
nexthops: { label=35; nh=10.0.23.2; interface=ether3 }

Reoptimization​

A tunnel that is up stays on its path when the network changes, even when a better path appears. For example, a TE metric of 100 on the link from R3 to R4 makes the path through R1 the better one. On R3:

/mpls/traffic-eng/interface
set [find interface=ether3] te-metric=100

The tunnel still uses the path through R3:

[admin@MikroTik] > /mpls/traffic-eng/tunnel/print detail
Flags: F - FORWARDING
0 F name="te-r4" from-address=10.255.255.2 to-address=10.255.255.4
bandwidth=200kbps primary-path=dynamic secondary-paths=via-r1
session="10.255.255.4|1|10.255.255.2"
forwarding-on="primary, Iface=ether3, Nexthop=10.0.23.2, Label=35"
primary="Path=dynamic, Bw=25000, Sender=10.255.255.2|1,
ExplRoute={10.0.23.2|strict,10.0.34.1|strict,10.0.34.2|strict},
RecRoute={10.0.34.1,*35*,10.0.34.2,*0*}"

With reoptimize-interval on a CSPF path, the head end recalculates the path at that interval and moves the tunnel when it finds a better path. On R2:

/mpls/traffic-eng/path
set [find name=dynamic] reoptimize-interval=1m

After the next reoptimization, the tunnel uses the path through R1. The head end signals the new path as a new RSVP session, and the tunnel number in session changes from 1 to 2:

[admin@MikroTik] > /mpls/traffic-eng/tunnel/print detail
Flags: F - FORWARDING
0 F name="te-r4" from-address=10.255.255.2 to-address=10.255.255.4
bandwidth=200kbps primary-path=dynamic secondary-paths=via-r1
session="10.255.255.4|2|10.255.255.2"
forwarding-on="primary, Iface=ether2, Nexthop=10.0.12.1, Label=19"
primary="Path=dynamic, Bw=25000, Sender=10.255.255.2|119,
ExplRoute={10.0.12.1|strict,10.0.14.1|strict,10.0.14.2|strict},
RecRoute={10.0.14.1,*19*,10.0.14.2,*0*}"

To reoptimize immediately, without waiting for the interval, run the reoptimize command on the head end. The command has no argument to select a tunnel:

/mpls/traffic-eng/tunnel/reoptimize

All TE parameters are described in the traffic engineering CLI reference.