LDP Specification
Extracted elements (30)
LDP uses TCP for Session, Advertisement, and Notification messages because correct operation requires reliable and in-order message delivery. Only the Discovery mechanism uses UDP, as Hello loss is tolerable.
MD5 was retained for the TCP signature option despite known collision vulnerabilities because the option was already deployed operationally and no algorithm-type field was defined in the original spec; the type field was omitted to avoid wasting scarce TCP option space.
The active/passive role in TCP connection establishment is determined by comparing transport addresses as unsigned integers (higher address is active). This deterministic rule ensures both LSRs agree on who initiates when multiple Hello adjacencies share the same label space.
The TLV U-bit and F-bit mechanism was designed to allow future TLVs to be deployed in networks with older implementations: U=1 permits silent ignore, and U=1 with F=1 allows opaque forwarding through non-understanding nodes, enabling incremental capability introduction.
Loop Detection MUST be enabled in ALL LSRs within an MPLS domain to function correctly; partial deployment may result in either undetected loops or falsely detected loops, making it an all-or-nothing domain-wide configuration.
Multiple FEC Elements per FEC TLV are permitted only in Label Mapping messages in this version of LDP; their use in Label Request, Label Withdraw, and other messages is explicitly not permitted and reserved for future specification.
An LSR MUST advertise the same transport address in all Hellos that advertise the same label space, ensuring consistent active/passive role determination across multiple Hello adjacencies using the same label spaces.
An LSR MUST throttle session setup retry attempts with exponential backoff when Initialization messages are NAK'd; the first retry MUST be delayed no less than 15 seconds and subsequent delays MUST grow to a maximum of no less than 2 minutes.
An LSR using the MD5 Signature Option MUST ignore LDP Hellos from any LSR for which a password has not been configured, ensuring LDP TCP connections are established only with explicitly configured peers.
During session establishment, if any message other than those permitted by the initialization procedures is received, a Shutdown message MUST be transmitted and the transport connection MUST be closed.
If an LSR encounters a FEC Element with an unsupported Address Family or unknown type during decoding, it SHOULD stop decoding the FEC TLV, abort processing the message, and send an 'Unsupported Address Family' or 'Unknown FEC' Notification to its LDP peer.
In Ordered Label Distribution Control, an LSR MUST wait until a label mapping is received from a downstream LSR before advertising a label mapping for a FEC to upstream LSRs, unless the LSR is the egress for that FEC.
Support for the TCP MD5 Signature Option (RFC 2385) to protect LDP TCP session connections against spoofed segment injection MUST be supported as a configurable option on every LDP implementation.
Upon receipt of an unknown TLV with U-bit clear (=0), a notification MUST be returned and the entire message MUST be ignored. If U-bit is set (=1), the unknown TLV MUST be silently ignored and processing continues; if F-bit is also set, the TLV is forwarded opaquely.
When Loop Detection is enabled and an LSR detects a loop (Path Vector contains its LSR Id, or Hop Count exceeds maximum), it MUST send a Loop Detected Notification to the source of the Label Request and drop the message.
LDP messages are transmitted in cleartext, allowing an eavesdropper to determine which routers are MPLS-enabled, what FEC-label bindings are in use, the network topology, and traffic-engineering configurations. LDP provides no confidentiality protection.
LDP defines four message categories: Discovery (Hello, via UDP), Session (Initialization, KeepAlive), Advertisement (Label Mapping, Request, Withdraw, Release, Abort Request), and Notification. All except Discovery use TCP for reliable in-order delivery.
LDP Discovery has two variants: Basic Discovery sends Link Hellos periodically via UDP multicast to the 'all routers on this subnet' group at the well-known LDP port; Extended Discovery sends Targeted Hellos via UDP unicast to a specific address for non-directly-connected LSRs. Extended Discovery is asymmetric: the targeted LSR chooses whether to respond.
LDP Identifier is 6 octets: first 4 octets are a globally unique LSR identifier (typically the 32-bit router ID also used in Loop Detection Path Vectors); last 2 octets identify the label space within the LSR, both zero for platform-wide label space.
Loop Detection uses Path Vector TLVs (list of LSR IDs the message traversed, identified by the first 4 octets of LDP Identifier) and Hop Count TLVs (counter of LSRs traversed, 0 means unknown) carried in Label Request and Label Mapping messages. Loop Detection is a configurable option.
This document establishes five IANA LDP name spaces: Message Type (14-bit, with vendor-private range 0x3E00-0x3EFF and experimental range 0x3F00-0x3FFF), TLV Type (14-bit, similarly partitioned), FEC Type, Status Code, and Experiment ID Name Space.
An attacker can cause denial-of-service by disrupting LDP TCP connections (causing session teardown, loss of all learned label mappings, and traffic black-holing) or by exhausting label resources via excessive label requests. The MD5 Signature Option mitigates TCP-based attacks.
LDP sessions are vulnerable to TCP segment spoofing, particularly TCP resets. The TCP MD5 Signature Option (RFC 2385) is specified as the protection mechanism; an attacker must both guess TCP sequence numbers and obtain the shared password to succeed.
LDP session initialization defines five states: NON EXISTENT → INITIALIZED (TCP connection established) → OPENSENT (active role, Init sent) or OPENREC (passive role, acceptable Init received) → OPERATIONAL (KeepAlive received). Any unexpected message or timeout from any state causes transition to NON EXISTENT with Error Notification and TCP connection close.
ATM Label TLV (type 0x0201) is 4 octets: 2-bit reserved, 2-bit V-bits switching indicator (00=VPI+VCI, 01=VPI only, 10=VCI only), 12-bit VPI, 16-bit VCI. Used on ATM links.
Frame Relay Label TLV (type 0x0202) encodes a DLCI with a 2-bit Len field (0=10-bit DLCI, 2=23-bit DLCI; values 1 and 3 reserved) in a 4-octet field. Used on Frame Relay links.
Generic Label TLV (type 0x0200) encodes a 20-bit label value right-justified in a 4-octet field, used on links where label values are independent of link technology (PPP, Ethernet).
LDP PDU header encodes Version (2 octets, current value 1), PDU Length (2 octets, total length excluding Version and PDU Length fields, maximum negotiable, default 4096 bytes), and LDP Identifier (6 octets identifying the sending LSR's label space).
Prefix FEC Element encodes: 1-octet type (0x02), 2-octet Address Family (from ASSIGNED_AF), 1-octet PreLen (prefix length in bits; 0 matches all addresses), and variable-length Prefix padded to a byte boundary.
TLV encoding uses a 2-octet type field with U-bit (unknown TLV handling), F-bit (forward unknown TLV), and 14-bit Type, followed by a 2-octet Length field and variable-length Value. TLVs may be nested; no alignment requirement.