MPLS · Topic 1 of 7
MPLS Basics and Static Label Mapping
Learn how MPLS forwards packets by label, the roles of LER and LSR, the label header fields, and how static label bindings build a path by hand.
- 4 min
- MPLS forwards by label, and routers in the core do not look at the IP destination.
- The ingress LER pushes a label, an LSR swaps it, and the egress LER pops it.
- The MPLS header is 32 bits: label 20, traffic class 3, bottom of stack 1, TTL 8.
What it is
MPLS forwards packets by a short label instead of looking up the destination IP address at every router.
A label is added when a packet enters the MPLS network, swapped at each router along the way, and removed near the end. The routers in the middle make a quick decision on the label alone.
A path built from labels is called a label switched path, or LSP. MPLS also lets one backbone carry different services, such as layer 2 and layer 3 VPNs.
How it works
Edge routers push and pop labels, core routers swap them, and a table on each router says which label goes where.
Router roles
| Role | Also called | Job |
|---|---|---|
| Ingress LER | Provider edge | Receives plain packets and pushes a label |
| LSR | Provider core | Swaps the incoming label for an outgoing label |
| Egress LER | Provider edge | Removes the label and forwards the packet |
LER means label edge router. LSR means label switching router.
The label header
An MPLS header is 32 bits long and is placed between the layer 2 header and the layer 3 packet. It holds four fields.
| Field | Size | Purpose |
|---|---|---|
| Label | 20 bits | The label value |
| Traffic class | 3 bits | Priority marking |
| Bottom of stack | 1 bit | Set on the last label in a stack |
| TTL | 8 bits | Loop protection, like the IP TTL |
Several labels can be stacked. The top label is used for forwarding in the core. Services such as VPLS and L3VPN use a second, inner label.
Label values 0 to 15 are reserved for special uses. Label 3 is the implicit null label, used to ask the previous router to remove the label, which the penultimate hop page covers.
Label tables on RouterOS
RouterOS keeps its label information in a few places.
/mpls interface print
/mpls local-bindings print
/mpls remote-bindings print
/mpls forwarding-table print
mpls interfacelists the interfaces on which MPLS is active.mpls local-bindingslists labels this router assigned to prefixes.mpls remote-bindingslists labels a neighbour assigned to prefixes.mpls forwarding-tableshows the final result used for forwarding.
A label is meaningful only between two neighbours. Router A decides which label it wants to receive for a prefix, and it tells its neighbour. This is why every link can use different numbers.
Static label mapping
Normally a protocol distributes labels. Static label mapping means you create the bindings yourself, entry by entry.
On RouterOS you add a local binding for the label this router expects to receive, and a remote binding that gives the label to send toward the next hop. Both appear in the tables above and feed the forwarding table.
Static mapping is useful for learning and for unusual cases. It does not adapt to failures, and an error at any hop breaks the path. Every router on the path needs matching entries, and the reverse direction needs its own set.
Enabling MPLS
MPLS must be turned on per interface. A label is only exchanged and accepted on those interfaces.
/mpls interface add interface=ether1
/mpls interface add interface=ether2
Compare local bindings on one router with the remote bindings on its neighbour. If the numbers do not mirror each other, the path is broken at that link.
What to remember for the exam
Eight facts cover most questions here.
- MPLS forwards by label, and routers in the core do not look at the IP destination.
- The ingress LER pushes a label, an LSR swaps it, and the egress LER pops it.
- The MPLS header is 32 bits: label 20, traffic class 3, bottom of stack 1, TTL 8.
- Labels can be stacked, and VPN services use an inner label.
- Label 3 is implicit null, used for penultimate hop popping.
- A label has meaning only between two neighbouring routers.
- Static mapping means creating local and remote bindings by hand.
/mpls forwarding-table printshows what the router actually uses.
Static bindings do not react to a link failure. A single mismatched number breaks the path with no error message.
Common mistakes
These four errors are common.
Thinking labels are global. Each link can use a different value for the same prefix.
Forgetting the interface. MPLS must be enabled on each interface that carries labelled traffic.
Building only one direction. An LSP is one way. Return traffic needs its own bindings.
Expecting the core to read IP. Core routers switch on the label, so a missing label entry drops the packet even if an IP route exists.
Check yourself
Work through these three questions.
What does an ingress LER, an LSR and an egress LER do to the label?
The ingress LER pushes a label, an LSR swaps it, and the egress LER removes it.
How many bits are in an MPLS header, and what fields does it hold?
It has 32 bits: a 20 bit label, a 3 bit traffic class, a 1 bit bottom of stack flag and an 8 bit TTL.
Which command shows the table that is actually used for forwarding?
/mpls forwarding-table printshows the final forwarding entries.
Topic 1 of 7 in MPLS
Test yourself on MPLS
The full MikroTik MTCINE question bank has 475 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.