Wednesday, May 3, 2023

MPLS

 MultiProtocol Label Switching (MPLS)

  • Multi protocol: besides IP you can tunnel pretty much anything…IP, IPv6, Ethernet, PPP, frame-relay, etc.
  • Label switching: forwarding is done based on labels, not by looking up the destination in the routing table.

MultiProtocol Label Switching (MPLS) is a networking technology that is used to improve the speed and efficiency of data transmission in high-performance networks. MPLS is a layer 2.5 protocol, which means it operates at a layer between traditional layer 2 (Data Link layer) and layer 3 (Network layer) protocols.

MPLS is a packet-forwarding technology which uses labels to make data forwarding decisions. The biggest advantage using MPLS is that the Layer 3 header analysis is done just once (when the packet enters the MPLS domain). Intermediate routers will not analyze the IP packet, thus saving valuable router resources, and greatly increasing the speed at which packets are forwarded. Label inspection drives subsequent packet forwarding. Further MPLS supports applications are:

1.    Virtual Private Networking (VPN)

2.    Traffic Engineering (TE)

3.    Quality of Service (QoS)

4.    Any Transport over MPLS (AToM)

MPLS label range from 0 to 1,048,575 (configurable on Cisco IOS) Labels 0 through 15 are reserved labels.


Multiprotocol Lable Switching (Mpls): How A Packet Travels Along A Lsp

When an IP packet enters an LSP, the ingress router examines the packet and assigns it a label based on its destination, attaches the label to the IT packet. The label transforms the packet from one that is forwarded based on its IP routing information to one that is forwarded based on information associated with the MPLS label. The basic configuration of an MPLS packet is given below: As showing in the figure above, the label value consists of 20 bits.



The packet is then forwarded to the next router in the LSP. This router and all subsequent routers in the LSP

 do not examine any of the IP routing information in the labeled packet. Rather, they use the MPLS label

 attached to the packet and look up information in their local MPLS forwarding table. They then replace the

 old label with a new label and forward the packet to the next router in the path. It is important to note that the MPLS labels have only local significance, and the label is replaced at each node within the MPLS network.

When the packet reaches the egress router, the label is removed, and the packet again becomes a native IP packet and is forwarded based on its IP routing information to it's destination.

Label switching: In a hop-by-hop router configuration, packets enter a router, the router examines the IP header, and then the router sends the packet to the next hop based on the ultimate destination address. In a label-switched network, the operation is different. Packets are not forwarded on a hop-by-hop basis. Instead, paths are established for particular source-destination pairs

 

In the topology of an IP-routed network, traffic from router 1 is forwarded to router 4, which then makes its own forwarding decision, and so on, until the packets arrive at router 9.

In a label-switched network, a path from router 1 to router 9 is created so that all traffic from router 1 to router 9 takes the same deterministic path. Because a preset path exists, individual routing nodes don't need to do a forwarding lookup on the packets as they enter the router.

Instead, each node must keep information only on the paths that have been established through it (so switching tables tend to be much smaller than routing tables). As packets from that flow enter a router, the router can switch the packets on to a predefined path toward its destination through the network. If router 4 knows that for all traffic from router 1 to router 9, the next stop along the way is router 6, it can just forward the packets to that predetermined hop without ever looking up the route in its routing table.

MPLS LDP (Label Distribution Protocol)

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.

Like many other protocols, LDP first establishes a neighbor adjacency before it exchanges label information. It works a bit different than most protocols though…

First we 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. Here’s an example:

 The two routers above will send multicast hello packets on their FastEthernet interfaces. Within this hello packet, they will advertise a transport IP address. This IP address is then used to establish the TCP connection between the two routers. 

Advantages of MPLS routing

MPLS (Multiprotocol Label Switching) is a routing technique that has several advantages over traditional routing techniques. Some of the advantages of MPLS routing are:

Improved Performance: MPLS routing can provide faster packet forwarding and reduced latency. This is because MPLS routers forward packets based on labels instead of examining the IP header and performing a lookup in a routing table for each packet.

Traffic Engineering: MPLS can be used to direct traffic over specific paths in the network, which can help network administrators optimize network performance and utilization. This is achieved by assigning labels to packets based on their traffic characteristics and then directing the labeled packets along specific paths through the network.

Quality of Service (QoS): MPLS can be used to provide different levels of QoS for different types of traffic. This is achieved by assigning different labels to packets based on their QoS requirements and then treating the labeled packets differently as they traverse the network.

Scalability: MPLS routing can be more scalable than traditional routing techniques because it allows routers to forward packets based on labels instead of examining the IP header and performing a lookup in a routing table for each packet. This can reduce the amount of processing required by the routers and allow them to handle more traffic.

Security: MPLS routing can provide increased security by using label switching instead of IP routing to forward packets. This can make it more difficult for attackers to intercept or modify packets as they traverse the network.

Overall, MPLS routing can provide several advantages over traditional routing techniques, including improved performance, traffic engineering, QoS, scalability, and security.

Implicit NULL Label

The implicit NULL label is the label that has a value of 3. An egress LSR assigns the implicit NULL label to a FEC if it does not want to assign a label to that FEC, thus requesting the upstream LSR to perform a pop operation. In the case of a plain IPv4-over-MPLS network, such as an IPv4 network in which LDP distributes labels between the LSRs, the egress LSR—running Cisco IOS—assigns the implicit NULL label to its connected and summarized prefixes. 



PHP:-

 

In Normal MPLS operation, IPv4 packet when comes to Egress LSR, will have MPLS Label on the top of IP Header. Egress LSR will do 2 operations and 2 look ups. One in MPLS table and other in IP Routing Table to send the packet to appropriate Customer interface. However these 2 operations increases the memory and CPU consumption on the Egress LSR. To avoid these 2 lookups on Egress, Egress LSR initially send a special label value of 3 to “next-to-last LSR” (called the penultimate LSR). This label 3 is called the IPv4 Implicit Null label. When an LSR receives an MPLS header in which the label is set to 3, it always POPs the header i.e., it removes the top label.

This procedure  is called Penultimate Hop Popping (PHP)

Explicit Null:-

when a packet or Ethernet frame is encapsulated in MPLS, you have the option of copying the IP precedence or 802.1p bits to the three CoS bits of the MPLS header i.e. EXP Bits.

If a POP is performed at the penultimate LSR, the EXP bits in the MPLS header are no longer available as a reference for queuing and the packet is queued on the outgoing interface according to the CoS behavior of the underlying payload (in Ipv4 packet, it will be ToS field). An explicit null (Label Value 0 for IPv4), on the other hand, leaves the MPLS header in place until it reaches the egress, preserving the LSP CoS behavior across the entire LSP.

                                                    



In MPLS (Multiprotocol Label Switching), Explicit Null is a label value used to represent the absence of a label. When a packet is forwarded with an Explicit Null label, it means that the packet should not be labeled at the current node and the label should be removed from the packet.

Explicit Null label is used in a variety of scenarios, such as when an MPLS tunnel endpoint (e.g., a router or a switch) wants to remove the label from the incoming packet before forwarding it to the next hop, or when a label-switched path (LSP) is terminated at a node and the node needs to signal the downstream node to remove the label.

Explicit Null label is also used for traffic engineering purposes, such as to indicate that a particular link or path should not be used for a particular traffic flow.

Explicit Null is represented by the label value of 0 in the MPLS label stack.


For more reading click on below links-

https://techtalks2024.blogspot.com/2023/05/is-is-routing-protocol.html

https://techtalks2024.blogspot.com/2023/05/mastering-osi-model-and-networking.html


No comments:

What is differrence between STP and RSPT ?

  RSTP has faster convergence than STP. This is because  RSTP does not rely on forwarding delay timers , making it faster and more efficient...