Label It and Leave It: The MPLS Advantage
Before we delve into MPLS, it's crucial to understand how packet forwarding works in a router. This foundational knowledge is essential, as MPLS builds upon traditional packet-switching technology to enhance network performance and efficiency.
control plane and data plane functionality.
RIB (Routing Information Base)
Functionality: The RIB stores routing information and is responsible for maintaining all the learned routes in a router.
What It Stores:
Routes learned from various protocols (e.g., OSPF, BGP, RIP).
Route metrics and administrative distances.
Next-hop information for each route.
Purpose: Provides a comprehensive view of all possible routes, allowing the router to make informed decisions on the best path for forwarding packets.
CPU Usage: The control plane often utilizes CPU resources to perform complex calculations and maintain state information.
FIB (Forwarding Information Base)
Functionality: The FIB is a more optimized data structure used for fast packet forwarding.
What It Stores:
The best routes selected from the RIB, along with their corresponding next-hop addresses and interfaces.
Typically uses a simpler structure for quick lookups (often a hash table or trie).
Purpose: Enables the router to forward packets quickly and efficiently by reducing the time needed to make routing decisions.
CPU usage: Optimized for speed; minimal CPU involvement during packet forwarding
Summary
- RIB: Comprehensive routing information and decision-making.
FIB: Optimized data for fast packet forwarding.
As shown, the RIB holds routes from multiple routing protocols such as OSPF, STATIC, RIP, and BGP, while the FIB contains only the best routes along with the next hop IP address and the outbound interface. This was more of a logical representation of how the control plane and data plane functionality works
Now, let’s explore switching techniques used by different router vendors. Switching refers to the router's capability to forward packets efficiently.
cisco:
. Process Switching
Description: In process switching, each incoming packet is processed by the CPU of the router. The router examines the packet’s header, makes forwarding decisions, and then forwards the packet.
Pros: Provides flexibility and supports complex routing protocols.
Cons: Slower than other methods because every packet requires CPU intervention, leading to higher latency and lower throughput.
2. Fast Switching
Description: Fast switching improves upon process switching by caching the forwarding information for previously routed packets. When a packet matches an entry in the cache, it can be forwarded without needing to go through the CPU again.
Pros: Increases forwarding speed compared to process switching while maintaining flexibility.
Cons: Still not as efficient as newer methods like CEF, and the cache can become stale.
3. Cisco Express Forwarding (CEF)
Description: CEF is a more advanced and efficient packet-forwarding method that builds a Forwarding Information Base (FIB) and an Adjacency table. The FIB contains the routing information, and the adjacency table helps with Layer 2 addressing.
Pros: Highly efficient and scalable; minimizes CPU involvement for packet forwarding, leading to lower latency and better performance.
Cons: More complex to configure and manage than the previous methods.
JUNIPER:
Juniper Fast Path Switching
Description: Fast Path Switching in Juniper routers optimizes packet forwarding by using specialized hardware to minimize the involvement of the CPU. It allows for efficient handling of packets based on pre-established forwarding decisions.
Pros:
High Performance: Accelerates packet forwarding, reducing latency.
Scalability: Handles high volumes of traffic effectively, making it suitable for large networks.
Cons:
Limited Flexibility: May not support complex processing features, as it focuses on speed.
Moderate CPU Utilization: Frees up CPU resources for other tasks, enhancing overall router performance.
Junos Express Forwarding (JEF)
Description: Junos Express Forwarding is an advanced forwarding mechanism that uses a Forwarding Information Base (FIB) to provide rapid packet forwarding with minimal CPU involvement. It optimizes routing by caching routing information and adjacency data.
Pros:
Efficient Packet Forwarding: Quickly processes packets using FIB, improving throughput.
Low CPU Load: Reduces the CPU's workload during data transmission, allowing it to focus on other tasks.
Cons:
- Initial Setup Complexity: Requires careful configuration and monitoring during the setup phase.
Huawei:
2. Huawei Intelligent Forwarding
Description: Intelligent Forwarding is another forwarding mechanism in Huawei routers that combines hardware acceleration with advanced software techniques. It utilizes a Forwarding Information Base (FIB) for quick lookups, optimizing routing decisions.
Pros:
Efficient Routing: Provides rapid packet forwarding while maintaining advanced routing capabilities.
Low Latency: Reduces delays in packet processing, enhancing overall network responsiveness.
Cons:
Complex Configuration: May require more intricate setup and management compared to simpler forwarding techniques.
Moderate Resource Usage: While optimized, it may use more CPU resources than purely hardware-based methods.
CPU Utilization:
- Moderate: Involves some CPU resources for maintaining routing information and managing protocols, but still optimizes overall CPU load compared to process-based switching.
Huawei Fast Path Switching
Description: Fast Path Switching in Huawei routers optimizes packet forwarding by utilizing specialized hardware to process packets quickly. This method minimizes the involvement of the CPU, allowing for efficient handling of network traffic.
Pros:
High Performance: Significantly enhances packet forwarding speed, reducing latency and improving throughput.
Low CPU Utilization: Offloads packet processing to dedicated hardware, allowing the CPU to focus on other critical tasks.
Scalability: Effectively handles large volumes of traffic, making it suitable for high-capacity networks.
Cons:
Limited Flexibility: Primarily designed for speed, it may not support complex processing requirements or advanced features.
Hardware Dependency: Performance is reliant on specific hardware capabilities, which may not be available on all devices.
CPU Utilization:
Low: Minimal CPU involvement during packet forwarding, as most processing is handled by dedicated hardware.
As you can see the switching techniquest offered by different vendors are suitable in an enterprise environment where the number of routers available is less as compare to a service provider’s environment.
imagine a situation where you have to process a 32-bit ip header information in an environment where they use 1000 routers which is obviously going to cause a delay.
This is where MPLS comes into play MPLS is an advanced switching technique.
Overview of MPLS (Multiprotocol Label Switching)
Introduction
MPLS is an advanced method of packet forwarding that enhances traditional forwarding techniques by utilizing labels. This approach allows for quick switching of data packets, reducing latency and improving overall network efficiency.
Key Features
Label Length: Each label is 20 bits long.
Environment: Primarily used in service provider networks, where the number of routers is significantly higher than in enterprise environments.
How MPLS Works
MPLS operates by maintaining both control plane and data plane functionalities. Here are the key components:
Control Plane vs. Data Plane
Control Plane: Responsible for routing decisions and maintaining routing information.
Data Plane: Responsible for the actual forwarding of packets based on labels.
Label Tables
LIB (Label Information Base): Similar to the RIB (Routing Information Base); it holds label information exchanged between routers.
LFIB (Label Forwarding Information Base): A specialized table used for forwarding packets. It contains the best labels for routes along with the exit interface.
The image below illustrates a typical service provider environment.
Here are three key components to note:
Provider Edge (PE)
Customer Edge (CE)
Label Switch Router (LSR)
Here's a brief description of the three types of routers in an MPLS environment:
PE (Provider Edge) Router: The router at the edge of the service provider's MPLS network, responsible for connecting to customer networks (CE routers) and handling label operations for data entering or exiting the MPLS network.
CE (Customer Edge) Router: The router located at the edge of the customer’s network, connecting to the service provider’s PE router. It handles routing within the customer’s network but is unaware of MPLS labeling.
LSR (Label Switch Router): A core router within the MPLS network that forwards packets based on labels. It switches MPLS-labeled packets from one interface to another, performing label swaps without interacting with customer routing information.
Each of these plays a key role in efficiently managing traffic in an MPLS network.
Label Operations:
Imposition: The process of adding a label to a packet at the ingress router.
Swapping: The process of changing an existing label on a packet as it passes through a router.
Popping: The process of removing a label from a packet at the egress router.
Let’s understand them in depth.
Let’s consider a scenario:
The image provided illustrates a Multi-Protocol Label Switching (MPLS) network with four routers (R1, R2, R3, R4) and their respective Label Information Base (LIB) and Label Forwarding Information Base (LFIB). Here's a detailed explanation of MPLS operations—imposition, swapping, and popping—as a packet with destination address 20.20.20.20/30
travels from R1 to R4:
Step-by-Step MPLS Operation:
1. R1 (Imposition):
Packet Origin: A packet with the destination IP
20.20.20.20/30
originates at R1.LIB Lookup: R1 checks its LIB for the FEC (Forwarding Equivalence Class) that matches
20.20.20.20/30
. According to the LIB:- Destination
20.20.20.20/30
corresponds to label 204 outgoing to R2.
- Destination
LFIB Lookup: In the LFIB, R1 sees that for the label 204, the next hop is R2 via interface GE0/1.
Label Imposition: R1 imposes (adds) label 204 to the packet and forwards it to R2.
2. R2 (Swapping):
Packet Arrival: The packet arrives at R2 with label 204.
LIB Lookup: R2 checks its LIB and sees that label 204 is associated with the destination
20.20.20.20/30
, with a next-hop label of 304 for R3.LFIB Lookup: R2 checks the LFIB for label 204 and sees the outgoing label is 304 via interface GE0/1 to R3.
Label Swapping: R2 swaps the label 204 with 304 and forwards the packet to R3.
3. R3 (Swapping):
Packet Arrival: The packet arrives at R3 with label 304.
LIB Lookup: R3 checks its LIB for label 304 and finds that it should be swapped with label 404 for the destination
20.20.20.20/30
.LFIB Lookup: R3 checks the LFIB for label 304 and sees it should swap the label to 404 and forward it to R4 via interface GE0/1.
Label Swapping: R3 swaps the label 304 with 404 and sends the packet to R4.
4. R4 (Popping - PHP):
Packet Arrival: The packet arrives at R4 with label 404.
LIB Lookup: R4 checks its LIB and finds that label 404 is associated with the destination
20.20.20.20/30
and that no further label is required (Penultimate Hop Popping - PHP).LFIB Lookup: R4 checks its LFIB for label 404 and sees it must remove (pop) the label and forward the packet to the destination without a label.
Label Popping: R4 pops the label 404 and forwards the native IP packet to the destination
20.20.20.20/30
.
Summary of MPLS Operations:
R1 (Imposition): Adds label 204 and forwards the packet.
R2 (Swapping): Swaps label 204 with 304 and forwards.
R3 (Swapping): Swaps label 304 with 404 and forwards.
R4 (PHP - Popping): Pops label 404 and forwards the packet to the destination.
This sequence demonstrates the flow of MPLS labels across the network and how the labels are manipulated at each router.
Configuration Prerequisites:
Before configuring MPLS, ensure that an Interior Gateway Protocol (IGP) is enabled on the routers.
Be sure to consult your vendor's documentation to verify which router models support MPLS operations. Additionally, confirm that the required licenses are updated to enable MPLS functionality.
LDP (Label Distribution Protocol)
LDP: An open standard protocol used for exchanging LIB information among neighboring routers.
Once LDP is configured, routers establish LDP neighborship with one another to facilitate the exchange of label information.
Subscribe to my newsletter
Read articles from Sumeet directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Sumeet
Sumeet
Network/System Engineer specializing in carrier-grade ISP infrastructure and server management. Passionate about optimizing high-performance networks and exploring cutting-edge technologies. Dedicated to continuous learning and excited about leveraging new cloud solutions and automation tools to drive innovation and efficiency.