Understanding Multi-Protocol Label Switching (MPLS) (2024)

Multi-Protocol Label Switching (MPLS)

First....Why we need MPLS ?

Understanding Multi-Protocol Label Switching (MPLS) (1)

In the above example, we have an example of an ISP with two customers “A” & “B”. The ISP only offers internet connectivity between their sites.

  • To accomplish our goal, the ISP is running eBGP between the Customer Edge (CE) and Provider Edge (PE) to exchange prefixes.
  • This means all internal (P) routers of ISP have to run iBGP or they don’t know where to forward their packets to.

A full internet routing table currently has >800000 prefixes and 8 ISP routers running iBGP, we need 28 iBGP peerings. We can reduce this number by using Route-reflectors or aConfederation. All routers have to do lookups in the routing table for any possible destination and forwardig decisions happens by using traditional ipv4 destination address.

Another best way to provide connectivity between Customer A or Customer B sites is….using MPLS (Multi-Protocol Label Switching).

Multi-Protocol Label Switching (MPLS):

MPLS decreases forwarding overhead on core routers making them more efficient. Note that MPLS was designed to support many different Layer 3 protocols. However, in this section we will focus on IP only. Therefore, in our scenarios, we will analyze how labels can be used to forward IP packets instead of the destination IPv4 address.

MPLS can forward other L3 protocols besides IPv4, MPLS also supports multiple services such as unicast routing, multicast routing, VPNs, TE (Traffic Engineering), QoS, and AToM (Any Transport over MPLS) . Therefore, MPLS is very efficient and flexible.

With normal routing, we use routing protocols like EIGRP, OSPF or BGP to learn prefixes from other routers. These are all stored in the RIB (Routing Information Base), thisis your routing table. The information in the RIB is used to build the FIB (Forwarding Information Base) which is what we use for actual forwarding of IP packets.

Understanding Multi-Protocol Label Switching (MPLS) (2)

The control plane of the MPLS enabled router will be responsible for exchanging labels with other MPLS enabled routers using a Label Distribution Protocol (LDP).Once labels have been exchanged, the label information is used to populate the Label Information Base (LIB) and then is downloaded to Data Plane (Forwarding Plane) as Label Forwarding Information Base (LFIB).

Understanding Multi-Protocol Label Switching (MPLS) (3)

MPLS Devices:

Understanding Multi-Protocol Label Switching (MPLS) (4)

Refer to the above diagram... Routers R1 through R5 are part of the MPLS domain. They are known as Label Switch Routers (LSR) because they support MPLS.They understand MPLS labels and can receive and transmit labeled packets on their interfaces. In this case R1 and R5 are considered Edge LSRs and R2, R3, and R4 areconsidered Intermediate LSRs.

1. Let’s say an unlabeled IP packet arrives with a destination of 10.0.0.5. Since it is unlabeled the FIB will be used to make a forwarding decision.
2. If the FIB indicates that the outgoing interface is not an MPLS enabled interface, the packet will be forwarded unlabeled.
3. If the FIB indicates that the outgoing interface is an MPLS enabled interface, a label will be added to the packet and the labeled packet will be forwarded labeled out the MPLSinterface.
4. Let’s say a labeled packet arrives on an MPLS enabled interface. Since it is labeled the LFIB will be used to make a forwarding decision.
5. If the LFIB indicates that the outgoing interface is an MPLS enabled interface, the label will be removed, a new label will be added and the labeled packet will be forwarded out the MPLS interface labeled.
6. If the LFIB indicates that the outgoing interface is not an MPLS enabled interface, the label will be removed, and the unlabeled packet will be forwarded unlabeled using the information in the FIB.

MPLS Operation:

  • 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.

Label Switch Path

The Label-Switched Path (LSP) is the cumulative labeled path (sequence of routers) that the labeled packet will take through the MPLS domain.

It is a unidirectional path as shown in the below figure; therefore, in a complex network with multiple potential paths between source and destination.

Understanding Multi-Protocol Label Switching (MPLS) (5)

Label Distribution Protocol (LDP)

  • LDP is astandard, based on Cisco’s proprietary TDP (Tag Distribution Protocol). It’s pretty much the same concept as 802.1Q/ISL. LDP is a protocol that automatically generates and exchanges labels between routers.
  • Each router will locally generate labels for its prefixes and will then advertise the label values to its neighbors. First MPLS LDP router send UDP multicast hello packets to discover other neighbors. Once two routers decide to become neighbors, they build the neighbor adjacency using a TCP connection. This connection is then used for the exchange of label information. Normally a loopback interface is used for the neighbor adjacency.
  • The hello packets are sent to multicast address 224.0.0.2 using source/destination UDP port 646. Each router has a unique ID called the LSR (Label Switch Router) ID. Like the LSR ID, the router selected the IP address on the loopback interface as the transport address.Make sure that the IP address that LDP has selected for the transport address is advertised in your routing protocol. This is different compared to how routing protocols like OSPF or EIGRP form neighbor adjacencies.
  • For example, when you run OSPF then your routers will form neighbor adjacencies on all interfaces that run OSPF. LDP will only form a single neighbor adjacency, no matter how many interfaces you have in between your routers.

Understanding Multi-Protocol Label Switching (MPLS) (6)

  • LDP is a bit similar to BGP when you use the loopback interfaces for the neighbor adjacency. When we use BGP we have to use the update-source command to select the source, LDP does it automatically.

MPLS Label:

For MPLS to work, a label needs to be added to the packet. The label is added as a shim header between the Layer 2 Frame Header and the Layer 3 Packet Header. The MPLS header is added in between the L2 and L3 header. That’s why we call it a “layer 2.5” protocol. The label is 4 bytes (32 bits) in size and contains four different fields as shown in Figure:

Understanding Multi-Protocol Label Switching (MPLS) (7)

  • Label value: the name says it all, the value of the label ( 20 bits).
  • EXP: these are the three experimental bits. These are used forQoS (Quality of Service)
  • S: this is the “bottom of stack” bit. With MPLS it’s possible to add more than one label. 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: this is the time to live field, just like in the IP header. So that MPLS frames are discarded if they have not reached the destination by the time the TTL value reaches to zero.

MPLS Configuration

Understanding Multi-Protocol Label Switching (MPLS) (8)

  • OSPF Configuration

R1(config)#router ospf 1

R1(config-router)#network 192.168.12.0 0.0.0.255 area 0

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R2(config)#router ospf 1

R2(config-router)#network 192.168.12.0 0.0.0.255 area 0

R2(config-router)#network 192.168.23.0 0.0.0.255 area 0

R2(config-router)#network 2.2.2.2 0.0.0.0 area 0

R3(config)#router ospf 1

R3(config-router)#network 192.168.23.0 0.0.0.255 area 0

R3(config-router)#network 3.3.3.3 0.0.0.0 area 0

When you use LDP, all routers will start assigning labels with label value 16. This might be a bit annoying if you are new to MPLS as some routers will use the same label value.

  • To make it easier:

R1(config)#mpls label range 100 199

R2(config)#mpls label range 200 299

R3(config)#mpls label range 300 399

  • There are two ways to configure LDP:
    • On the interface level with the “mpls ip” command.
    • Globally under the OSPF process with the “mpls ldp autoconfig” command.
  • It doesn't matter much which one you pick, by default LDP will create a label for each prefix. I'll enable it on the interfaces this time:

R1(config)#interface FastEthernet 0/0

R1(config-if)#mpls ip

R2(config)#interface FastEthernet 0/0

R2(config-if)#mpls ip

R2(config)#interface FastEthernet 0/1

R2(config-if)#mpls ip

R3(config)#interface FastEthernet 0/0

R3(config-if)#mpls ip

  • After a few seconds you will see a message on the consoles telling you that the neighbor is up:

R1#

%LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (1) is UP

Let's see...some mpls verification commands....

Understanding Multi-Protocol Label Switching (MPLS) (9)

The above traceroute command output tells us the packet is label switched between R1 to R3.

Thanks you very much...!!

---------------------------------------------------- The End ---------------------------------------------

Labels:

  • Other Networking
  • Other Routing
  • Other Switching
  • Routing
  • Routing Protocols

Multi-Protocol Label Switching.zip

Understanding Multi-Protocol Label Switching (MPLS) (2024)
Top Articles
Latest Posts
Article information

Author: Fredrick Kertzmann

Last Updated:

Views: 6394

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fredrick Kertzmann

Birthday: 2000-04-29

Address: Apt. 203 613 Huels Gateway, Ralphtown, LA 40204

Phone: +2135150832870

Job: Regional Design Producer

Hobby: Nordic skating, Lacemaking, Mountain biking, Rowing, Gardening, Water sports, role-playing games

Introduction: My name is Fredrick Kertzmann, I am a gleaming, encouraging, inexpensive, thankful, tender, quaint, precious person who loves writing and wants to share my knowledge and understanding with you.