Figure 1 shows the typical structure of an MPLS network, which consists of many label switching routers (LSRs). An MPLS network, also called an MPLS domain, comprises the label edge routers (LERs) and core LSRs. LERs reside on the edge of an MPLS domain and directly connect to one or more nodes that do not run MPLS. Core LSRs directly connect to MPLS-enabled nodes within an MPLS domain.
All LSRs on the MPLS network forward data based on labels. When an IP packet enters an MPLS network, an LER adds a label to it. Before the IP packet leaves the MPLS network, another LER removes the label.
The path that MPLS packets take in an MPLS network is called a label switched path (LSP). The LSP is a unidirectional path that transmits traffic from the ingress to the egress.

The beginning node of an LSP is the ingress. The end node of the LSP is the egress. The nodes between both ends along the LSP are transit nodes. An LSP may have none, one, or several transit nodes and has only one ingress and one egress.
The forwarding equivalence class (FEC) is a set of data flows with the same attributes. Data flows in the same FEC are processed by LSRs in the same way.
FECs can be identified by the address, service type, and QoS. For example, in IP forwarding, packets matching the same route based on the longest match algorithm belong to an FEC.
A label is 20-bit identifier that uniquely identifies the FEC to which a packet belongs. A label is only meaningful to a local end. A FEC can be mapped to multiple incoming labels to balance loads, but a label only represents a single FEC. A label in an MPLS network performs the same function as a virtual path identifier (VPI)/virtual channel identifier (VCI) in an ATM network or a data link connection identifier (DLCI) in a Frame Relay network.
Figure 3 shows the structure of an MPLS header.
The MPLS header contains the following fields:
Label: a 20-bit field that identifies a label value.
Exp: a 3-bit l field used for extension. This field is used by the class of service (CoS) function, which is similar to Ethernet 802.1p.
S: a 1-bit field that identifies the bottom of a label stack. MPLS supports multiple labels that may be stacked. If the S field value is set to 1, the label is at the bottom of the label stack.
TTL: the time to live value. The length is 8 bits. This field is the same as the TTL in IP packets.
Labels are encapsulated between the data link layer and the network layer and supported by all data link layer protocols.
Figure 4 shows the position of the label in a packet.
Label space is the label value range. The router supports the following label ranges:
0 to 15: special labels. For details about special labels, see Table 1.
Each dynamic signaling protocol uses independent and contiguous values.
Label Value |
Label |
Description |
|---|---|---|
0 |
IPv4 Explicit NULL Label |
The label must be popped out (removed), and the packets must be forwarded based on IPv4. If the egress node allocates a label with the value of 0 to the penultimate hop LSR, the penultimate hop LSR pushes label 0 to the top of the label stack and forwards the packet to the egress node. When the egress node detects that the label of the packet is 0, the egress node pops the label out. |
1 |
Router Alert Label |
If a node receives a packet carrying label with this value, the node sends the packet to a software module, without implementing hardware forwarding. The node forwards the packet based on the next layer label. If the packet needs to be forwarded using hardware, the node pushes the Router Alert Label back onto the top of the label stack before forwarding the packet. This label takes effect only when it is not at the bottom of a label stack. |
2 |
IPv6 Explicit NULL Label |
The label must be popped out, and the packets must be forwarded based on IPv6. If the egress node allocates a label with the value of 2 to the LSR at the penultimate hop, the LSR pushes label 2 to the top of the label stack and forwards the packet to the egress node. When the egress node recognizes that the value of the label carried in the packet is 2, the egress node immediately pops it out. |
3 |
Implicit NULL Label |
If the penultimate LSR receives a packet carrying a label with this value, the penultimate LSR removes the label and forwards the packet (now, an IP or VPN packet) to the egress. The egress then forwards the packet over IP or VPN routes. |
4 to 13 |
Reserved |
N/A |
14 |
OAM Router Alert Label |
If the ingress receives a packet carrying a label with this value, the ingress considers it an Operation, Administration and Maintenance (OAM) packet and transparently forwards it to the egress. MPLS OAM sends OAM packets to monitor LSPs and advertise faults. |
15 |
Reserved |
N/A |
A label stack in an MPLS packet contains a set of labels. The label next to the layer-2 header is the top or outer label. The label next to the layer-3 header is the bottom or inner label. Theoretically, there is no limitation to the number of MPLS labels that can be stacked.

The labels are processed from the top of the stack based on the last in, first out principle.
The label forwarding table defines the following label operations:
Push: The ingress adds a label to a packet between the layer-2 header and the IP header before forwarding the packet over an MPLS network. Within an MPLS network, an LSR adds a label to the top of the label stack.
Swap: A transit node replaces a label on the top of the label stack in an MPLS packet with another label, which is assigned by the next hop.
Pop: The penultimate LSR removes the top label from the label stack to decrease the number of labels in the stack. The egress removes a label from the MPLS packet before the packet leaves an MPLS network.
The VPN Option C scenario supports the following action to process labels:
Swappush: swaps an existing outer label for a new one and pushes a label of another tunnel into a packet.
Popgo: pops out outer labels from a packet and pushes a label of another tunnel into the packet.
Penultimate hop popping (PHP) enables the penultimate LSR to pop the label out of the packet. The penultimate node removes the label from a packet to reduce the packet size before sending the packet to the last hop.
PHP is configured on the egress. The PHP-enabled egress advertises a label with value 3 to the penultimate LSR.
Label with value 3, or implicit-null Label, instructs the penultimate LSR to implement PHP on MPLS packets. The MPLS packets are reverted to IP or VPN packets and forwarded to the egress, which forwards the packets over IP routes or based on the next layer label.
A label switching router (LSR) swaps labels and forwards MPLS packets. It is also called an MPLS node. As a fundamental element on an MPLS network, all LSRs support MPLS.
An LER is an LSR that resides on the edge of an MPLS domain. When an LSR connects to a node that does not run MPLS, the LSR acts as the LER.
The LER classifies the packets entering an MPLS domain by FECs and pushes labels into them. Then, the LER forwards MPLS packets based on these labels. When packets leave the MPLS domain, the labels are popped out. The packets again become IP packets and are forwarded.
The path through which packets belonging to a forwarding equivalence class (FEC) pass on an MPLS network is called an LSP.
LSPs are unidirectional and originate from the ingress and terminate at the egress. LSPs perform the same functions on MPLS networks as permanent virtual circuits (PVCs) on ATM and Frame Relay networks, except that the former are not required to use any specific layer-2 technology.
The LSP is a unidirectional path that consists of the following LSRs:
Ingress LSR: the start node on an LSP. An LSP can have only one ingress.
The ingress pushes a new label into the packet and encapsulates the IP packet as an MPLS packet to be forwarded.
Transit LSR: the middle node of an LSP. Multiple transit LSRs may exist on an LSP.
The transit LSR searches for routes in the label forwarding table and swaps labels to forward MPLS packets.
Egress LSR: the end node on an LSP. An LSP can have only one egress.
The egress removes labels from MPLS packets and forwards the resultant IP packets.
Upstream LSRs send MPLS packets to a local LSR. Downstream LSRs are directly connected to and receive MPLS packets from a local LSR.
As shown in Figure 6, for the data flows destined for 192.168.1.0/24, LSRA is the upstream LSR of LSRB, and the LSRB is the downstream LSR of LSRA. Similarly, LSRB is the upstream LSR of LSRC. LSRC is the downstream LSR of LSRB.
An LSR records a mapping between a label and FEC and notifies upstream LSRs of the mapping. This process is called label distribution.
On the network shown in Figure 7, packets with destination address 192.168.1.0/24 are assigned to a specific FEC. LSRB and LSRC assign labels that represent the FEC and advertise the mapping between labels and the FEC to upstream LSRs.
Label distribution protocols, also called signaling protocols, are MPLS control protocols used to identify FECs, distribute labels, and create and maintain LSPs.
MPLS utilizes Label Distribution Protocol (LDP), Resource Reservation Protocol traffic engineering (RSVP-TE), and Multiprotocol Extensions for Border Gateway Protocol (MP-BGP).
As shown in Figure 8, the MPLS architecture consists of a control plane and a forwarding plane.
The control plane is connectionless and is used to distribute labels, create a label forwarding table, and establish or tear down LSPs.
The forwarding plane, also known as the data plane, is connection-oriented. It can apply services and protocols supported by ATM, Frame Relay, and Ethernet networks. The forwarding plane adds labels to IP packets, forwards packets based on the label forwarding table, and removes labels from MPLS packets before the packets.