152 LABEL DISTRIBUTION PROTOCOLS
session parameters such as protocol version, label distribution method, timer values, range of VPIVCI values for ATM, and range of DLCI values for frame relay.
An LSR maintains a timer for each hello adjacency, which it restarts each time it receives a hello message. If the timer expires without having received a hello message
from the peer LSR, the hello adjacency is deleted. The LDP session is terminated, if all hello adjacencies associated with an LDP session are deleted.
An LSR maintains a keepAlive timer for each session. The timer is reset each time it receives any LSP PDU from its LDP peer. If the LDP peer has nothing to send, it sends
a keepAlive message.
7.1.2 The LDP PDU Format
An LDP PDU consists of an LDP header followed by one or more LDP messages which might not be related to each other. The LDP PDU format is shown in Figure 7.2. The
LDP header consists of the fields:
• Version
: A 16-bit field that contains the protocol version. •
PDU length : A 16-bit field that gives the total length of the LDP PDU in bytes, excluding
the version and PDU length fields of the LDP PDU header. •
LDP id : A 48-bit field that contain the LDP id that is, the label space id which has
the form 32-bit router id, label space number. The LDP message format consists of a header followed by mandatory and optional
parameters. The header and the parameters are all encoded using the type-length-value TLV
scheme shown in Figure 7.3. The following fields have been defined:
LDP header LDP message 1
LDP message N
• •
•
Figure 7.2 The LDP PDU format.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
U F Type
Length Value
• •
•
Figure 7.3 The TLV format.
THE LABEL DISTRIBUTION PROTOCOL LDP 153
• U Unknown TLV bit
: Used when an unknown TLV is received. If U = 0, then a notification is returned to the message originator and the entire message is ignored. If
U = 1, then the TLV is silently ignored and the rest of the message is processed as if the TLV did not exist.
• F Forward unknown TLV bit
: This bit applies only when U = 1, and the LDP message containing the unknown TLV has to be forwarded. If F = 0, then the unknown TLV
is not forwarded with the rest of the message. If F = 1, then the unknown TLV is forwarded with the rest of the message.
• Type
: A 14-bit field that describes how the Value field is to be interpreted. •
Length : A 16-bit field that gives the length of the Value field in bytes.
• Value
: Contains information that is interpreted as specified in the Type field. It might contain TLV encoding itself.
7.1.3 The LDP Message Format
The LDP message format is shown in Figure 7.4. The following fields have been defined: •
U Unknown message bit : Upon receipt of an unknown message, if U = 0, then a
notification is returned to the message originator. If U = 1, then the unknown message is silently ignored.
• Message type
: A 15-bit field that is used to identify the type of message. •
Message length : A 16-bit field that gives the total length in bytes of the message ID
field and the mandatory and optional parameters fields. •
Message ID : A 32-bit value used to identify this message. Subsequent messages related
to this one have to carry the same message ID. The mandatory fields will be discussed separately for each individual LDP message.
7.1.4 The LDP Messages
The following LDP messages have been defined: notification, hello, initialization, keepAlive, address, address withdraw, label mapping, label request, label abort request, label withdraw
, and label release.
Notification message This message is used to inform an LDP peer of a fatal error, or to provide advisory
information regarding the outcome of processing an LDP message or the state of an LDP
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
U Message type
Message length Message id
Mandatory parameters Optional parameters
Figure 7.4 The LDP message format.
154 LABEL DISTRIBUTION PROTOCOLS
session. Some of the notification messages are: •
Malformed PDU or message •
Unknown or malformed TLV •
Session keepAlive timer expiration •
Unilateral session shutdown •
Initialization message events •
Events resulting from other errors Hello message
LDP hello messages are exchanged as part of the LDP discovery mechanism. The format of the hello message is shown in Figure 7.4, with the U bit set to 0, and the message type
set to hello 0x0100. The mandatory parameters field, referred to as the common hello parameters TLV
, is shown in Figure 7.5. The following fields have been defined for the common hello parameters TLV:
• Hold time
: Specifies the hello hold time in seconds. This is the time that the sending LSR will maintain its record of hellos from the receiving LSR without receipt of another
hello. If hold time = 0, then the default value – 15 sec for link hellos or 45 sec for targeted hellos – is used. A value of 0xffff means infinite. The hold timer is reset each
time a hello message is received. If it expires before a hello message is received, then the hello adjacency is deleted.
• T
: Specifies the hello type: a targeted hello T = 1 or a link hello T = 0. •
R : This field is known as the request send targeted hellos. A value of 1 indicates that
the receiver is requested to send periodic targeted hellos to the source of this hello. A value of 0 makes no such request.
Initialization message This message is used to request the establishment of an LDP session. The format of the
initialization message is shown in Figure 7.4, with the U bit set to 0, and the message type set to initialization 0x0200. The format for the mandatory parameters field, referred
to as the common session parameters TLV, is shown in Figure 7.6. The following fields have been defined:
• KeepAlive time
: Indicates the maximum number of seconds that can elapse between the receipt of two successive LDP PDUs. The keepAlive timer is reset each time an LDP
PDU is received. •
A : Indicates the type of label advertisement: downstream unsolicited A = 0 or down-
stream on demand A = 1. Downstream on demand is used only for an ATM or a frame relay link. Otherwise, downstream unsolicited must be used.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
0 0 Common hello parms
Hold time T R
Reserved Length
Figure 7.5 Common hello parameters TLV.