Wednesday, February 1, 2023

MPLS Data and Control Plane

MPLS consists of two related, but relatively independent operations

So, now to explain Data Plane we have to assume that control plane work, or to explain control Plane we have to assume that data plane works.
As they two independent operations but related to each other.
So, we will first discuss the Data Plane and then proceed with control plane.

MPLS Data Plane Working

Data plane performs the functions relating to forwarding data packets. These packets can be either Layer 3 IP packets or labeled IP packets. The information in the data plane, such as label values are derived from the control plane. Information exchange between neighboring routers creates mappings of IP destination prefixes to labels in the control plane, which is used to forward data plane labeled packets. 

  • Node A and B is the boundary of the above MPLS network, which are customer device.
  • So, we will be looking at the communication between the Node A to Node B.
  • All the router in the MPLS network is called LSR (Label Switching Router). So, the router at the edge is called edge LSR and router in between are intermediate LSR.
  • So, here R1 and R4 are edge LSR and R2 and R3 are intermediate LSR.
  • Also, to be more specific for this scenario, as the traffic flow is from Node A to Node B, so the R1 will be Ingress edge LSR and the R4 will be Egress edge LSR.
  • When the IP packet arrived at the Ingress edge LSR (R1) from Node A, the R1 will perform the IP lookup for destination Node B, and get the path, and then do lookup in the table that we call the LFIB (Label forwarding Information Base).
  • In these LFIB, the R1 will look that for incoming packet for destination B, need to be send to router R2 out of interface 2, and use the label 53.
  • Now the labelled packet will arrive at R2, which is only a Label switching router.
  • So now the R2 will look in his own LFIB for the label 53 where need to be send. It will show that label 53 packet need to be send to router R3 out of interface 2 and drop the label 53 and use label 77.
  • Now, similar thing will happen on R3. It will have entry in LFIB that for label 77 packet send to router R4 out of interface 2 and drop the label 77 and use label 3.
  • Now at R4, as it is egress edge LSR. When the labelled 3 packet arrived , in LFIB it will see , that the label 3 packet should be send to Node B out of interface 2, and drop the label 3, and don’t use any label, and do the IP lookup for destination Node B which will be directly connected.
  • So, at router R4 we do 2 operations, one is Label lookup and other is IP lookup, which is unnecessary extra operation.
  • To better understand, let name all the Label operation perform in MPLS network a name.

LABEL Operations

  • PUSH – Label is installed on the packet (Label is Pushed on to the stack)
  • SWAP – Top-most label is swapped
  • POP – Top-most label is removed from the stack
  • DELETE – Entire label stack is destroyed on the packet à Critical Operation especially while MPLS VPN
So, now at router R4 we are doing POP operation as well as IP lookup, which is not a very optimal situation.
So, here come here another concept in MPLS which is Penultimate Hop Popping.

Penultimate Hop Popping Process

  • So, instead of doing 2 operations at R4, R4 will request R3 to do the POP operation by sending implicit-null signal to penultimate hop (i.e., 2nd last). This implicit null is label as 3, by R3.
  • So, now when labelled packet is arrived at R3(penultimate hop), it will pop the label and send the IP packet with implicit-null signal (i.e., label 3).
  • Now, when R4 received this IP packet with label 3, it will immediately pop this label and directly do routing lookup to forward the IP packet.
  • This process is called PENULTIMATE HOP POPPING.

Benefits

  • Saves an additional lookup on the last hop router in an LSP.
  • Instead of assigning a local label and advertising that label, the last hop router advertises an “Implicit NULL" for all connected and summarized prefixes in its routing table.
  • An Implicit NULL label has a value of 3 (MPLS reserved label)

So, this how the data plane works in MPLS. But now how label get assigned and R1, R2, R3 and R4 knows which label to assign. So, to explore we have to get into the MPLS control plane.

To get in MPLS control plane, first we have to get into different MPLS database which is been used.

MPLS Database

In IP network, there is 2 databases:

In MPLS network, there is 4 databases

The MPLS Control Plane consists of

  • IP Routing Protocols
  • IP Routing Table (RIB)
  • Label information Base (LIB)

The MPLS Data Plane consists of

  • Forwarding Information Base (FIB)
  • Label Forwarding Information Base (LFIB)
Updating Process of  each MPLS Database 

  • The routing table in cisco IOS router (RIB) will be populated with the routing source.
  • Based on the RIB, the Forwarding Information Base (FIB) will be created.
  • Also, FIB will get the information from L2/L3 mapping protocol like from ARP tables, Frame relay, etc.
  • Now, when MPLS is enabled globally, the multiple Label information base (LIB) table is created and get populated with the information from RIB with the help of Label Pool and Label exchange protocol like LDP, TDP, BGP, RSVP, Static.
  • Now, all the information from RIB, FIB and LIB will created the Label Forwarding Information Base (LFIB).
  • Both FIB and LFIB are the part or subset of the CEF table only.

MPLS Control Plane Working

We will take the same example as above with four router R1, R2, R3, R4 and 2 host A and B.
As the data traffic has been sent from Host A to B, which mean my label information need to flow from Host B to A.

Note:
  • In order to get the fully operational and functional MPLS network, we need fully operational and functional IP network.
  • If your IP network doesn’t work, your MPLS will not work.
  • So, make sure, in your network IP network is fully operational and functional.
  • Also, MPLS is irrelevant of any routing protocol use in background

So, now as the IP network is fully operational, so let say all router R1, R2, R3, R4 will build their own RIB table as below:

  • R4 RIB will have B is directly connected
  • R3 RIB will have B is reachable via R4
  • R2 RIB will have B is reachable via R3
  • R1 RIB will have B is reachable via R2

From the Information of RIB and the L2/L3 mapping protocol, we will build the FIB table as below:

  • R4 FIB will have B is directly connected, out interface 2, with some L2 information
  • R3 FIB will have B is reachable via R4 out interface 2, with some L2 information
  • R2 FIB will have B is reachable via R3 out interface 2, with some L2 information
  • R1 FIB will have B is reachable via R2 out interface 2, with some L2 information
Now, we enable MPLS and LDP on all interface of router one by one,
first each router will assign a local label from the route information of RIB and FIB, and build LIB table as below:

  • In R1 LIB à B: Local Label: 101
  • In R2 LIB à B: Local Label: 201
  • In R3 LIB à B: Local Label: 301
  • In R4 LIB à B: Local Label: Implicit Null ---> as B is directly connected

Now, As LDP is enabled, each neighbor connected device will exchange the local label assign route to other router with the help of LDP protocol as below:

  • In R1 LIB à
B: Local Label: 101
B is reachable via R2, and use label 201
  • In R2 LIB à
B: Local Label: 201
B is reachable via R1, and use label 101
Note: As the above route is completely nonsense, as B is reachable via R3 and not via R1, but R2 will keep this information in LIB. This is the liberal retention part, which mean LDP will even keep the information in the table which actually doesn’t need.
B is reachable via R3, and use label 301
  • In R3 LIB à
B: Local Label: 301
B is reachable via R4, and use label Implicit-null
B is reachable via R2, and use label 201
  • In R4 LIB à
B: Local Label: 401
B is reachable via R3, and use label 301 

As, now we have RIB, FIB and LIB table, now the LFIB table will be created from all these table information as below:

  • In R1 LFIB:
- B can be reached from R2 out interface 2 with label 201, with L2 information
Note: Their will be one more entry based on the local label
- If we received a packet with labelled 100, send it to R2 out interface 2 with label 201, with L2 information.


  • In R2 LFIB:
- B can be reachable via R3 out interface 2 with label 301, with L2 information
- If packet with labelled 201 is received, send it to R3 out interface 2 with label 301, with L2 information.
  • In R3 LFIB:
- B can be reached from R4 out interface 2 with no label assign (POP operation), with L2 information
- If we received a packet with labelled 301, send it to R2 out interface 2 with no label assign (POP operation), with L2 information 
  • For R4, their will be no LFIB for the B network, as it is unlabeled traffic, which mean it is IP traffic.

This is how traffic is forwarded in MPLS network

No comments:

Post a Comment