cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
42516
Views
92
Helpful
13
Replies

Relationship between LIB,FIB and LFIB

emaamur2006
Level 1
Level 1

Hi all

I am having a little trouble understanding the relationship between the LIB, FIB and LFIB as part of the MPLS architecture. As far as I understand it, within the MPLS cloud at the ingress LSR, the FIB is a replica of the standard IP RIB and does not contain any label information.

At this point, if the LSR in question has an interface as part of an MPLS network, label information is added to specific destination prefixes. This information is then used by the LFIB to forward the packet to the next LSR.

Further reading tells me I must now worry about another table - the LIB. Can somebody clarify if my understanding above is accurate and if so, how does the LIB fit into the picture.

Thanks!

M

13 Replies 13

jayjorda
Cisco Employee
Cisco Employee

Your standard IP RIB is control plane, forwarding decisions are not made here, routing table is just built here. That then is parsed and becomes your FIB (Forwarding Information Base). So that is the forwarding or data plane. Same thing with MPLS. The prefix to label bindings are built and stored in the LIB (label information base), control plane, which is then used to create the LFIB (Label Forwarding Information Base) data or forwarding plane. The lookups are actually done in the LFIB, not the FIB.

Correction, lookups are done in the LFIB, not the LIB and in the FIB and not the RIB.

Hope this helps.

Jay

Jay,

Just a slight precision. The lookup is not always performed against the LFIB in an MPLS network.

The lookup is performed against the FIB on the ingress LSR.

In the core, the lookup is performed against the LFIB.

On the egress LSR, the lookup is performed against the FIB if there was only a single label in the stack and that this label was popped by the penultimate hop. The rest of the time, the LFIB is looked up.

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Right and as you already know Harold, table to lookup into is really determined by the Layer 2 header Ethertype or Protocol ID Field. That's really what tells the router what type of packet is coming in and therefore which table to look in.

0x0800 - IPv4: Lookup in FIB

0x8847 - MPLS Unicast: Lookup in LFIB

0x8848 - MPLS Multicast: Lookup in LFIB

Jay

RIB

This is the routing information received from all your routing peers,

for example like how to get to a specific destination from the router in question.

FIB:

Now just the information hop by hop recd via RIB (routing table is not enough)

As the router needs to figure out how to use this information to actually forward datagrams,

for which it needs to encapsulate/decapsulate with right layer 2 framing using the right interface. This is where a FIB is built.

Now in MPLS, every router assigns its own bindings to a prefix and the same is exchanged with peers, this Label Table is the LIB ( You may see multiple Label to Prefix Bindings for the same Prefix, received with different LDP ID.)

Now again, this LIB information is mapped to FIB ( to find the next-hop information to reach a LDP ID which sent a label, this builds your LFIB ) .

Now coming to some points you mentioned:

" As far as I understand it, within the MPLS cloud at the ingress LSR, the FIB is a replica of the standard IP RIB and does not contain any label information."

FIB is always derived from RIB, but it delves further into how to actually forward and switch datagrams using the routing information. And RIB will never have any Label information.

At this point, if the LSR in question has an interface as part of an MPLS network, label information is added to specific destination prefixes. This information is then used by the LFIB to forward the packet to the next LSR.

To be more specific, once you LFIB is built you have unique LSP paths pre-built across your network for a given unique prefix.

( That is for a given prefix, if you go and see the LFIB on each and every LSR you will see the incoming interface and the outing interface information and the incoming and outgoing label values to be used)

So what actually happens when a packet comes in at the ingress is, as per the network layer lookup it is assigned to a valid FEC, (That is LFIB, which gives the right next-hop and label value to use for the destination of that packet)

And then the LSR inserts the shim( this contains your Label values) , between L2 and L3 headers, and pushes it out on the right interface as per the LFIB.

HTH-Cheers,

Swaroop

Hi all

Thank you very much for all your explainations, it really did help me understand the building blocks of MPLS and i think thats very important. Sorry i took sometime to rate yr responses, i was still doing some more reading of my own, and i think the best resource for the basics of MPLS apart from this forum is MPLS fundamentals (by Luc de Ghein). I have read other books like MPLS and VPN architectures Vol 1 Vol II but i think Luc's explaination are easier to understand and spot on

Again, thank you all for yr help

BR

Maamun

walleyewiz
Level 1
Level 1

Here is a diagram I did a while back after I took an MPLS class. Feedback as to the accuracy would be much appreciated.

Hi Brad

Unfortunately, i could not get to open yr diagram before it expired so i couldnt give any feedback

Br

Maamun

Hi Maamun ,

Actually the diagram that Brad sent would be very useful for you to complete your knowledge (by the way it didn't expire yet - 2008).

In Brief, RIB (routing table) is built by the routing protocols in the control plane. (It contains only routes - no labels).

LIB (or TIB) is built by the LDP in the control plane. (It contains only labels - no routes).

FIB is built in the Data Plane by CEF. (It contains both routes and labels).

LFIB is built in the Data Plane. (It contains both routes and labels).

The whole idea is in the nature of the incoming packet (Labeled or ordinary IP packet) and the type of the outgoing interface (MPLS enabled or ordinary IP interface) there can be 4 scenarios as illustrated in the attached diagram. (A Labeled Packet is always looked up in LFIB and an IP packet is always looked up in FIB - The output packet in both cases can be Labeled or not according to the outgoing interface).

HTH, please rate if it does.

Best regards,

Mohammed Mahmoud

Is the CEF table the same thing as the LIB?  Please, explain. And where does the FEC come in all these?

Hello,

Is the CEF table the same thing as the LIB?

No, not at all. The CEF is an optimized routing table (in fact, a tree structure if implemented in software, or a hashing array if implemented in hardware). The LIB is more similar to an EIGRP topology table. The EIGRP topology table holds the list of all known networks and distances to these networks through individual neighbors that have advertised them. In a similar fashion, the LIB holds the list of networks and label mappings as advertised by individual neighbors. Recall that all your neighbors know the same set of networks and each of these neighbors assigns its own labels to these networks. The LIB holds the collection of all these mappings: a network and all labels as advertised by your individual neighbors.

When you construct the LFIB entry for a particular network, you first look into your routing table and find the next hop towards that network (plain IP routing). Then you look into the LIB and find out the label this next hop assigned to this network. Then you can construct the LFIB entry - the incoming label will be your own label that you assigned to the network, the outgoing label will be the label the next hop assigned to it, found in the LIB.

And where does the FEC come in all these? 

The FEC is an abstract term covering the set of all packets that are going to be forwarded in the exactly same way. Authors of MPLS needed to create this term because once a certain flow of packets gets the same label and is forwarded to the same neighboring router, they all are going to be forwarded through a single Label Switched Path and arrive at the same destination where they will be unlabeled. In the most basic MPLS, FECs are identical to individual destination networks. Each destination network would be a single FEC. However, because the sequence of labels defining an LSP through the MPLS network can be built using some other mechanisms that "detach" themselves from the plain routing tables, you suddenly get a whole new world in which not just the destination but also other policies define LSPs and resulting FECs. This is extensively used, for example, in MPLS Traffic Engineering where the LSP follows not just a path towards a particular destination but also goes through a path that guarantees a certain available bandwidth. The term "destination network" is no longer descriptive enough of the path here. Hence, the FEC term is born as a class of equivalently forwarded packets, and labels in fact bind to FECs.

Best regards,

Peter

Thanks Peter.  I may be taking this discussion back several steps.  I apologize for this. I need to understand a few more rudiments about MPLS.  Here is what I am wondering about at the moment:

My statements may be way off point, but I am sure you guys will understand what I am trying to say.  A router is enabled for MPLS traffic.  The router generates a label for each of its MPLS-enabled interfaces (I call this local mappings).  If this is correct, then what table does the router keep these local mappings?  Going forward, the LDP advertises these local mappings to the router's neighbors.  The router also receives similar adverts and builds its LIB.  From the entries in the routing table and LIB, the router builds its LFIB.  Correct? 

What does the CEF table contain?

Hello,

The router generates a label for each of its MPLS-enabled interfaces (I call this local mappings).

This is not correct. Label are assigned to destination networks, not to interfaces.

Try to look on the MPLS from a different angle. Sifting through the routing table when making a classical IP routing is computationally intensive. When a router receives an IP packet, it has to crawl its routing table to find the appropriate next hop information. Now imagine that the packet came in already labeled with the number of the routing table row that shall be used to forward it - the lookup would be much simplified then. It's like a router saying to its neighbors: "The network 192.0.2.0/24 is on the 27th row in my routing table so if you want to send packets to 192.0.2.0/24 through me, label them with number 27 so I can find the appropriate routing table entry quickly." This is the basis of labeling in MPLS, and binding labels to individual networks.

Of course, the next hop router may have the same network 192.0.2.0/24 on a different row, say, 45th. If this router is going to forward the packet to the next hop and also pass a hint about the row number, it must relabel the packet from 27 to 45 - hence the point of swapping labels in MPLS.

what table does the router keep these local mappings

The local and remote bindings (this is the correct term for label mapping) are stored in the LIB.

From the entries in the routing table and LIB, the router builds its LFIB

Exactly right.

What does the CEF table contain?

Destination networks, next hop information (egress interface, Layer2 header template), and with respect to MPLS, the CEF also contains label values to be imposed onto the packets if they come in unlabeled and should be forwarded as labeled.

Note that CEF is used for traffic that comes in unlabeled, or that leaves unlabeled. The LFIB is used for incoming labeled traffic. CEF does not deal with labeled packets because CEF is organized by IP networks, not by labels.

Best regards,

Peter

Wow! You have made the points clear enough.  I cannot complain any longer on this aspect of MPLS.  But other questions about other aspects may well follow.

Thanks a lot.

Cheers!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: