Basic concepts
FEC
MPLS groups packets with the same characteristics (such as packets with the same destination or service class) into a class, called a "forwarding equivalence class (FEC)." Packets of the same FEC are handled in the same way on an MPLS network.
Label
A label uniquely identifies a FEC and has local significance.
Figure 1: Format of a label
A label is encapsulated between the Layer 2 header and Layer 3 header of a packet. It is four bytes long and consists of the following fields:
Label—20-bit label value.
TC—3-bit traffic class, used for QoS. It is also called "Exp."
S—1-bit bottom of stack flag. A label stack can contain multiple labels. The label nearest to the Layer 2 header is called the "top label," and the label nearest to the Layer 3 header is called the "bottom label." The S field is set to 1 if the label is the bottom label and set to 0 if not.
TTL—8-bit time to live field used for routing loop prevention.
LSR
A router that performs MPLS forwarding is a label switching router (LSR).
LSP
A label switched path (LSP) is the path along which packets of a FEC travel through an MPLS network.
An LSP is a unidirectional packet forwarding path. Two neighboring LSRs are called the "upstream LSR" and "downstream LSR" along the direction of an LSP. In Figure 2, LSR B is the downstream LSR of LSR A, and LSR A is the upstream LSR of LSR B.
Figure 2: Label switched path
LFIB
The Label Forwarding Information Base (LFIB) on an MPLS network functions like the Forwarding Information Base (FIB) on an IP network. When an LSR receives a labeled packet, it searches the LFIB to obtain information for forwarding the packet, such as the label operation type, the outgoing label value, and the next hop.
Control plane and forwarding plane
An MPLS node consists of a control plane and a forwarding plane.
Control plane—Assigns labels, distributes FEC-label mappings to neighbor LSRs, creates the LFIB, and establishes and removes LSPs.
Forwarding plane—Forwards packets according to the LFIB.