What MPLS is
MPLS (Multiprotocol Label Switching) attaches a short numeric label to a packet as it first enters a network, and forwards it at every subsequent hop based only on that label rather than re-analyzing the full IP header. It's faster than ordinary routing, which recalculates the best path at every hop by examining the entire IP header, and because it can carry protocols beyond IP, it earned the name 'multiprotocol.'
How label switching actually works
A short label is inserted between the IP header and the data-link header when a packet enters an MPLS network. Devices inside the network forward the packet to a predetermined next hop by reading only that label value, instead of re-examining the full destination IP address. The label is stripped once the packet nears its destination, returning it to an ordinary IP packet.
The different roles of LER and LSR
A Label Edge Router (LER) sits at the entry and exit points of an MPLS network, attaching labels to incoming IP packets (at the entrance) or removing them (at the exit). A Label Switch Router (LSR) sits inside the network and forwards packets to the next device purely based on the label value. Because interior devices never need to re-examine IP addresses, their processing load is lower.
The concept of a Forwarding Equivalence Class (FEC)
An FEC (Forwarding Equivalence Class) is a group of packets that can be treated the same way. For example, packets heading to the same destination range, or traffic needing the same quality of service (QoS), can be grouped into a single FEC and assigned the same label, letting routing decisions happen at the group level rather than per packet.
MPLS VPN and label stacking
MPLS supports stacking multiple labels rather than just one. MPLS VPN uses this to let a carrier separate multiple corporate customers' traffic over a single shared physical backbone, using labels to keep each customer's traffic from mixing with another's -- a widely used, cost-effective way to build private networks between a company's branch offices.
MPLS traffic engineering (MPLS-TE)
Ordinary IP routing tends to funnel traffic onto a single shortest path, but MPLS traffic engineering (TE) lets an administrator deliberately steer specific traffic onto a different, less congested path even if it isn't the shortest one. This helps large networks with multiple available paths, like a carrier's backbone, use their bandwidth more evenly.
How it relates to plain IP routing and SD-WAN
MPLS has long been the standard for enterprise leased lines because of its predictable paths and strong quality-of-service guarantees, but its dependence on carrier circuits makes it expensive to build and expand. That's driving a shift toward pairing MPLS with SD-WAN -- which intelligently combines multiple paths in software over ordinary internet connections -- or replacing some segments with SD-WAN outright in a hybrid setup.