9.1 Label Switching Router (LSR)

MPLS can be used for simple unicast IP forwarding. With MPLS unicast IP forwarding, the MPLS forwarding logic forwards packets based on labels. However, when choosing the interfaces out which to forward the packets, MPLS considers only the routes in the unicast IP routing table, so the end result of using MPLS is that the packet flows over the same path as it would have if MPLS were not used, but all other factors were unchanged.

MPLS unicast IP forwarding does not provide any significant advantages by itself; however, many of the more helpful MPLS applications, such as MPLS VPNs and MPLS traffic engineering (TE), use MPLS unicast IP forwarding as one part of the MPLS network. So to understand MPLS as you would typically implement it, you need a solid understanding of MPLS in its most basic form: MPLS unicast IP forwarding. MPLS requires the use of control plane protocols (for example, OSPF and LDP) to learn labels, correlate those labels to particular destination prefixes, and build the correct forwarding tables. MPLS also requires a fundamental change to the data plane's core forwarding logic. This section begins by examining the data plane, which defines the packet-forwarding logic. Following that, this section examines the control plane protocols, particularly the Label Distribution Protocol (LDP), which MPLS routers use to exchange labels for unicast IP prefixes.

9.1.1 MPLS IP Forwarding: Data Plane

MPLS defines a completely different packet-forwarding paradigm. However, hosts do not and should not send and receive labeled packets, so at some point, some router will need to add a label to the packet and, later, another router will remove the label. The MPLS routers-the routers that inject (push), remove (pop), or forward packets based on their labels-use MPLS forwarding logic.

MPLS relies on the underlying structure and logic of Cisco Express Forwarding (CEF) while expanding the logic and data structures as well. First, we will review CEF, followed by details about a new data structure called the MPLS Label Forwarding Information Base (LFIB).

9.1.2 CEF

A router's unicast IP forwarding control plane uses routing protocols, static routes, and connected routes to create a Routing Information Base (RIB). With CEF enabled, a router's control plane processing goes a step further, creating the CEF Forwarding Information Base (FIB), adding a FIB entry for each destination IP prefix in the routing table. The FIB entry details the information needed for forwarding: the next-hop router and the outgoing interface. Additionally, the CEF adjacency table lists the new data-link header that the router will then copy in front of the packet before forwarding.

For the data plane, a CEF router compares the packet's destination IP address to the CEF FIB, ignoring the IP routing table. CEF optimizes the organization of the FIB so that the router spends very little time to find the correct FIB entry, resulting in a smaller forwarding delay and a higher volume of packets per second through a router. For each packet, the router finds the matching FIB entry, then finds the adjacency table entry referenced by the matching FIB entry, and forwards the packet as shown below:

9.1.3 MPLS Unicast Forwarding

The MPLS forwarding paradigm assumes that hosts generate packets without an MPLS label; then, some router imposes an MPLS label, other routers forward the packet based on that label, and then other routers remove the label. The end result is that the host computers have no awareness of the existence of MPLS.

MPLS Packet Forwarding-End to End

The steps from the figure are explained as follows:

1. Host A generates and sends an unlabeled packet destined to host 10.3.3.3.

2. Router CE1, with no MPLS features configured, forwards the unlabeled packet based on the destination IP address, as normal, without any labels. (Router CE1 may or may not use CEF.)

3. MPLS router PE1 receives the unlabeled packet and decides, as part of the MPLS forwarding process, to impose (push) a new label (value 22) into the packet and forwards the packet.

4. MPLS router P1 receives the labeled packet. P1 swaps the label for a new label value (39) and then forwards the packet.

5. MPLS router PE2 receives the labeled packet, removes (pops) the label, and forwards the packet toward CE2.

6. Non-MPLS router CE2 forwards the unlabeled packet based on the destination IP address, as normal. (CE2 may or may not use CEF.)

The steps listed above show a relatively simple process and provide a great backdrop from which to introduce a few terms. The term Label Switch Router (LSR) refers to any router that has awareness of MPLS labels, for example, routers PE1, P1, and PE2 in this figure.

MPLS LSR Terminology Reference

LSR Type

Actions Performed by This LSR Type

Label Switch

Router (LSR)

Any router that pushes labels onto packets, pops labels from packets, or simply forwards labeled packets.

Edge LSR (E-LSR)

An LSR at the edge of the MPLS network, meaning that this router processes both labeled and unlabeled packets.

Ingress E-LSR

For a particular packet, the router that receives an unlabeled packet and then inserts a label stack in front of the IP header.

Egress E-LSR

For a particular packet, the router that receives a labeled packet and then removes all MPLS labels, forwarding an unlabeled packet.

ATM-LSR

An LSR that runs MPLS protocols in the control plane to set up ATM virtual circuits. Forwards labeled packets as ATM cells.

ATM E-LSR

An E-edge LSR that also performs the ATM Segmentation and Reassembly (SAR) function.

MPLS Forwarding Using the FIB and LFIB

To forward packets, LSRs use both the CEF FIB and the MPLS LFIB when forwarding packets. Both the FIB and LFIB hold any necessary label information, as well as the outgoing interface and next-hop information.

The FIB and LFIB differ in that routers use one table to forward incoming unlabeled packets, and the other to forward incoming labeled packets, as follows:

  • FIB- Used for incoming unlabeled packets. Cisco IOS matches the packet's destination IP address to the best prefix in the FIB and forwards the packet based on that entry.

  • LFIB- Used for incoming labeled packets. Cisco IOS compares the label in the incoming packet to the LFIB's list of labels and forwards the packet based on that LFIB entry.