This section provides an overview of the common MPLS-related terminology used for the rest of this book:
Figure 1-4 depicts the network in Figure 1-2 with all routers identified as LSRs or Edge LSRs based on their location and operation in the MPLS domain.
Figure 1-4. LSR and Edge LSR
Figure 1-5. Upstream and Downstream
The format of an MPLS label is shown in Figure 1-6.
Figure 1-6. MPLS Label
An MPLS label consists of the following parts:
The 20-bit label value is a number assigned by the router that identifies the prefix in question. Labels can be assigned either per interface or per chassis. The 3-bit experimental field defines the QoS assigned to the FEC in question that has been assigned a label. For example, the 3 experimental bits can map to the 7 IP precedence values to map the IP QoS assigned to packets as they traverse an MPLS domain.
A label stack is an ordered set of labels where each label has a specific function. If the router (Edge LSR) imposes more than one label on a single IP packet, it leads to what is called a label stack, where multiple labels are imposed on a single IP packet. Therefore, the bottom-of-stack indicator identifies if the label that has been encountered is the bottom label of the label stack.
The TTL field performs the same function as an IP TTL, where the packet is discarded when the TTL of the packet is 0, which prevents looping of unwanted packets in the network. Whenever a labeled packet traverses an LSR, the label TTL value is decremented by 1.
The label is inserted between the Frame Header and the Layer 3 Header in the packet. Figure 1-7 depicts the label imposition between the Layer 2 and Layer 3 headers in an IP packet.
Figure 1-7. MPLS Label Imposition
If the value of the S bit (bottom-of-stack indicator) in the label is 0, the router understands that a label stack implementation is in use. As previously mentioned, an LSR swaps only the top label in a label stack. An egress Edge LSR, however, continues label disposition in the label stack until it finds that the value of the S bit is set to 1, which denotes a bottom of the label stack. After the router encounters the bottom of the stack, it performs a route lookup depending on the information in the IP Layer 3 Header and appropriately forwards the packet toward the destination. In the case of an ingress Edge LSR, the Edge LSR might impose (push) more than one label to implement a label stack where each label in the label stack has a specific function.
Label stacks are implemented when offering MPLS-based services such as MPLS VPN or MPLS traffic engineering. In MPLS VPN (see Chapter 3, "Basic MPLS VPN Overview and Configuration"), the second label in the label stack identifies the VPN. In traffic engineering (see Chapter 9), the top label identifies the endpoint of the TE tunnel, and the second label identifies the destination. In Layer 2, VPN implementations over MPLS, such as AToM (see Chapter 11, "Any Transport over MPLS [AToM]") and VPLS (see Chapter 12, "Virtual Private LAN Service [VPLS]), the top label identifies the Tunnel Header or endpoint, and the second label identifies the VC. All generic iterations of the label stack implementation are shown in Figure 1-8.
Figure 1-8. MPLS Label Stack