790 Words. Plan about 5 minute(s) to read this.
Here, we shall discuss not the forwarding of MPLS labeled packets themselves, but rather how the databases are built that tell the routers what label to use for a given FEC. Think routing protocols, only in the context of MPLS.
Label Binding Protocols
- Tag Distribution Protocol (TDP) – Cisco proprietary, available starting with 11.1CT, plus 12.0 and later.
- Label Distribution Protocol (LDP) – IETF standard, available in 12.2T. This is what Cisco is going to standardize on, according to some cisco.com MPLS articles I’ve read.
- TDP & LDP work the same, and can be used at the same time.
- Basic IOS interface commands for unicast IP packets and related protocols:
- tag-switching ip – begin MPLS packet labeling; run TDP on the specific interface.
- mpls ip – begin mpls labeling on the interface; TDP will be run by default.
- mpls label-distribution [ ldp | tdp | both] – define a specific label distribution protocol on a specific interface.
- “debug mpls” replaced “debug tag” on IOS’s that support LDP.
LDP/TDP Session Establishment
- Starting MPLS on a router interface causes the Label Information Base to be created, and the TDP/LDP process to start.
- The router will attempt to discover other LSRs through TDP hello packets. The hello packets are sent as broadcast or multicast UDP packets. (Use “debug tag tdp transport” to debug the hello process.)
- A TDP hello received on an interface not configured for MPLS results in an ignored Hello.
- When the hello process discovers a neighbor, a session will be established.
- TDP = TCP/711
- LDP = TCP/646
- The TDP session will be maintained with keepalive packets.
- Use “show tag-switching tdp neighbor” to monitor the status of TDP neighbor adjacencies.
- The TDP router ID is determined the same way BGP and OSP identifiers are determined, i.e. the highest IP of a loopback interface, or standard IP interface if no loopback interface exists. This can be overridden with “tag tdp router-id”.
- The IP address used as the TDP router ID must be reachable, or adjacencies will not form.
Before you read any further, I recommend that you go and read this MPLS FAQ on Cisco’s site. I just read it, and it cleared a couple of cobwebs away. It’s short and written a bit better than much of Cisco’s inscrutable documentation. And it will help make sense out of some of what’s coming next.
Label Binding and Distribution
- When the Label Information Base is created, a label is assigned to every FEC the router knows about. In the context of frame-mode, that means every IP prefix in the routing tables corresponds to a FEC, which in turn gets a label. The mapping between the label and the FEC is stored in the LIB. With one exception: BGP routes are not assigned labels. BGP and MPLS will be discussed in a later post.
- The LIB is synchronized with the IP routing table. A new prefix in the IP routing table means that there will be a new label and binding in the LIB.
- “debug tag tdp bindings” will display bindings as they happen.
- This paradigm of how labels are assigned and then distributed have some industry terminology assigned:
- Independent control – an LSR will assign a label to a FEC independently of anyone else.
- Unsolicited downstream – a downstream LSR will distribute his labels to upstream LSRs whether they asked for it or not. The intention is for upstream LSRs who are forwarding labels for a particular FEC to assign the appropriate label as intended by the downstream router.
- Label bindings are advertised to TDP neighbors immediately.
- An MPLS router will advertise to his TDP neighbors about a binding whether the TDP neighbor is upstream or downstream. Now, remember that in MPLS, traffic only travels from upstream routers towards downstream routers. So, in theory, an MPLS router doesn’t need to tell his downstream neighbors about a specific binding. A router that receives mappings it may not actually use, but keeps them around anyway is exercising “liberal retention mode”. This is the opposite of “conservative retention mode”, where the label switch router will only keep the labels assigned to a prefix by a current downstream neighbor.
- Cisco IOS LSRs always use unsolicited distribution – not on-demand, independent control – not ordered, and liberal retention – not conservative. This allows an IOS LSR to be compatible with pretty much any other platform, even if their defaults are different.
- “show tag-switching tdp bindings” will display all label mappings generated locally or learned from neighbors.
- The label binding from the next-hop router is entered into the FIB. However, if the label-binding isn’t received from the next-hop router, then the FIB entry for that prefix will instruct the router to forward the packets unlabeled. Same is true for the LFIB.