MPLS puts a short fixed-length label in front of the IP (Internet Protocol) Internet Protocol The network-layer protocol that defines the datagram format and addressing every Internet device must use. introduced in ch. 1 header, so that routers can forward on the label instead of the address. More usefully, it lets an operator send traffic down a path IP routing would never choose.
Words you will meet
-
MPLS (Multiprotocol Label Switching) Multiprotocol Label Switching Fixed-length labels carried in a header between the link and network layers, so routers can forward on a label rather than on a longest-prefix match of an IP address. introduced in ch. 6 — a small header between the link-layer and IP headers, carrying a label.
-
Label-switched router label-switched router Simple A router that forwards on a short label instead of an IP address. Precise An MPLS-capable router. It forwards a frame by looking up the MPLS label in its forwarding table and passing the datagram straight to the right output interface, so it never extracts the destination IP address and never performs a longest-prefix match. An MPLS-enhanced frame can only be sent between routers that are both MPLS capable. introduced in ch. 6 — open in glossary — a router that forwards on that label.
-
Virtual circuit virtual circuit Simple A pre-established path that packets follow, identified by a short label. Precise A network model in which a path is set up before data flows and each packet carries a short fixed-length identifier rather than a full destination address. MPLS borrows the fixed-length label from this world while keeping IP addressing and IP routing underneath — the book calls it blending virtual-circuit techniques into a routed datagram network. introduced in ch. 6 — open in glossary — the older idea MPLS borrows the fixed-length label from.
-
Traffic engineering traffic engineering Simple Choosing link costs to get the traffic pattern you want. Precise Configuring OSPF link weights so that the routing the algorithm produces meets an operator's goal, such as minimising the maximum utilisation over all links. It reverses the usual cause and effect: the desired routing is known first, and the weights that produce it must be found. introduced in ch. 5 — open in glossary — overriding normal IP routing on purpose.
-
Virtual private network virtual private network Simple A customer's separate networks joined across a provider, kept apart from everyone else's. Precise A service in which an ISP uses its own network to connect a customer's various sites, isolating both the resources and the addressing used by that customer from other users crossing the same infrastructure. MPLS is one way to implement it. introduced in ch. 6 — open in glossary — joining a customer’s sites across a provider, kept apart from everyone else’s.
Why this matters
Chapter 5 built routing protocols that compute one least-cost path to each destination. That is usually what you want, and sometimes it is exactly what you do not.
An operator may need some traffic for a destination to take one route and the rest to take another. It might be for policy, for performance, or to keep a customer’s traffic separate. IP routing offers no way to say that.
MPLS does. It is also the chapter’s third example of the same trick, after switched Ethernet and cable: a whole network, standing in as one link.
A label in front of the IP header
MPLS came out of industry work in the mid-to-late 1990s to speed up IP forwarding, by borrowing one idea from virtual-circuit networks: a fixed-length label.
The goal was never to replace destination-based IP forwarding. It was to augment it — label some datagrams selectively, and let routers forward on the label when they can. It works hand in hand with IP, using IP addressing and IP routing underneath.
Click any box to read what that part of the message is for.
Every field, as text
Between the link-layer header and the IP header — which is exactly why both ends of the link have to understand it. Click any field.
In plain words
Look at where the header sits: between the Ethernet header and the IP header.
That position has a consequence the book states immediately. A router that does not speak MPLS would find an MPLS header exactly where it expected the IP header, and be, in the book’s word, “quite confused”. So an MPLS frame can only travel between two routers that both understand it.
A label-switched router forwards by looking the label up and passing the datagram straight to an output interface. It never extracts the destination IP address, and never performs a longest-prefix match.
An island of MPLS routers
Drag any device to rearrange the picture. Hover a link to see its rate, delay and length.
R1 to R4 are MPLS capable; R5 and R6 are ordinary IP routers. Switch between the two journeys: R4 has two labelled paths to the same destination A, which is the whole point of the section.
Read this diagram as text
- R6 · plain IP — wired link — R4 · MPLS
- R5 · plain IP — wired link — R4 · MPLS
- R4 · MPLS — wired link — R3 · MPLS
- R4 · MPLS — wired link — R2 · MPLS
- R3 · MPLS — wired link — D
- R3 · MPLS — wired link — R1 · MPLS
- R2 · MPLS — wired link — R1 · MPLS
- R1 · MPLS — wired link — A
R1 through R4 speak MPLS. R5 and R6 are ordinary IP routers. The labels were handed out backwards, each router telling its upstream neighbour what to send:
- R1 told R2 and R3 that a frame with label 6 will be forwarded to A.
- R3 told R4 that labels 10 and 12 reach A and D.
- R2 told R4 that label 8 reaches A.
| Router | in label | out label | dest | out interface |
|---|---|---|---|---|
| R2 told R4 that label 8 reaches A. It swaps 8 for the 6 that R1 asked for. | ||||
| R3 told R4 that label 10 reaches A. It swaps 10 for 6 as well — R1 asked both its neighbours for the same label. | ||||
| And here is the second route to A — same destination, different interface, different label. IP routing would have given only one. | ||||
Cells marked ⓘ have an explanation — click to read it.
Read them right to left, the way they were built. R1 advertised first, and each router upstream learned a label from its neighbour. Click a row.
Two rows repay attention.
R1’s out label is a dash. The label is removed before delivery, because A is an ordinary IP device. And R4’s in-label column is blank, because datagrams from R5 and R6 arrive with no label at all. R4 is the edge: it pushes the first label, and R1 pops the last one.
R5 is an ordinary IP router, so what reaches R4 is an ordinary IP datagram. This is the edge of the MPLS island, and R4 is where a label first goes on.
Push at the edge, swap in the middle, pop at the far edge. The IP header goes in one end and comes out the other having been read by nobody in between.
Read all steps as text
- It arrives at R4 with no label — R5 is an ordinary IP router, so what reaches R4 is an ordinary IP datagram. This is the edge of the MPLS island, and R4 is where a label first goes on.
- R4 pushes a label and picks a path — R4 chooses. Interface 0 with label 10 goes the upper way through R3; interface 1 with label 8 goes the lower way through R2. Both reach A. An IP router would have had only one least-cost choice.
- R3 swaps 10 for 6 — R3 looks up 10, finds the row for A, writes 6 in its place and sends it out of interface 1. One table lookup on a short fixed-length label — no longest-prefix match, no IP address extracted.
- R1 pops the label and delivers — R1’s row for A has a dash in the out-label column. The MPLS header is removed and an ordinary IP datagram is delivered — because A would be quite confused to find an MPLS header where it expected an IP one.
Two paths to the same place
Look again at R4’s table. It has two rows for destination A — interface 0 with label 10, and interface 1 with label 8.
That is the section’s real point, and the book is explicit that switching speed is not it:
The true advantages of MPLS and the reason for current interest in MPLS, however, lie not in the potential increases in switching speeds, but rather in the new traffic management capabilities that MPLS enables.
In plain words
If R4 were forwarding on IP addresses, the routing protocols of chapter 5 would give it exactly one path to A: the least-cost one. There is no way to express “send half of it the other way”.
With labels there is. An operator can force some traffic for a destination along one path and the rest along another, for any reason at all. That is traffic engineering.
MPLS is also used to restore paths quickly, rerouting onto a precomputed failover path when a link fails. And it is used to build VPN (Virtual Private Network) Virtual Private Network An ISP joins a customer's separate sites across its own network, isolating that customer's addressing and resources from everyone else's. introduced in ch. 6 s: an ISP (Internet Service Provider) Internet Service Provider Connects hosts, and other ISPs, to the rest of the Internet. introduced in ch. 1 connects a customer’s separate networks across its own MPLS network, isolating that customer’s addressing and resources from everybody else crossing it.
One row of Figure 6.29 does not match the others
R1 delivers to A with an out label of –: the label is popped, because A is an ordinary IP device.
R3 delivers to D with an out label of 9. But D is drawn exactly as A is — a device at the edge, on the far side of the last MPLS router. The text says as much: “IP devices R5, R6, A, and D are connected together via an MPLS infrastructure (MPLS-capable routers R1, R2, R3, and R4)”.
If D is an IP device on the edge, then by the figure’s own logic that entry should read – too, exactly as R1’s does. And label 9 is explained nowhere — the text accounts for 6, 8, 10 and 12, and never mentions 9.
The site reproduces the figure as printed. Treat the R1 row as the one that shows you what happens at the edge.
Everyday picture
An internal courier system in a large building. Post arrives with a full street address, and at the door it is put into a coloured folder. Inside, nobody reads the address again — they read the folder colour, and the rules say which room a colour goes to next. At the last room the folder comes off and the letter is delivered.
The point is not that reading a colour is faster than reading an address. It is that management can send some post for the fourth floor by the east stairs and some by the west, simply by using two colours.
Where the picture stops. A folder colour is chosen once and kept. An MPLS label is swapped at every hop — 10 becomes 6 on the way through R3 — so the label means “the next step”, not “the destination”.
Check yourself
Check yourself
0 of 7 answered1.Why can an MPLS frame only travel between two routers that both speak MPLS?
2.What does a label-switched router NOT do that an ordinary IP router must?
3.predictIn Figure 6.29, R4's in-label column is blank on every row. Why?
4.R1's row for destination A has a dash in the out-label column. What does that mean?
5.predictR4 has two rows for destination A: interface 0 with label 10, and interface 1 with label 8. What would IP routing have given it?
6.predictA datagram enters at R4 with label 10 and leaves R3 towards R1. What label does it carry then?
7.Besides traffic engineering, what else is MPLS used for?
What to remember
- The MPLS header sits between the link-layer header and the IP header, so both ends of a link must understand it.
- A label-switched router forwards on the label alone — no IP address extracted, no longest-prefix match. Labels are pushed at the edge, swapped at each hop, popped at the far edge, because a label names the next step, not the destination.
- The real payoff is traffic engineering: two paths to one destination, which chapter 5’s least-cost routing cannot express. MPLS is also used for fast failover and for building VPNs.