Before we delve into understanding MPLS basics, I would like to share about what MPLS is and a few important MPLS terminologies.
MPLS is an acronym for Multiprotocol Label Switching which is a type of data-carrying technique for high-performance telecommunications networks. MPLS is the most widely used technology in Internet Service Providers and Telecom Networks all over the world.
MPLS directs data from one network node to the next based on short path labels rather than long network addresses, avoiding complex look-ups in a routing table.
MPLS is also called Layer 2.5 as it resides between Layer 2 and Layer 3 of the OSI layer model.
Highlight: MPLS is called Multiprotocol because it can carry anything over an MPLS path irrespective of the underlying protocol: Ethernet, ATM, PPP, SONET etc. This behaviour is known as AToM i.e Any Transport over MPLS.
Understanding MPLS & MPLS VPNs
Label: It is a 32 bit field that is locally significant and is used to represent an FEC of a packet.
Label numbers ranging from 0 to 15 are reserved labels and can only be used for special purposes. They cannot be used by an LSR for normal forwarding. Each reserved label has its own specific function such as Label 3 is the implicit NULL label whereas Label 14 is OAM alert label, and so on and so forth.
MPLS VPN: The creation of VPNs using MPLS backbone that allows for connecting different customer sites located in different regions across the globe over a service provider’s network.
CE (Customer Edge): The device placed at the customer end. This can be a router or any CPE that is used to communicate with the Provider network.
PE (Provider Edge): The device at the Provider side where customers are terminated. The PE routers do MPLS label switching as well as IP lookups.
P (Provider) Routers: These are located in the provider core and act as MPLS backbone routers. It is important to note that these routers only forward traffic based on MPLS labels.
LSR (Label Switched Router): This is the router that does traffic forwarding based on MPLS labels. It is also called a transit router.
An LSR can be an ingress LSR or an egress LSR. Ingress and Egress LSRs are known as LERs (Label Edge Routers) as they are responsible for imposition and removal of MPLS labels.
LSP (Label Switched Path): It is the path along which the traffic flows across an MPLS network.
VRF (Virtual Router and Forwarding): These are virtual routing tables created per customer site. VRFs are created on PE routers for different VPNs and routing information between VRFs cannot be exchanged by default.
Note that VRF is a Cisco term. Huawei calls VRF “VPN Instance” whereas Juniper calls VRF “Routing Instance.”
FEC (Forwarding Equivalance Class): It is a group of IP packets which is treated in the same way over the same path.
An FEC can be an IP subnet or any traffic that is to be dealt in the same manner with respect to certain QoS parameters.
CEF (Cisco Express Forwarding): CEF is advanced layer 3 IP switching technology that acts as a pre-requisite to MPLS. It basically enables hardware switching (in an ASIC) and optimises network performance.
CEF is Cisco proprietary and other vendors such as Huawei or Juniper have their own fast-forwarding techniques.
LDP (Label Distribution Protocol): It is a protocol used for exchanging label mapping information between MPLS enabled routers. Routers which form an LDP session are called LDP peers.
LDP is an open-standard protocol. Other ways of distributing labels can be by using BGP, RSVP or TDP where TDP is Cisco proprietary.
LDP uses TCP port 646 and you need to configure MPLS on the interface in order to open the specified LDP port.
There are also different Label Distribution and Allocation techniques including Downstream/Upstream Allocations, Downstream on Demand and Downstream Unsolicited Distributions.
Similarly, Label Control Mode wherein an LSR waits to hear from its neighbor before replying to a label request includes methods such as Ordered Control and Independent Control and the Label Retention Mode comprises Liberal Retention and Conservative Retention Mode techniques.
Control Plane: MPLS Control Plane is responsible for exchanging routing and label information.
The Control Plane consists of LIB and RIB as well as LDP.
- The LIB is the Label Information Base and it has all MPLS LDP bindings. Remember that the LIB uses LFIB to forward traffic
- RIB is the Routing Information Base, which is in fact the routing table database that you can view using show ip route command. Remember that the RIB uses FIB to forward traffic.
Data Plane: MPLS Data Plane is responsible for forwarding packets based on labels and IP header.
The Data Plane has 2 forwarding engines namely LFIB and FIB.
- LFIB is the Label Forwarding Information Base. It is the MPLS table that has got labels against IP prefixes along with outgoing interfaces and it is used to forward labelled packets.
- The FIB is the Forwarding Information Base that is an optimized version of RIB. It is actually the table that a router refers to while forwarding traffic. In Cisco, CEF is the FIB.
IMPORTANT: It is quite important to understand and differentiate between control plane and forwarding plane in MPLS networks, specially in troubleshooting problems.
For LSRs, the Data Plane does need to consult the FIB as forwarding is done purely on MPLS labels whereas for LERs, the Data Plane does have both FIB and LFIB as the edge LSRs are responsible for doing both IP and label lookups.
MPLS was initially introduced as a fast switching technique so as to get rid of slower software-based forwarding because it does not need to do routing table lookups as it forwards traffic based on labels. However, with the passage of time, MPLS became popular for a number of other reasons some of which are listed below:
- MPLS VPNs – One of the most popular application of MPLS is MPLS based VPNs.MPLS VPNs are in high demand than any other standard VPNs because of following reasons:
- Security – Service providers are responsible for taking care of transporting data securely and nothing needs to be implemented at customer end in terms of security
- Network Redundancy – The MPLS core network is always fault resilient and in case of a link/node failure, the switchover time is usually less than 50 ms.
- Cost Effective – MPLS VPNs is the cost effective solution for customers who have tons of branches that need connectivity. Addition and deletion of sites to an existing MPLS network is no big deal.
- Protocol Independent – Since MPLS supports protocol independent forwarding, it is a popular choice for VPNs therefore as there is no need to worry about the type of traffic being forwarded over the MPLS backbone.
- Bandwidth Flexibility – With MPLS networks, dynamic bandwidth allocation can be achieved
- Inter-AS MPLS: Service providers can make use of MPLS to connect VPNs across different countries by connecting to other MPLS networks.
- MPLS traffic engineering – In communication networks, traffic engineering is used to enhance network performance by predicting the expected behaviour of data being transmitted and reacting to changes dynamically.
Similarly, MPLS traffic engineering serves the same purpose but over an MPLS path. All configurations are made at the headend where all tunnels and constraints are created. Tunnel destination address is also marked at the headend.
MPLS traffic engineering uses RSVP which is a signalling protocol that is used to reserve resources for various traffic flows. MPLS RSVP TE is thus used to build an LSP that is used for TE in MPLS networks.
MPLS traffic engineering is a feature that is used by most Internet service providers as it offers a lot of flexibility and increases network stability.
- Quality of Service – This is another big reason for making use of MPLS. QoS can be easily achieved in MPLS networks by assigning priorities to different packets based on their FECs.
Voice packets are termed as sensitive traffic and thus take higher priority and more bandwidth. Other types of traffic such as data or file transfer don’t need to be assured.
- Cisco Express Forwarding (CEF) acts as a prerequisite to run MPLS on Cisco devices. CEF is not required on other vendors as they have their own fast-forwarding techniques and implementation methods as to how the FIB is derived, but in order to enable MPLS functionality on Cisco, you have to enable CEF before that.
The reason for this is because it allows for correct forwarding data structures required for MPLS label imposition and disposition. Hence, it ensures proper implementation of the MPLS Data Plane and this requirement is met by vendors other than Cisco using their own software architectures.
- Routing needs to be converged as LDP binding are going to be based on IGP prefixes. For this purpose, any IGP protocol can be used but service providers usually prefer IS-IS because of its scalability. However, you can use OSPF or any other protocol as well but the key is that it should be fully synchronized.
- Once IGP synchronization is complete, you run LDP or TDP or any other protocol that you use for label distribution. Label bindings are based on IP prefixes learned through the IGP. Once all label bindings are in place, the routers start switching traffic based on MPLS labels.
In case, you are running MPLS VPNs that service providers do, you need to have BGP as well. Since the service providers are already running BGP, it is not really considered as a prerequisite therefore.
The MPLS header is divided into following fields:
- 20 bits label value
- 3 bits EXP that are used for Cos (Class of Service)
- 1 bit BoS (Bottom of Stack) that is used to identify if it is the last label. In case, BoS = 1, it means the label is the last label in the stack
- 8 bits TTL, serves the same purpose as IP TTL
Understanding MPLS Operations:
In order to understand MPLS operations, we need to see what label operations does an LSR support, which are listed as below:
- Push – adding a new label
- Pop – removing the top label
- Swap – replacing the topmost label
- Multiple Push – adding multiple labels on top of existing packets
- Swap and Push – replacing the top label and then adding another new label on top
- Untagged or NO label – the label stack is removed and packet gets forwarded unlabeled
So, when a labeled packet is received, there are 2 things that are determined at the top of the label stack
- The next hop and the exit interface to which the packet is to be forwarded
- The operation to be performed by the LSR before forwarding
Note that the Push operation is usually done by the ingress LSR whereas the Swap operation is commonly done by intermediate LSRs in an MPLS network. However, for the Pop operation, it can either be done by the egress LSR or the penultimate LSR in case PHP (Penultimate Hop Popping) is implemented.
PHP is the process of removing the top most label of the MPLS packet to reduce overhead of double lookup on the edge router and is therefore, performed by the penultimate LSR in the MPLS network.
PHP makes use of the reserved label “Implicit Null” having a label value of 3. But do keep in mind that we lose QoS based on MPLS EXP as a result of the Implicit Null label. So, to counter that we could make use of the Explicit Null label that does not let the penultimate hop pop the label. It rather sends a label value of 0 but with EXP bits intact.
MPLS Basic Commands:
For basic MPLS commands and their descriptions, please check out my article Huawei vs Cisco – Command Line Comparison.
For those of you who are interested in reading more about MPLS in detail, I would like to suggest you to study MPLS Fundamentals.
In case you have any questions or feedback, please do comment below and I will surely get back to you as soon as possible. Also, If you liked this article, then please subscribe to our Youtube channel – Our Technology Planet for more exciting stuff and videos.
Latest posts by Haider Khalid (see all)
- What is VRA Proof of View (PoV)? The solution to Ad Fraud by Verasity - June 21, 2022
- Top 5 Network Engineer Interview Topics - January 19, 2022
- Top 5 Networking Certifications in 2022 - December 13, 2021