MPLS LDP (Label Distribution Protocol)

LDP is a protocol that automatically generates and exchanges labels between routers. Each router will locally generate labels for its prefixes and will then advertise the label values to its neighbors.

It’s a standard, based on Cisco’s proprietary TDP (Tag Distribution Protocol). It’s pretty much the same story as 802.1Q/ISL or PaGP/LACP. Cisco created a protocol and a standard was created later. Nowadays almost everyone uses LDP instead of TDP.

Like many other protocols, LDP first establishes a neighbor adjacency before it exchanges label information. It works a bit different than most protocols though…

First we send UDP multicast hello packets to discover other neighbors. Once two routers decide to become neighbors, they build the neighbor adjacency using a TCP connection. This connection is then used for the exchange of label information. Normally a loopback interface is used for the neighbor adjacency. Here’s an example:

MPLS LDP Multicast Unicast


The two routers above will send multicast hello packets on their FastEthernet interfaces. Within this hello packet, they will advertise a transport IP address. This IP address is then used to establish the TCP connection between the two routers. Here’s what the hello packet looks like in wireshark:

MPLS LDP Hello Packet

In the capture above you can see a couple of interesting things:

  • The hello packets are sent to multicast address using source/destination UDP port 646.
  • Each router has a unique ID called the LSR (Label Switch Router) ID. This is similar to how most protocols select an ID, by default it will select the highest IP address on a loopback interface. If you don’t have any loopback interfaces then we will use the highest IP address on a physical interface.
  • At the bottom you find the transport address. This is what we use to build the actual TCP connection.  Like the LSR ID, the router selected the IP address on the loopback interface as the transport address.
Make sure that the IP address that LDP has selected for the transport address is advertised in your routing protocol. Otherwise your routers will be able to hear each others hello packets but they can’t form a neighbor adjacency since the transport address(es) are unreachable.

This is different compared to how routing protocols like OSPF or EIGRP form neighbor adjacencies. For example, when you run OSPF then your routers will form neighbor adjacencies on all interfaces that run OSPF:

OSPF two neighbor adjacencies

LDP will only form a single neighbor adjacency, no matter how many interfaces you have in between your routers:

LDP single neighbor adjacency

LDP is a bit similar to BGP when you use the loopback interfaces for the neighbor adjacency. When we use BGP we have to use the update-source command to select the source, LDP does it automatically.

So once our LDP routers have become neighbors, how do we exchange label information? To explain this, let’s do a quick review of how normal routing uses the RIB and FIB. If you have no idea what these two are then I recommend you to read my CEF tutorial first before you continue.

control plane rib forwarding plane fib

With normal routing, we use routing protocols like EIGRP, OSPF or BGP to learn prefixes from other routers. These are all stored in the RIB (Routing Information Base), this is your routing table.

The information in the RIB is used to build the FIB (Forwarding Information Base) which is what we use for actual forwarding of IP packet. These tables are all used for IP packets but for MPLS we use something else:

Fib Lfib Cisco

When we use LDP on Cisco IOS, we locally generate a label for each prefix that we can find in the RIB, except for BGP prefixes. This information is then added to the LIB (Label Information Base).

The information in the LIB is used to build the LFIB (Label Forwarding Information Base). When the router has to forward a packet with a MPLS label on it, it will use the LFIB for forwarding decisions.

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 662 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

515 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!


Forum Replies

  1. CAM: High speed memory that is primarily used for a switch’s layer 2 lookup information. This information allows the switch to decide which port to send a packet to (a known MAC address) or whether to flood it to all ports (unknown MAC address).

    TCAM: Not all switches have this. Think of this as an extension of CAM. It is used for very rapid decisions on ACLs and Quality of Service. On high end layer 3 switches, the TCAM can also contain the FIB, again, so specialized hardware can making routing decisions without interrupting the central CPU of the switch.

    ... Continue reading in our forum

  2. Thanks Rene,

    I have another question, in the above section where u have mention about ARP request construct, I think the behavior of switches are different

    The multilayer switch will check the routing table, notices that 192.168.20 /24 is directly connected and the following will happen:
    The destination MAC address changes from FFF (Multilayer switch Fa0/1 ) to BBB (ComputerB).
    The source MAC address changes from AAA (ComputerA) to GGG (Multilayer switch Fa0/2).===This seems to be Incorrect

    I LAB this up with 3 switches (all real hardware 3550/3560) [ c3560-ips

    ... Continue reading in our forum

  3. Hi Andrew!,

    Glad to see you around and yea! thanks for confirming my doubt.

    I have a few more doubts that i have no where to turn to and i hope you will enlightened me…

    My coreswitch has ip cef turn on my default.

    q1) I have been reading up abit on cisco about IP CEF and it seems like to enable/disable IP CEF, you have to do in at the ingress interface as the decision (e.g. load balance is done there). – is it right ?

    Assuming i have “no ip cef” and only wish to turn on ip cef on certain interfaces and ->
    q2) if i want to do to packet loadbalancing, should “ip

    ... Continue reading in our forum

    1. The ARP table is stored in RAM, and not in either CAM or TCAM

    2. Here is the Cisco definition of Epoch and how it is used:

    The term "epoch" refers to a period of time. A new epoch for a Cisco Express Forwarding table begins when a table rebuild is initiated. The time after this instant is in an epoch different from the time before, and the different epochs are numbered between 0 and 255. Through the use of epochs, the software can distinguish between old and new forwarding information in the same database structure and can retain the old Cisco Express Forwar
    ... Continue reading in our forum

89 more replies! Ask a question or join the discussion by visiting our Community Forum