# MPLS - Multiprotocol Label Switching
## What is MPLS
MPLS stands for Multiprotocol Label Switching. It is a networking technology that uses short fixed-length labels to forward packets instead of long network addresses. MPLS operates between Layer 2 and Layer 3 of the OSI model and is sometimes called a Layer 2.5 protocol. It was developed to speed up packet forwarding and to enable traffic engineering capabilities that are not possible with traditional IP routing. MPLS is widely used by internet service providers and large enterprise networks.
## How MPLS Works
In traditional IP routing every router performs a routing table lookup for each packet to determine the next hop. This lookup involves comparing the destination IP address against routing table entries and can be complex for large routing tables. MPLS simplifies this by assigning short labels to packets at the entry point of the MPLS network. Subsequent routers forward packets based only on these labels using simple label lookup tables. Label lookups are much faster than routing table lookups.
When a packet enters an MPLS network at an ingress label edge router, the router examines the packet's destination IP address, determines the appropriate label switched path, adds an MPLS label to the packet, and forwards it. Intermediate routers called label switch routers examine only the label and use a label forwarding table to determine the outgoing interface and the new label to apply. When the packet reaches the egress label edge router the label is removed and the packet is forwarded using normal IP routing to its final destination.
## MPLS Label
An MPLS label is a 32-bit field inserted between the Layer 2 header and the Layer 3 IP header. The label field is 20 bits and identifies the label switched path. The traffic class field is 3 bits used for quality of service. The stack bit indicates whether this is the last label in a stack of labels. The time to live field works like the IP TTL field.
## Label Switched Paths
A label switched path or LSP is a predetermined path through the MPLS network. LSPs are established using signaling protocols before traffic flows. Once an LSP is established all packets on that path follow the same route through the network. This predictable path enables traffic engineering where specific flows can be directed through specific network paths based on bandwidth requirements, latency requirements, or administrative policies.
## MPLS VPNs
MPLS is widely used to create VPN services for enterprise customers. A service provider creates separate MPLS VPNs for different customers. Customer traffic is isolated within each VPN even though it shares the same physical infrastructure. This allows service providers to offer private network services over their shared infrastructure at lower cost than dedicated leased lines.
## Advantages of MPLS
MPLS enables fast packet forwarding through simple label lookups. It enables traffic engineering allowing administrators to control traffic flow. It supports quality of service through differentiated label switched paths for different traffic classes. MPLS VPNs provide secure and isolated connectivity for enterprise customers.Back to Subject