Network Working Group Loa Andersson Internet Draft Ina Minei Expiration Date: March 2005 Bob Thomas Editors September 2004 LDP Specification draft-ietf-mpls-rfc3036bis-00.txt Status of this Memo By submitting this Internet-Draft, we certify that any applicable patent or other IPR claims of which we are aware have been disclosed, or will be disclosed, and any of which we become aware will be disclosed, in accordance with RFC 3668. This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. How to read this document This section will be removed prior to publication. This document is produced as part of advancing the LDP specification to draft standard status. This document contains the original text of RFC3036, with a few changes that are the result of the experience gained with the protocol. Andersson, et al. [Page 1] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 Sections that changed from RFC3036 are marked ### in the body of this document, to facilitate the review process. The marking will be removed prior to publication. A list of changes from RFC 3036 is also included. This list will remain in the final version of the document, but will move towards the end of the document. Source of this document ### This document is produced as part of advancing the LDP specification to draft standard status. The LDP specification was originally published as RFC 3036 in January 2001. It was produced by the MPLS working of the IETF and was jointly authored by Loa Andersson, Paul Doolan, Nancy Feldman, Andre Fredette and Bob Thomas. ### Changes from RFC3036 ### Here is a list of changes from RFC3036 1. Split the reference list into normative and non-normative references 2. Removed "MPLS using ATM VP Switching" from the list of normative references. 3. Clarified the use of the F bit. 4. Added option to allow split horizon when doing ordered control. 5. Clarified the processing of messages with the U-bit set during the session initialization procedures 6. Clarified the processing of the E-bit during session initialization procedures. 7. Added case for TLV length too short in the specification for handling malformed TLVs. 8. Clarified the use of the Wildcard FEC in label request messages. 9. In the section describing handling of unknown TLV, removed reference to inexistent section (errata in original document) 10. In the "receive label request" procedures, if a loop is detected, changed the procedure to send a notification before aborting the rest of the processing. Andersson, et al. [Page 2] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 11. In "receive label release" procedures, clarified the behavior for merge-capable LSRs. 12. In "receive label release" procedures, clarified the behavior for receipt of an unknown FEC. 13. In note 4 of "Detect Change in FEC Next Hop", modified the text to reference the correct set of conditions for sending a label request procedure (typo in the original document) 14. In the procedures for "LSR decides to no longer label switch a FEC", clarified the fact that the label must not be reused until a label release is received. 15. In the routine "Prepare_Label_Mapping_Attributes" added a note regarding the treatment of unknown TLVs according to their U and F bits. 16. In the address message processing procedures, clarified the behavior for the case where an LSR receives re-advertisement of an address previously advertised it, or withdrawal of an address from an LSR that has not previously advertised that address. 17. In the routine "Receive Label Mapping" clarified the meaning of PrevAdvLabel when no label advertisement message has been sent previously. 18. In the "receive label mapping" procedures, if a loop is detected, modified the procedure to send a notification before aborting the rest of the processing. 19. In the "receive label mapping" procedures, corrected step LMp.10 to handle label mapping messages for additional (non- merged) LSPs for the FEC. 20. In the "receive label mapping" procedures, removed unnecessary checks in step LMp.29. 21. In the routine "Receive Label Abort Request" clarified the behavior for non-merging LSRs. 22. Added the following items to the section discussing areas for future study: o extensions for communicating the maximum transmission unit o basic peer discovery on NBMA media o option of shutting down an adjacency o mechanisms for securing Hello messages o detection of a stateless fast control plane restart o o support of "end of LIB" message o mechanisms for dealing with the case where different LSRs advertise the same address. #### Andersson, et al. [Page 3] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 Abstract The architecture for Multi Protocol Label Switching (MPLS) is described in RFC 3031. A fundamental concept in MPLS is that two Label Switching Routers (LSRs) must agree on the meaning of the labels used to forward traffic between and through them. This common understanding is achieved by using a set of procedures, called a label distribution protocol, by which one LSR informs another of label bindings it has made. This document defines a set of such procedures called LDP (for Label Distribution Protocol) by which LSRs distribute labels to support MPLS forwarding along normally routed paths. Andersson, et al. [Page 4] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 Table of Contents How to read this document ............................. 1 Source of this document ............................... 2 Changes from RFC3036 .................................. 2 1 LDP Overview .......................................... 9 1.1 LDP Peers ............................................. 10 1.2 LDP Message Exchange .................................. 10 1.3 LDP Message Structure ................................. 11 1.4 LDP Error Handling .................................... 11 1.5 LDP Extensibility and Future Compatibility ............ 11 1.6 Specification Language ................................ 11 2 LDP Operation ......................................... 12 2.1 FECs .................................................. 12 2.2 Label Spaces, Identifiers, Sessions and Transport ..... 13 2.2.1 Label Spaces .......................................... 13 2.2.2 LDP Identifiers ....................................... 14 2.2.3 LDP Sessions .......................................... 14 2.2.4 LDP Transport ......................................... 15 2.3 LDP Sessions between non-Directly Connected LSRs ...... 15 2.4 LDP Discovery ......................................... 15 2.4.1 Basic Discovery Mechanism ............................. 16 2.4.2 Extended Discovery Mechanism .......................... 16 2.5 Establishing and Maintaining LDP Sessions ............ 17 2.5.1 LDP Session Establishment ............................. 17 2.5.2 Transport Connection Establishment .................... 17 2.5.3 Session Initialization ................................ 19 2.5.4 Initialization State Machine .......................... 21 2.5.5 Maintaining Hello Adjacencies ......................... 24 2.5.6 Maintaining LDP Sessions .............................. 24 2.6 Label Distribution and Management ..................... 25 2.6.1 Label Distribution Control Mode ....................... 25 2.6.1.1 Independent Label Distribution Control ................ 25 2.6.1.2 Ordered Label Distribution Control .................... 25 2.6.2 Label Retention Mode .................................. 26 2.6.2.1 Conservative Label Retention Mode ..................... 26 2.6.2.2 Liberal Label Retention Mode .......................... 27 2.6.3 Label Advertisement Mode .............................. 27 2.7 LDP Identifiers and Next Hop Addresses ................ 27 2.8 Loop Detection ........................................ 28 2.8.1 Label Request Message ................................. 29 2.8.2 Label Mapping Message ................................. 30 2.8.3 Discussion ............................................ 32 2.9 Authenticity and Integrity of LDP Messages ............ 32 2.9.1 TCP MD5 Signature Option .............................. 33 2.9.2 LDP Use of TCP MD5 Signature Option ................... 34 2.10 Label Distribution for Explicitly Routed LSPs ......... 35 3 Protocol Specification ................................ 35 Andersson, et al. [Page 5] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 3.1 LDP PDUs .............................................. 35 3.2 LDP Procedures ........................................ 36 3.3 Type-Length-Value Encoding ............................ 37 3.4 TLV Encodings for Commonly Used Parameters ............ 39 3.4.1 FEC TLV ............................................... 39 3.4.1.1 FEC Procedures ........................................ 42 3.4.2 Label TLVs ............................................ 42 3.4.2.1 Generic Label TLV ..................................... 42 3.4.2.2 ATM Label TLV ......................................... 43 3.4.2.3 Frame Relay Label TLV ................................. 43 3.4.3 Address List TLV ...................................... 44 3.4.4 Hop Count TLV ......................................... 45 3.4.4.1 Hop Count Procedures .................................. 45 3.4.5 Path Vector TLV ....................................... 47 3.4.5.1 Path Vector Procedures ................................ 47 3.4.5.1.1 Label Request Path Vector ............................. 47 3.4.5.1.2 Label Mapping Path Vector ............................. 49 3.4.6 Status TLV ............................................ 50 3.5 LDP Messages .......................................... 52 3.5.1 Notification Message .................................. 54 3.5.1.1 Notification Message Procedures ....................... 55 3.5.1.2 Events Signaled by Notification Messages .............. 56 3.5.1.2.1 Malformed PDU or Message .............................. 56 3.5.1.2.2 Unknown or Malformed TLV .............................. 58 3.5.1.2.3 Session KeepAlive Timer Expiration .................... 59 3.5.1.2.4 Unilateral Session Shutdown ........................... 60 3.5.1.2.5 Initialization Message Events ......................... 60 3.5.1.2.6 Events Resulting From Other Messages .................. 60 3.5.1.2.7 Internal Errors ....................................... 60 3.5.1.2.8 Miscellaneous Events .................................. 60 3.5.2 Hello Message ......................................... 60 3.5.2.1 Hello Message Procedures .............................. 63 3.5.3 Initialization Message ................................ 64 3.5.3.1 Initialization Message Procedures ..................... 72 3.5.4 KeepAlive Message ..................................... 72 3.5.4.1 KeepAlive Message Procedures .......................... 73 3.5.5 Address Message ....................................... 73 3.5.5.1 Address Message Procedures ............................ 74 3.5.6 Address Withdraw Message .............................. 74 3.5.6.1 Address Withdraw Message Procedures ................... 75 3.5.7 Label Mapping Message ................................. 75 3.5.7.1 Label Mapping Message Procedures ...................... 77 3.5.7.1.1 Independent Control Mapping ........................... 77 3.5.7.1.2 Ordered Control Mapping ............................... 78 3.5.7.1.3 Downstream on Demand Label Advertisement .............. 78 3.5.7.1.4 Downstream Unsolicited Label Advertisement ............ 80 3.5.8 Label Request Message ................................. 80 3.5.8.1 Label Request Message Procedures ...................... 81 Andersson, et al. [Page 6] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 3.5.9 Label Abort Request Message ........................... 84 3.5.9.1 Label Abort Request Message Procedures ................ 85 3.5.10 Label Withdraw Message ................................ 86 3.5.10.1 Label Withdraw Message Procedures ..................... 87 3.5.11 Label Release Message ................................. 89 3.5.11.1 Label Release Message Procedures ...................... 90 3.6 Messages and TLVs for Extensibility ................... 91 3.6.1 LDP Vendor-private Extensions ......................... 91 3.6.1.1 LDP Vendor-private TLVs ............................... 91 3.6.1.2 LDP Vendor-private Messages ........................... 94 3.6.2 LDP Experimental Extensions ........................... 95 3.7 Message Summary ....................................... 95 3.8 TLV Summary ........................................... 96 3.9 Status Code Summary ................................... 97 3.10 Well-known Numbers .................................... 99 3.10.1 UDP and TCP Ports ..................................... 99 3.10.2 Implicit NULL Label ................................... 99 4 IANA Considerations ................................... 99 4.1 Message Type Name Space ............................... 99 4.2 TLV Type Name Space ................................... 101 4.3 FEC Type Name Space ................................... 101 4.4 Status Code Name Space ................................ 102 4.5 Experiment ID Name Space .............................. 102 5 Security Considerations ............................... 102 5.1 Spoofing .............................................. 102 5.2 Privacy ............................................... 104 5.3 Denial of Service ..................................... 104 6 Areas for Future Study ................................ 106 7 Acknowledgments ....................................... 107 8 References ............................................ 108 8.1 Normative references .................................. 108 8.2 Non-normative references .............................. 109 9 Intellectual Property Statement ....................... 111 10 Editors' Addresses .................................... 111 Appendix A LDP Label Distribution Procedures ..................... 113 A.1 Handling Label Distribution Events .................... 115 A.1.1 Receive Label Request ................................. 116 A.1.2 Receive Label Mapping ................................. 120 A.1.3 Receive Label Abort Request ........................... 130 A.1.4 Receive Label Release ................................. 133 A.1.5 Receive Label Withdraw ................................ 135 A.1.6 Recognize New FEC ..................................... 137 A.1.7 Detect Change in FEC Next Hop ......................... 140 A.1.8 Receive Notification / Label Request Aborted .......... 143 A.1.9 Receive Notification / No Label Resources ............. 144 A.1.10 Receive Notification / No Route ....................... 144 A.1.11 Receive Notification / Loop Detected .................. 146 A.1.12 Receive Notification / Label Resources Available ...... 146 Andersson, et al. [Page 7] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 A.1.13 Detect local label resources have become available .... 147 A.1.14 LSR decides to no longer label switch a FEC ........... 148 A.1.15 Timeout of deferred label request ..................... 149 A.2 Common Label Distribution Procedures .................. 150 A.2.1 Send_Label ............................................ 150 A.2.2 Send_Label_Request .................................... 151 A.2.3 Send_Label_Withdraw ................................... 153 A.2.4 Send_Notification ..................................... 154 A.2.5 Send_Message .......................................... 154 A.2.6 Check_Received_Attributes ............................. 155 A.2.7 Prepare_Label_Request_Attributes ...................... 156 A.2.8 Prepare_Label_Mapping_Attributes ...................... 158 Full Copyright Statement .............................. 162 Andersson, et al. [Page 8] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 1. LDP Overview The MPLS architecture [RFC3031] defines a label distribution protocol as a set of procedures by which one Label Switched Router (LSR) informs another of the meaning of labels used to forward traffic between and through them. The MPLS architecture does not assume a single label distribution protocol. In fact, a number of different label distribution proto- cols are being standardized. Existing protocols have been extended so that label distribution can be piggybacked on them. New protocols have also been defined for the explicit purpose of distributing labels. The MPLS architecture discusses some of the considerations when choosing a label distribution protocol for use in particular MPLS applications such as Traffic Engineering [RFC2702]. ### New text to reflect that this document builds on 3036 The Label Distribution Protocol (LDP) is a protocol defined for dis- tributing labels. It was originally published as RFC3036 in January 2001. It was produced by the MPLS working of the IETF and was jointly authored by Loa Andersson, Paul Doolan, Nancy Feldman, Andre Fredette and Bob Thomas. ### LDP is a protocol defined for distributing labels. It is the set of procedures and messages by which Label Switched Routers (LSRs) estab- lish Label Switched Paths (LSPs) through a network by mapping net- work-layer routing information directly to data-link layer switched paths. These LSPs may have an endpoint at a directly attached neigh- bor (comparable to IP hop-by-hop forwarding), or may have an endpoint at a network egress node, enabling switching via all intermediary nodes. LDP associates a Forwarding Equivalence Class (FEC) [RFC3031] with each LSP it creates. The FEC associated with an LSP specifies which packets are "mapped" to that LSP. LSPs are extended through a net- work as each LSR "splices" incoming labels for a FEC to the outgoing label assigned to the next hop for the given FEC. More information about the applicability of LDP can be found in [RFC3037]. This document assumes familiarity with the MPLS architecture [RFC3031]. Note that [RFC3031] includes a glossary of MPLS terminol- ogy, such as ingress, label switched path, etc. Andersson, et al. [Page 9] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 1.1. LDP Peers Two LSRs which use LDP to exchange label/FEC mapping information are known as "LDP Peers" with respect to that information and we speak of there being an "LDP Session" between them. A single LDP session allows each peer to learn the other's label mappings; i.e., the pro- tocol is bi-directional. 1.2. LDP Message Exchange There are four categories of LDP messages: 1. Discovery messages, used to announce and maintain the presence of an LSR in a network. 2. Session messages, used to establish, maintain, and terminate sessions between LDP peers. 3. Advertisement messages, used to create, change, and delete label mappings for FECs. 4. to signal error information. Discovery messages provide a mechanism whereby LSRs indicate their presence in a network by sending a Hello message periodically. This is transmitted as a UDP packet to the LDP port at the `all routers on this subnet' group multicast address. When an LSR chooses to estab- lish a session with another LSR learned via the Hello message, it uses the LDP initialization procedure over TCP transport. Upon suc- cessful completion of the initialization procedure, the two LSRs are LDP peers, and may exchange advertisement messages. When to request a label or advertise a label mapping to a peer is largely a local decision made by an LSR. In general, the LSR requests a label mapping from a neighboring LSR when it needs one, and advertises a label mapping to a neighboring LSR when it wishes the neighbor to use a label. Correct operation of LDP requires reliable and in order delivery of messages. To satisfy these requirements LDP uses the TCP transport for session, advertisement and notification messages; i.e., for everything but the UDP-based discovery mechanism. Andersson, et al. [Page 10] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 1.3. LDP Message Structure All LDP messages have a common structure that uses a Type-Length- Value (TLV) encoding scheme; see Section "Type-Length-Value" encod- ing. The Value part of a TLV-encoded object, or TLV for short, may itself contain one or more TLVs. 1.4. LDP Error Handling LDP errors and other events of interest are signaled to an LDP peer by notification messages. There are two kinds of LDP notification messages: 1. Error notifications, used to signal fatal errors. If an LSR receives an error notification from a peer for an LDP session, it terminates the LDP session by closing the TCP transport con- nection for the session and discarding all label mappings learned via the session. 2. Advisory notifications, used to pass an LSR information about the LDP session or the status of some previous message received from the peer. 1.5. LDP Extensibility and Future Compatibility Functionality may be added to LDP in the future. It is likely that future functionality will utilize new messages and object types (TLVs). It may be desirable to employ such new messages and TLVs within a network using older implementations that do not recognize them. While it is not possible to make every future enhancement backwards compatible, some prior planning can ease the introduction of new capabilities. This specification defines rules for handling unknown message types and unknown TLVs for this purpose. 1.6. Specification Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. Andersson, et al. [Page 11] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 2. LDP Operation 2.1. FECs It is necessary to precisely specify which packets may be mapped to each LSP. This is done by providing a FEC specification for each LSP. The FEC identifies the set of IP packets which may be mapped to that LSP. Each FEC is specified as a set of one or more FEC elements. Each FEC element identifies a set of packets which may be mapped to the corre- sponding LSP. When an LSP is shared by multiple FEC elements, that LSP is terminated at (or before) the node where the FEC elements can no longer share the same path. Following are the currently defined types of FEC elements. New ele- ment types may be added as needed: 1. Address Prefix. This element is an address prefix of any length from 0 to a full address, inclusive. 2. Host Address. This element is a full host address. (We will see below that an Address Prefix FEC element which is a full address has a different effect than a Host Address FEC element which has the same address.) We say that a particular address "matches" a particular address pre- fix if and only if that address begins with that prefix. We also say that a particular packet matches a particular LSP if and only if that LSP has an Address Prefix FEC element which matches the packet's des- tination address. With respect to a particular packet and a particu- lar LSP, we refer to any Address Prefix FEC element which matches the packet as the "matching prefix". The procedure for mapping a particular packet to a particular LSP uses the following rules. Each rule is applied in turn until the packet can be mapped to an LSP. - If there is exactly one LSP which has a Host Address FEC element that is identical to the packet's destination address, then the packet is mapped to that LSP. - If there are multiple LSPs, each containing a Host Address FEC element that is identical to the packet's destination address, then the packet is mapped to one of those LSPs. The procedure for selecting one of those LSPs is beyond the scope of this docu- ment. Andersson, et al. [Page 12] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 - If a packet matches exactly one LSP, the packet is mapped to that LSP. - If a packet matches multiple LSPs, it is mapped to the LSP whose matching prefix is the longest. If there is no one LSP whose matching prefix is longest, the packet is mapped to one from the set of LSPs whose matching prefix is longer than the others. The procedure for selecting one of those LSPs is beyond the scope of this document. - If it is known that a packet must traverse a particular egress router, and there is an LSP which has an Address Prefix FEC ele- ment which is an address of that router, then the packet is mapped to that LSP. The procedure for obtaining this knowledge is beyond the scope of this document. The procedure for determining that a packet must traverse a particu- lar egress router is beyond the scope of this document. (As an exam- ple, if one is running a link state routing algorithm, it may be pos- sible to obtain this information from the link state data base. As another example, if one is running BGP, it may be possible to obtain this information from the BGP next hop attribute of the packet's route.) It is worth pointing out a few consequences of these rules: - A packet may be sent on the LSP whose Address Prefix FEC element is the address of the packet's egress router ONLY if there is no LSP matching the packet's destination address. - A packet may match two LSPs, one with a Host Address FEC element and one with an Address Prefix FEC element. In this case, the packet is always assigned to the former. - A packet which does not match a particular Host Address FEC ele- ment may not be sent on the corresponding LSP, even if the Host Address FEC element identifies the packet's egress router. 2.2. Label Spaces, Identifiers, Sessions and Transport 2.2.1. Label Spaces The notion of "label space" is useful for discussing the assignment and distribution of labels. There are two types of label spaces: Andersson, et al. [Page 13] Internet Draft draft-ietf-mpls-rfc3036bis-00.txt September 2004 - Per interface label space. Interface-specific incoming labels are used for interfaces that use interface resources for labels. An example of such an interface is a label-controlled ATM inter- face that uses VCIs as labels, or a Frame Relay interface that uses DLCIs as labels. Note that the use of a per interface label space only makes sense when the LDP peers are "directly connected" over an interface, and the label is only going to be used for traffic sent over that interface. - Per platform label space. Platform-wide incoming labels are used for interfaces that can share the same labels. 2.2.2. LDP Identifiers An LDP identifier is a six octet quantity used to identify an LSR label space. The first four octets identify the LSR and must be a globally unique value, such as a 32-bit router Id assigned to the LSR. The last two octets identify a specific label space within the LSR. The last two octets of LDP Identifiers for platform-wide label spaces are always both zero. This document uses the following print representation for LDP Identifiers: :