How is the data in LIB and LFIB generated

In Cisco CEF , FIB data is generated from Routing Table(RIB) and Adjacency Table is generated from Arp Cache.
The table in the diagram gives a big picture of CEF.

MPLS, I believe goes one step forward from CEF. it creates other tables LIB and LFIB. I would like to know how the data in those tables is generated ? if there is a diagram like the one shown for CEF, that might help better.

Thank you
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The LIB is generated using the labels that is assigned locally, plus any that is learned via LDP (and BGP, for VPN's), and this data is used to create the LFIB forwarding table.

I've looked for an open-source diagram like the one you attached, but I couldn't find one.  The closest I could get, is Figure 24-2 on page 3 of the Configuring MPLS chapter of the "Catalyst 6500 Series Switch Cisco IOS Softw
are Configuration Guide."
jskfanAuthor Commented:
If I understand Per the above link, LDP gets data from RIB and builds LFIB table.
There is an arrow point from LDP to FIB, but I am not sure what kind of relations they have.

I also believe LDP builds  LIB table, though the document does not explain where LDP gets information to build LIB.
I'll answer from the bottom up.

LDP is a protocol that exchanges the label-subnet binding on one Label Switch Router (LSR) to a neighboring LSR.  So LDP gets the Outgoing interface and Outgoing Label from neighboring LSR's (for subnets reachable via another LSR), and add it's own label, to advertise to other LSR's.  For subnets not learned from other LSR's, LDP uses entries from the routing table, add it's own label and advertise it to other LSR's via LDP.

LDP update the FIB with any label data at the MPLS Edge - An IP packet arriving at the Edge LSR might need to have a label pushed onto it, and this will be written into the FIB, as determined by LDP.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

jskfanAuthor Commented:
LDP update the FIB with any label data at the MPLS Edge
I am assuming  that LDP adds a column  to FIB table . if so what 's the name of the column ?

Looking at the diagram in the link you provided, it looks like Mpls process(LDP) creates 2 other tables, LIB and LFIB.

What I can conclude is:

** IP routing process creates Routing Table (RIB), this is common to all Routing protocols
 ** CEF creates FIB table from Routing Table and creates Adjacency table from Arp Cache table.
** MPLS updates FIB (I am not sure if it adds a column to it), it also creates LIB and LFIB tables ( the diagram does not show the columns of LIB and LFIB)
** The one thing I noticed MPLS does not use the Adjacency table , at least it is not shown in the diagram.
Here's the "show ip cef" output of two entries in a router of mine, one with a label, the other without:
Router#sh ip cef
  nexthop GigabitEthernet1/0/0.120
Router#sh ip cef
  nexthop GigabitEthernet1/0/0.120 label 1294

Open in new window

It seems that the additional field in the FIB would be called "Label", although it is not technically a new column in the FIB, rather an added piece of information in an existing field.

Also note that it is CEF that creates the LFIB (from the LIB), and also the entire FIB (labels and all) from the RIB and LFIB.  The adjacency table is used for both the FIB and LFIB, as it contains the header rewrite information for the particular interface.

It is simpler if you remember that CEF operates on the data forwarding plane (using FIB, LFIB and Adjacency tables), while the MPLS process (including LDP) operates on the control plane, where the "standard" routing protocols also ply their trade.
jskfanAuthor Commented:
The Diagram I posted in my question is about how CEF creates FIB and Adjacency Tables.

As you see there is no LIB or LFIB

I believe MPLS goes one step further, by adding the LIB and LFIB tables.

However What I understand from your comment is LFIB is not a new table, it is just a piece of information that MPLS adds to an existing field on the FIB, and also you are saying LFIB is created by CEF from the LIB...
I do not see that in the diagram...

Can you please just add some drawings to the diagram I posted , That might be explained clearly ?

The diagram you posted explains IP CEF, that is the "plain vanilla" version of CEF, to explain the basic principles of Cisco Express Forwarding.  When enabling MPLS on top of normal CEF, the router will add entries in the adjacency table for labelled packets, add labels to FIB entries (where appropriate), and creates/populates the LFIB table, none of which is indicated in the posted diagram.  And try as I might, I cannot get hold of a diagram explaining this mapping. So here's a diagram I drew up when studying for my MPLS exam:
CEFThis diagram is by no means complete, and has only been verified by me, so use it at your own discretion.

The LIB and LFIB only appears if MPLS is enabled, as it deals with label switching - As such, it is separate tables from the RIB and FIB.  And as MPLS can only run if CEF is also enabled, I guess it doesn't really matter if CEF or MPLS (or both) populates the LFIB - One of the support issues highlighted during the MPLS course, is that if the LFIB contains no labels for local routes, it is probably caused by CEF being disabled on the interface, so CEF has a role to play in populating the LFIB.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
 The video above talks about MPLS. if you forward it to 53 minutes , the instructor draws a diagram with the tables we were talking about..

I don't have access to YouTube from my current location, so I cannot check the context, but it seems about right.
jskfanAuthor Commented:
Thank you for your help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.