Saturday, February 22, 2020

MPLS Labels and Devices

In my introduction to MPLS I explained why we use MPLS and explained some of the basics of how we use labels for forwarding decisions. In this lesson, we’ll take a closer look at the MPLS labels, the devices that we use and how IP packets travel through the MPLS network.

MPLS Label Format

The MPLS header has been standardized, you can find it in RFC 3032. The header is pretty simple, here’s what it looks like:
MPLS Label Header
Here’s what the different fields are used for:
  • Label value: the name says it all, this is where you will find the value of the label.
  • EXP: these are the three experimental bits. These are used for QoS, normally the IP precedence value of the IP packet will be copied here.
  • S: this is the “bottom of stack” bit. With MPLS it’s possible to add more than one label, you’ll see why in some of the MPLS VPN lessons. When this bit is set to one, it’s the last MPLS header. When it’s set to zero then there is one or more MPLS headers left.
  • TTL: just like in the IP header, this is the time to live field. You you can use this for traces in the MPLS network. Each hop decrements the TTL by one.
The MPLS header is added in between the L2 and L3 header:
MPLS Header Between Layer 2 3
That’s why we call it a “layer 2.5” protocol. Here’s an example of what it looks like in wireshark:
wireshark capture mpls header
Above you have an example of the MPLS header in between the Ethernet and IP header. You can also see the different fields, this header uses label value 16. We don’t use QoS and since there is only one MPLS header, the bottom of label stack bit has been set.
Where did the label value come from? MPLS uses a protocol called LDP (Label Distribution Protocol) for this. You will learn about it in the next lesson.

MPLS Devices and Operations

Now you know what the MPLS labels look like, let’s talk about a bit about the different devices you will encounter in a MPLS network. Here’s an overview:
MPLS Network Topology
Above you will find three different routers:
  • CE (Customer Edge): this device is the last device in the customer’s network, it could be a L2 or L3 device. In my picture I used a router but for example, it could be a switch. This device does not use MPLS.
  • PE (Provider Edge): this device is owned by the ISP and sits at the edge of the ISP’s network. It has an important role…it receives packets or frames from the customer and will then add a MPLS label to it and forwards towards the core. Another common name for this device is LER (Label Edge Router).
  • P (Provider): this device connects to PE routers and other P routers. It has a simple job, it switches packets based on their labels or removes the labels. Another common name for this device is the LSR (Label Switch Router) or transit router.
There are three actions we can perform with labels:
  • Label push: when we add a label to a packet, we call it a label push.
  • Label swap: replacing a label with another value is called a label swap.
  • Label pop: removing the label is called a label pop.
Let’s look at an example of how labels are pushed, swapped and popped in a MPLS network:
MPLS device label operations
Let me add some more detail to the picture above:
  1. The CE1 router is owned by the customer and connected to the ISP’s PE1 router. This device doesn’t have a clue what MPLS is and sends an IP packet that should end up at CE2 (another site of the customer).
  2. The PE1 router receives the IP packet from the CE1 router, it will push a label on it and forwards it further into the core of the ISP network.
  3. P1 receives the labeled packet from PE1, swaps the label and forwards it to P2. Labels are only locally significant, we’ll talk more about this in the next lesson.
  4. P2 receives the labeled packet from P1, swaps the label and forwards it to P3.
  5. P3 receives the labeled packet and will pop the label, forwarding the IP packet to PE2. This is called penultimate hop popping and is performed to save PE2 the trouble of looking at the MPLS label.
  6. PE2 receives the IP packet and forwards it to the CE2 router.
  7. The CE2 router receives the IP packet and the customer is happy.
The label swapping that the P routers perform is similar to how a frame-relay switch behaves. A frame with a DLCI number comes in on one interface and is switched to another interface with a different DLCI number.

Conclusion

You have now seen what the MPLS header looks like, the different devices and their role in the MPLS network. You have also seen an example of how labels are pushed, swapped and popped. In the next lesson we will take a close look at LDP (Label Distribution Protocol) where you will learn where the different label values come from.
I hope you enjoyed this lesson, if you have any questions…feel free to leave a comment.

No comments:

Post a Comment