The key components of an MPLS network are the label edge router (LER) that performs the classification and assigns the label. Label switch routers (LSRs) are core routers in the network that switch packets based on the assigned MPLS label. Each router has a label information base (LIB) that maps incoming MPLS packets to outgoing interfaces. The end-to-end connection is the label switch path (LSP). There is a common protocol used called the Label Distribution Protocol (LDP). LDP communicates label information between MPLS-speaking neighbors to establish the LSP.
The Forwarding Equivalency Class (FEC) is a group of packets that require the same treatment over the same LSP. Packets are grouped based on either the IP address prefix, the host address, or quality of service markings. The FEC value assigned is then added to the label.
The LER receives the unmarked packet at the edge of the MPLS network, adds the MPLS label, and forwards the packet into the MPLS domain. The egress LER removes the label and delivers the packet to the external edge network.
The Label Switch Router (LSR) performs the backbone forwarding functions using label swapping. Each LSR examines the label at the top of the stack and references its LIB to find the outgoing path and the outgoing label to be used. The LSR removes the old label, attaches the new label, and forwards the packet on the predetermined path.
The LSP defines the path through the LSRs from the ingress point of the MPLS network to the egress router. All LSPs are unidirectional, so for each flow, there will be two paths, one in each direction. The LSPs do not need to take the shortest path in the routing table and can be assigned a predefined path using traffic engineering.
The MPLS label is fixed length at 32 bits and attached to each packet. The labels are local between two routers and not globally significant. Routers can have multiple labels in their tables referencing different connected routers and classes of service. The downstream, or originating, MPLS router creates the label value, binds it to the forwarding class, and informs the upstream router of the label binding value using the LDP protocol. The labels can be stacked to create a hierarchy where each packet can have several labels attached to it. This is useful when traffic crosses multiple networks allowing the packets to be tunneled through the intermediary networks.
MPLS route selection uses the LDP as the method of selecting an LSP for a particular flow. LDP is a defined set of procedures and messages that LSRs exchange to establish the LSP path. LPD can be either hop by hop or explicit. With hop by hop, each LSR independently selects the next hop, as is the mode of traditional IP routing, but without the processing overhead. Explicit routing is where a single router, which is usually the edge or ingress LER, specifies which LSRs the packet must traverse and is assigned as the packet enters the MPLS domain. By specifying the path, traffic engineering can be defined to explicitly specify the path you want the flow to traverse to its destination.
The LIB is a table in each LSR that contains the incoming label, the outgoing label, and prefix address.
MPLS forwarding works by using the underlay IP routed network to establish routes to destination networks just as traditional networks do. The LDP protocol creates labels to populate the LIB in each router. The ingress LER receives the incoming packet and adds the MPLS label to the frame. The LSRs then forward the labeled packets using label swapping. At the egress LER, the LER removes the MPLS label and delivers the standard Ethernet packet to the network attached to the MPLS domain.