Wednesday, July 24, 2013

What is Multiprotocol Label Switching (MPLS)

MPLS (Multiprotocol Label Switching) is a new TCP/IP protocol which forward packets based on a 32 bit-labels inserted between Layer 2 and Layer 3 header. The basic idea behind MPLS is based on two paradigm:-

1. Layer 2 Switching is faster than Layer 3 Routing i.e. Switching is faster than Routing:-
The reason behind this is that in case routing the router has to read all routing table to route any packet excluding broadcast and multicast packets. So the complexity level will be O(n). While in case of Layer 2 switching any first match is sufficient to forward the packet. So in case of switching the complexity will be of order O(n/2).

2. Circuit switching is more reliable and faster that packet switching:-
There is most obvious thing. When Internet was designed,the existing network links were unreliable. So it was thought that each packet may traverse through different path. Keeping in view of that all mandatory information for routing(Source and Destination address) was kept with every packet. But now-a-days links are becoming more and more reliable with each passing years. So Circuit Switching concept was brought back in Internet in the form of MPLS. Circuit switching involve less overhead of routing and therefore faster than packet switching.

How MPLS works:-  MPLS forward the packet based on label only. It like the shopping of food items. When you go shopping for food item you see the label for identifying whether this item is made of VEG stuffs or NON-VEG stuffs. So in this process you may skip reading of contents of that food. This makes you life easier. Recently, SEBI has mandated mutual fund  houses to put label on their mutual fund products based on risk involved so that by merely looking at you will come to know whether this mutual fund is suitable for you or not.

A MPLS Router can assume three role
1. Provider Edge(PE) Router:- This router reads the packet and determine its forward equivalence class,put a label and forward it other MPLS router. It also remove label and forward the normal IP packets.
2. Provider (P) Router:- These are backbone router and forwards packets based on labels only.

In simple word, MPLS first identify a flow(most probably based on destination address) insert a tag or label and forward the packet in MPLS network. In between MPLS network packet forwarding takes place based on label only. At exit end of the network the router removes the label and send the plain IP packet to the user.

Now the question arises how the label switching works. MPLS first forms Label Switched Path(quite similar to Circuit switching path) using an underlying routing protocol OSPF or BGP. In principle, OSPF/BGP helps a MPLS router to calculate a Forward Equivalence Class(FEC) which in turn is used to classify the packets for labels to inserted. Label has only local significance to a link i.e. same label may reused at others link also.


Out of 32 bit of label, only 20 bit is used for actual label. 3 bit is used for Experimental purpose. It will further used for importing differentiated service field of IP packet. This field can be used later on to provide QoS. S bit indicate end of stack label. The idea here is that there may be multiple label inserted in between in order to have higher level of aggregation of traffic in the MPLS network.When a packet comes to a MPLS enabled router, it can either PUSH,POP or swap a label. The S bit show the lowest label. The last 8 bit is used for TTL field. This TTL field is same as IP packet. The purpose for TTL bit is same as in IP packet to drop a packet from traversing infinitely in the network in case of looping.

No comments:

Post a Comment