Enhance your Career in Networking With IPinBits!!!​

MPLS : Double Lookup and PHP

This articles is based on the double lookup scenario in MPLS and how PHP overcomes its, as we already discuss the PHP term in the previous articles , you can refer the fundamental articles below

Lets try to understand what is this double lookup scenario first, lets take our same old topology, we will only concentrate on the MPLS domain here.

MPLS DOMAIN

What exactly is double lookup scenario:

In MPLS whenever a router receives a packet i.e.

Labelled packet:  For labelled packet, router refers LFIB table as we know by now.

Normal IP packet: Router refers FIB table to get the next-hop to forward.

Let’s take the topology, we will concentrate for prefix 5.5.5.5 i.e., the loopback address of R-5 PE-2, and see how other routers get the label and check all the routers in path from R-1_PE1, R-2, R-3, R-4’s perspectives.

Let’s say there is no PHP,

  • Router R-5 creates a label 19 for its loopback address 5.5.5.5 and forwards to R-4.
  • R-4 will create its own local label let’s say 20 for 5.5.5.5, forward it R-3
  • R-3 creates its own local label 21 for 5.5.5.5 and forward it to R-2.
  • Similarly, from above, R-2 creates a local label 22 and forward it R-1.

Each and every router now has a label to reach R5, lets check from traffic perspective from R-1 to R-5 now

  • Whenever an IP packet arrives on R-1 it will refer the FIB table, the FIB will show the entry attach label 201 and forward to Next-hop router R-2.
  • R-2, R-3, R-4 are LSR as usual they will swap the label from their respective LFIB table and packet arrives on R-5.
  • Now R-5 has received the label packet, and we know for label packet router refers the label table LFIB. But here it cannot find any label to swap nor next-hop.
  • So, in this scenario, it will refer FIB table after referring LFIB table and then from the information provided by FIB, R-5 will forward the packet.
  • Referring FIB means, R-5 will detach the label 20 which it received from R-4, and will route the ip packet.

This scenario is known as double lookup since R-5 had to refer the LFIB table and FIB table, now this was just for one prefix, imagine hundreds and thousands of prefixes in service provider domain. So many double route lookups needs to be performed by the router, which can be saved using PHP.

To overcome this particular issue, Routers use PHP as their default behavior.

PENULTIMATE HOP POPPING:

Lets see how PHP (implicit Null/ POP label) saves the day and CPU/memory cycles for packet forwarding.

Same topology, now we will check in lab, with output since PHP is by default enabled on our devices.

  • Same prefix 5.5.5.5 from R-5, now instead of creating a local valid label, it will generate a implicit Null/ Pop label (3) and forward to R4.
  • R-4 receives this Pop label and understands that to reach 5.5.5.5, it has to pop the label and forward normal IP packet to R-5, R-4 will create a local label and forward to R-3, R-3, R-2, R-1 will also do the same will create local label and learn the label from its peers and add the entries in LFIB table.
  • Process remains the same for R-1, R-2, R-3, R-4 i.e.  R-1 will attach label to reach 5.5.5.5 from LFIB and forward to R-2.
  • R-2, R-3, R-4 are LSR, has to swap the labels. (same Push, swap and pop mechanism which we already know).
  • Now when the packet arrives on R-4, R-4 will check the LFIB table. Here is catch and most important of this article instead of swapping the label, “R-4 will POP the label as it received the implicit null/ POP label from R-5”
  • Now R-5 received an IP packet without any label, so for normal IP packet check the start of the article, R-5 will refer the FIB table now not LFIB as in previous case and process the packet with only one Lookup.

This is called Penultimate Hop Popping, where the label is popped before the last egress router or the router which has the prefix. In this way, PHP overcomes double lookup scenario.

Let’s check the lab to confirm the same theory:

We will check for the same prefix 5.5.5.5 which R-5 as its in FIB/RIB, and will create POP/implicit Null label (no label) and send to R-4

R-5-PE2#show mpls forwarding-table 5.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
None       No Label   5.5.5.5/32       0                        

R-5-PE2#show ip cef 5.5.5.5
5.5.5.5/32
  receive for Loopback0
R-5-PE2#

On R-4, it should see as POP and local label for 5.5.5.5       

R-4-P#show mpls forwarding-table 5.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
401        No Label   5.5.5.5/32       2780          Gi0/0      192.168.3.2 


R-3, R-2, R-1 will have normal labels as you can see below:
R-3-P#show mpls forwarding-table 5.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
302        401        5.5.5.5/32       3436          Gi0/1      192.168.2.2 
R-3-P#

R-2-P#show mpls forwarding-table 5.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
201        302        5.5.5.5/32       3436          Gi0/2      192.168.1.2 
R-2-P#

R-1-PE1#show mpls forwarding-table 5.5.5.5
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
102        201        5.5.5.5/32       0             Gi0/0      192.168.0.2 
R-1-PE1#  

We can also verify using trace, from R-1 to R-5, as you see the R-3 Hop has label and 4th Hop has no label that's R-4 popping the label and forwarding normal IP packet to R-4

R-1-PE1#traceroute 5.5.5.5
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.0.2 [MPLS: Label 201 Exp 0] 9 msec 11 msec 13 msec
  2 192.168.1.2 [MPLS: Label 302 Exp 0] 6 msec 10 msec 9 msec
  3 192.168.2.2 [MPLS: Label 401 Exp 0] 6 msec 9 msec 10 msec
  4 192.168.3.2 17 msec 9 msec 11 msec
R-1-PE1#

This is all about PHP and double lookup scenario, hope you liked, stay tuned for more.

Related blog posts