A forwarding equivalence class (FEC) is a collection of packets with the same characteristics. Packets of the same FEC are forwarded in the same way on an MPLS network.
FECs can be identified by the source address, destination address, source port, destination port, and VPN. For example, in IP forwarding, packets matching the same route based on the longest match algorithm belong to an FEC.
A label is a short, fixed-length (4 bytes) identifier that is only locally significant. A label identifies an FEC to which a packet belongs. In some cases, such as load balancing, a FEC can be mapped to multiple incoming labels. Each label, however, represents only one FEC on a device.
Compared with an IP packet, an MPLS packet has the additional 4-byte MPLS label. The MPLS label is between the link layer header and the network layer header, and allows use of any link layer protocol. Figure 1 shows position of an MPLS label and fields in the MPLS label.
Label: 20-bit label value.
Exp: 3-bit, used as an extension value. Generally, this field is used as the class of service (CoS) field. When congestion occurs, devices prioritize packets that have a larger value in this field.
S: 1-bit value indicating the bottom of a label stack. MPLS supports nesting of multiple labels. When the S field is 1, the label is at the bottom of the label stack.
TTL: time to live. This 8-bit field is the same as the TTL field in IP packets.
A label stack is an arrangement of labels. In Figure 2, the label next to the Layer 2 header is the top of the label stack (outer MPLS label), and the label next to the Layer 3 header is the bottom of the label stack (inner MPLS label). An MPLS label stack can contain an unlimited number of labels. Currently, MPLS label stacks can be applied to MPLS VPN and Traffic Engineering Fast ReRoute (TE FRR).
The label stack organizes labels according to the rule of Last-In, First-Out. The labels are processed from the top of the stack.
The label space is the value range of the label, and the space is organized in the following ranges:
0 to 15: special labels. For details about special labels, see Table 1.
16 to 1023: label space shared by static LSPs and static constraint-based routed LSPs (CR-LSPs).
1024 or above: label space for dynamic signaling protocols, such as Label Distribution Protocol (LDP), Resource Reservation Protocol-Traffic Engineering (RSVP-TE), and MultiProtocol Border Gateway Protocol (MP-BGP).
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 |
A label that is only valid when it is not at the bottom of a label stack. The label is similar to the Router Alert Option field in IP packets. After receiving such a label, the node sends it to a local software module for further processing. Packet forwarding is determined by the next-layer label. If the packet needs to be forwarded continuously, the node pushes the Router Alert Label to the top of the label stack again. |
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 |
When the label with the value of 3 is swapped on an LSR at the penultimate hop, the LSR pops the label out and forwards the packet to the egress node. Upon receiving the packet, the egress node forwards the packet in IP forwarding mode or according to the next layer label. |
4 to 13 |
Reserved |
None. |
14 |
OAM Router Alert Label |
A label for operation, administration and maintenance (OAM) packets over an MPLS network. MPLS OAM sends OAM packets to monitor LSPs and report faults. OAM packets are transparent on transit nodes and the penultimate LSR. |
15 |
Reserved |
None. |