Label Forwarding Information Base (LFIB) & Label Information Base (LIB) in MPLS

Ayush Pandya
12 min readJul 3, 2020

In the previous articles, we covered the concepts of MPLS, IP Routing tables & various IP forwarding mechanisms, and Label Distribution Protocol (LDP). It is now time to complete the jigsaw and talk about MPLS related tables Label Information Base (LIB) and Label Forwarding Information Base (LFIB) using which the MPLS forwarding takes place. I would recommend going through the related linked articles first before diving into this article.

A Quick Recap of MPLS, LDP, and the IP Routing Tables

The following is a brief summary of what we have learned from the MPLS and IP forwarding perspective till now.

  1. The IP packet routing and forwarding makes use of two routing tables: Routing Information Base (RIB) and Forwarding Information Base (FIB).
  2. Cisco Express Forwarding (CEF) is the current most used and efficient IP forwarding mechanism. The other vendors may have their own forwarding mechanisms.
  3. CEF creates two tables: Formation Information base (FIB) and Adjacency Table that store the forwarding information.
  4. The information from CEF is used for MPLS forwarding. Thus, CEF should be enabled for MPLS functionality to work.
  5. MPLS works on the idea of assigning labels to the IP packets that can be swapped, popped, or stacked based on the operations required.
  6. MPLS forwarding is more efficient than time-consuming IP Forwarding mechanisms (including CEF).
  7. In MPLS, only labels are referenced from packets, and packets are then forwarded based on the mapping of labels with IP prefix mapping, next-hop IP address, and the exit interface.
  8. The labels are generated and distributed in the MPLS network using Label Distribution Protocol (though there are other protocols too, LDP is commonly used.)
  9. Label Distribution Protocol (LDP) session is formed between the peer routers in a subnet. After the LDP adjacency is in place, the label information is advertised between the routers, and the two tables namely Label Information Base (LIB) and Label Forwarding Information Base (LFIB) are created that are used to forward MPLS packets.

Label Information Base (LIB) & Label Forwarding Information Base (LFIB)

Introduction

Label Information Base or LIB is a routing table on a router where all the label bindings exchanged between that router and its LDP peers are stored. Like RIB, LIB is a Control-Plane MPLS table and is not used for the actual forwarding of the MPLS packets.

Label Forwarding Information Base or LFIB, like FIB, is a Data-Plane MPLS forwarding table. LFIB is used to forward the MPLS packets. LIB aids in creating the LFIB table with the help of the IP Routing table.

Image 1 — Relationship between Routing tables (RIB, FIB, LFIB, and LIB)

The above image shows the relationship between Data-Plane and Control-Plane tables (LIB, FIB, RIB, and LFIB). Based on this relationship, you would be able to derive how different tables are associated with each other. The relationships are defined across this article.

Creating Label Information Base and Label Forwarding Information Base

When LDP is enabled, the first thing that happens is that the routers in the MPLS network create locally unique labels for all the destination prefixes in their IP routing tables.

Once the label information created, it is stored in LIB and is then advertised to the LDP peers with the destination route. As soon as a router gets peer information, it stores the data in the LIB table.

Consider Image 2 where we have a destination network DN.

Image 2 — Sample MPLS Network with FIB tables

The image shows destination network DN and four Label Switch Routers i.e. A, B, C, and D part of an MPLS network. When IGP would have been enabled on the LSRs, each router would have generated its IP Routing Table and also FIB & Adjacency table via CEF. When LDP is configured and is enabled on the LSRs, all the steps relating to LDP Adjacency are performed after which Routers are ready to advertise their label information to the peers.

In Image 2, the FIB tables for LSR A, B, and C are shown (FIB for D is not shown for clarity). Also, to be specific, here we have combined the output of FIB and a part of the Adjacency table that would have been built using CEF. The entries in these tables are for the best routes to the destination DN.

Consider the Label Information Base (LIB B) and Label Forwarding Information Base (LFIB B) on LSR B empty for now.

The FIB (FIB A) of LSR A contains the Next Hop IP (B Intf IP) for destination DN which is the IP address of the interface on LSR B ( B Intf) that connects with Exit interface ( A Intf.) So, if an MPLS packet arrives on LSR A for destination DN, the label switching will happen and the packet would be forwarded towards B Intf on LSR B via A Intf on LSR A.

Let us suppose that Downstream-Unsolicited (DU) label distribution mechanism is used in our network. Using this method, the locally unique labels are generated by each router for all the destination prefixes and advertised to all the LDP peers. Image 2 shows this using the example of the LSR B which has generated local label binding of value 20 for the Destination DN and has advertised it to all the LDP Peers (LSR A and LSR C).

Before advertising the label, LSR B stores the data in its LIB i.e. LIB B (see Image 2). Using the information in the LIB and IP Routing Table, the Label Forwarding Information Base — LFIB B is generated. Let us consider that no label bindings are available as of now from the downstream LSR C. If the best path is known with Next Hop IP and Outgoing Interface, LFIB B will contain:

  • Destination Network value DN.
  • Local Label / In Label as 20.
  • Next Hop IP as C Intf IP (Interface on Router C connected to BC interface on LSR B).
  • Outgoing Interface as BC Intf (Interface on LSR B and connecting Router C).
  • The Outgoing Label is marked as Pop (it means that label should be popped/removed before forwarding) as no label value is yet received from downstream LSR C for destination DN.

The label bindings are advertised inclusive of destination route and LDP ID (Router ID:Label Space ID).

Let us consider destination DN to be 10.3.3.0/24. Following is the command output to see the LDP bindings (LIB) on Cisco. For demo purposes, we have taken CLI outputs of LSR A (Router ID = 1.1.1.1) and LSR B (Router ID = 2.2.2.2) as in Image 2. The output contains local label binding and peers label bindings for DN

Advertised label information and augmenting Label Information Base and Label Forwarding Information Base

Refer to Image 3 for this section.

Image 3 — Label Information Base and Label Forwarding Information Base Example

In the above image, we are considering that all the LDP advertisements have happened between the network routers, and the Label Information Base for all the routers has been constructed. We have removed the Outgoing Interface column from the FIB tables in Image 3 for clarity purposes. Let us discuss in brief what would have happened when LDP Adjacency would have been established between the LSR A, B, and C.

LSR A

LSR A created a local label 10 against destination DN, added in its LIB, created initial Label Forwarding Information Base (If the peer labels were not available, Pop value would be used for Outgoing label,) and advertised label binding to LSR B. LSR A would have also received label 20 from LSR B and label 30 from LSR C (via LSR B) for the destination DN.

With all the information in place and using the data from the Routing Table, the correct outgoing label would have been chosen and LFIB A would have been updated against the Pop label. Similarly, the chosen label value would also have been added to the FIB against the DN. FIB with label entry help if any unlabeled packet needs to be forwarded into the MPLS network (as router checks FIB for forwarding of unlabeled packets).

Consider LFIB A in Image 3. For destination DN, the local label is 10. Also, as per the Routing table, the best route to DN is via LSR B (Check Next Hop IP in FIB A in Image 2). The Next Hop IP and Exit/Outgoing interface are derived from the IP Routing table entry for the Destination DN via LSR B. The Outgoing Label is set to 20 as received from LSR B. For more details, refer to the next section below.

LSR B

Similarly, LSR B created a local label value of 20 for destination DN, stored in its LIB, and advertised to LSR A and LSR C. It also received label 30 from LSR C and label 10 from LSR A for DN. Based on the values from LIB B and the Routing Table, LFIB B would have been built and updated with the Outgoing label as 30 ( Pop value updated) which it received from LSR C. Remember, in the last section, we had stated that the Outgoing label value was set as Pop for LSR B as no label bindings were received.

LSR C

LSR C created a local label value of 30 for destination DN, stored in its LIB, and advertised to LSR B using which it was also advertised to LSR A. It also received label 20 from LSR B and label 10 from LSR A (via Router B) for DN. Based on the values from LIB C and the Routing Table, LFIB C would have been built.

Note: The label value for the destination DN would also be added to the related entry in the FIB table of every router (as shown in Image 3.)

How Label Forwarding Information Base gets the values using LIB and Routing Table?

Consider Image 4 as an example.

Image 4 — Example for LFIB values updates via Routing table and LIB

Suppose, we have a Destination Route 4.4.4.0/24. It is advertised using IGP and is captured by LSR A, LSR B, and LER A.

Let us look at the routing table for LER A for route 4.4.4.0/24.

LER A# show ip route 4.4.4.0
Routing entry for 4.4.4.0/24
Known via “ospf 100”, distance 110, metric 7
Last update from 10.1.0.2 on FastEthernet0/0 0:00:58 ago
Routing Descriptor Blocks:
* 10.1.0.2, from 4.4.4.0, 0:00:58 ago, via FastEthernet0/0
Route metric is 7, traffic share cou
nt is 1

Also, LER A would have received label bindings for 4.4.4.0/24. Let us see the command output for LDP bindings or LIB entries.

LER A# show mpls ldp bindings 4.4.4.0 24
lib entry: 4.4.4.0/24, rev 12
local binding: label: 40
remote binding : lsr:1.1.1.1:0, label:10
remote binding : lsr:2.2.2.2:0, label:20

The above output shows that LER A has received label bindings 10 and 20 from LSR A & LSR B respectively for 4.4.4.0/24. LER A has also created a local binding 40 for the route.

As also highlighted in the previous section, LFIB for LER A may have been created with the Outgoing label as Pop (if no label values would have been available from LDP peers.)

LER A needs to decide which route should a packet take for the destination DN when it receives it. Here we have two label bindings each from LSR A and LSR B (see LDP bindings command above), but, only a particular label binding should be selected. We need to choose the best path for route 4.4.4.0/24 from the LER A and then fetch the corresponding label value. From the routing table (see show ip route command above), we can see that the best path is via FastEthernet0/0 on LER A and Next Hop as 10.1.0.2 which is the IP Address on LSR B.

The LIB of LER A has no entry related to 10.1.0.2 as of now. So, how the LFIB outgoing label value is derived? The answer is, during the LDP session set up, the LDP Peers also inform each other about the connected interfaces between them. So, LER A would know that 10.1.0.2 is the IP address of an interface on LSR B, and thus label entry for LSR B will be selected. The LFIB for LER A will be created using the label binding from LSR B (lsr:2.2.2.2:0) i.e. LER will have outgoing label value 20 for 4.4.4.0/24.

Following is what the Label Forwarding Information Base output would look like using CLI on LER A.

LER A# show mpls forwarding 4.4.4.0

The label 20 will also be attached to the FIB (CEF entry) against the destination 4.4.4.4/24.

*Note: All the values depicted above are for demo purposes.

There are 2 special labels “implicit-null” and “explicit-null”. Both of these are sent by the edge or last-hop router to the upstream router.

Implicit-null sent to the penultimate hop router by the last hop router asks the penultimate router to Pop the MPLS label and send only the IP packet to it. This is done to reduce the load on the edge router that otherwise would have to perform 2 lookups (MPLS label and IP lookup) to send the packet to the destination. This mechanism of popping the label on the penultimate hop router is called Penultimate Hop Popping (PHP.)

Explicit-null sent to the penultimate hop router by the last hop router asks the penultimate router to keep the QoS information intact if the penultimate router has to Pop the MPLS label. In this case, the penultimate router will send the packet with label 0 to the last router with all the other information of the MPLS header intact. Thus the QoS value will be available to the edge router which otherwise would have been removed in case of PHP.

Packet Operation

Now that we have learned about IP packet forwarding, MPLS, LDP, and all the routing tables, let us see how it all works together.

Image 5 — IP and MPLS Packet Operation w.r.t. RIB, FIB, LIB, and LFIB

In the above image, it is assumed that we are inside a network where a packet is getting forwarded through the nodes. Suppose, an unlabeled IP packet reaches a router. The router will do the FIB lookup (with Adjacency table,) and will be forwarded to the Next Hop as an IP packet.

Now, let us suppose that an MPLS packet arrives at the same router which is also part of the MPLS network. In such a case, the MPLS packet will refer to the LFIB and will be forwarded (via label Swap, Pop, Stack) to the Next Hop. Based on the outcome of the label operation, the packet will exit the router either as an MPLS packet or as an IP packet.

What if an IP packet meant to be routed through the MPLS network arrives at the Ingress/Edge Router?

Suppose an IP packet meant to be routed through an MPLS network arrives at the Edge Router of the MPLS network for a destination. Considering FIB, LIB, and LFIB, all in place, as soon as the packet arrives, the Destination lookup will happen against the FIB. The FIB would already be containing a label value against the destination entry when LFIB would have been created for the edge router. Due to the label entry, the router will identify that the packet is meant for the MPLS network and will then refer toits Label Forwarding Information Base for forwarding information.

Using LFIB, the concerned label would be attached to the IP packet converting it into an MPLS packet, which will then be forwarded to the Next-hop in the MPLS network. The labeled packet will flow as per the MPLS switching and forwarding mechanism between the LSRs using LFIB of each router. The label will be removed when exiting the MPLS network and the packet would be forwarded to the destination as a native IP packet.

For a packet to be routed via the MPLS network, the FIB lookup happens at the Edge Router which identifies the label information. Once the label is applied, the labeled packet gets forwarded inside the MPLS network using LFIB and not FIB.

Originally published at https://theunprecedentedcult.in on July 3, 2020.

--

--

Ayush Pandya
0 Followers

Author @ https://theunprecedentedcult.in. Blogger. Poet. Song-writer. Emotions finder. Content Writer. Research Enthusiast.