Cumulus Linux supports segment routing, otherwise known as source routing, as it provides the ability for a source node to specify the path a packet should take — in other words, traffic engineering. In some more advanced cases, it could be used to have offline multiprotocol label switching (MPLS) controllers program labels into the network for traffic engineering.
Cumulus Linux provides full label-based forwarding, relying on BGP for label exchange. However, Cumulus Linux does not provide LDP interoperability for MPLS and it does not support VRFs for tenant isolation.
Segment routing is an early access feature in Cumulus Linux 3.4.1 and is supported only on Mellanox switches.
Segment routing is MPLS for the data plane only. In this EA release, Cumulus Linux does not impose the labels, the host does. The MTUs should be large enough to accommodate the MPLS shim header and label stack. Segment routing supports the following features:
- MPLS label edge router (LER) functionality for IPv4 and IPv6 routing with ECMP. An ingress LER first adds an MPLS label to an IP packet. An egress LER removes the outermost MPLS label (also called "popping" the label).
- MPLS label switch router (LSR) functionality with ECMP. The LSR receives a packet with a label and forwards it based on that label.
- FRRouting support for MPLS transit label switched paths (LSPs) and labeled routes (LER), both static routes and routes using BGP labeled-unicast (LU).
- FRR support for BGP/MPLS segment routing based on draft-ietf-idr-bgp-prefix-sid-06.
Consider the following topology. Typically, host1 sends traffic to host2 via r1, r2 and r3. However, you can use segment routing to route traffic through a specific path. In the examples below, HTTP traffic is routed from host1 to host2 via r1, r4, r5 then r3. In addition, FTP traffic is routed via r5 without worrying what path it takes to get there.
For HTTP traffic to be routed from host1 to host2 via r1, r4, r5 then r3, the MPLS controller tells host1 to push label stack 103,105,104 on all HTTP traffic destined for host2; 104 is the outside label and 103 is the inside label. Switch r1 sees label 104, then pops that outermost label and forwards the payload towards switch r4. Switch r4 sees label 105, then pops that label and forwards the payload towards switch r5. Switch r5 sees label 103, then pops that label and forwards the payload towards switch r3. Switch r3 sees just an IP packet, and routes it as usual.
For FTP traffic to be routed from host1 to host2 via r5, the MPLS controller tells host1 to push label stack 105 on all FTP traffic destined for host2. Switch r1 sees label 105, then uses ECMP via swap with label 105 and forwards the payload towards switches r4 and r2. Switches r2 and r4 see label 105, then they pop the label and forward the payload towards switches r5 and r3. Switches r5 and r3 both see just an IP packet, and route it as usual.
Switches r1 through r5 announce their loopbacks (the 10.1.1.* addresses above) in BGP with a label-index.
Configuring Segment Routing
To configure the segment routing example above, use the
label-index option in NCLU. Configure the following on each node:
Then, for each switch in the topology, you need to define the global-block of labels to use for segment routing in FRR. The default global-block is 16000-23999. The example configuration uses global-block "100 200". The local label is the MPLS label global-block plus the label-index.
Viewing the Configuration
You can see the label-index when you show the BGP configuration on a router.
Or from another node in the network:
You can see the FRR MPLS table in the output below, where r1 receives a packet with label 104. Its outbound label is 3, which appears as implicit-null below, so it pops then the payload is forwarded out of swp3, the interface to r4:
You can see the MPLS routing table that got installed in the kernel as well: