Skip to main content

A.2. Common Label Distribution Procedures

This section specifies utility procedures used by the algorithms that handle label distribution events.

A.2.1. Send_Label​

Summary:

The Send_Label procedure allocates a label for a FEC for an LDP peer, if possible, and sends a label mapping for the FEC to the peer. If the LSR is unable to allocate the label and if it has a pending label request from the peer, it sends the LDP peer a No Label Resources notification.

Parameters:

  • Peer. The LDP peer to which the label mapping is to be sent.

  • FEC. The FEC for which a label mapping is to be sent.

  • Attributes. Attributes to be included with the label mapping.

Additional Context:

  • LSR. The LSR executing the procedure.

  • Label. The label allocated and sent to Peer.

Algorithm:

SL.1 Does LSR have a label to allocate? If not, goto SL.9.

SL.2 Allocate Label and bind it to the FEC.

SL.3 Install Label for forwarding/switching use.

SL.4 Execute procedure Send_Message (Peer, Label Mapping, FEC, Label, Attributes).

SL.5 Record label mapping for FEC with Label and Attributes has been sent to Peer.

SL.6 Does LSR have a record of a FEC label request from Peer marked as pending? If not, goto SL.8.

SL.7 Delete record of pending label request for FEC from Peer.

SL.8 Return success.

SL.9 Does LSR have a label request for FEC from Peer marked as pending? If not, goto SL.13.

SL.10 Execute procedure Send_Notification (Peer, No Label Resources).

SL.11 Delete record of pending label request for FEC from Peer.

SL.12 Record No Label Resources notification has been sent to Peer. Goto SL.14.

SL.13 Record label mapping needed for FEC and Attributes for Peer, but no-label-resources. (See Note 1.)

SL.14 Return failure.

Note:

  1. SL.13 handles the case of Downstream Unsolicited label distribution when the LSR is unable to allocate a label for a FEC to send to a Peer.

A.2.2. Send_Label_Request​

Summary:

An LSR uses the Send_Label_Request procedure to send a request for a label for a FEC to an LDP peer if currently permitted to do so.

Parameters:

  • Peer. The LDP peer to which the label request is to be sent.

  • FEC. The FEC for which a label request is to be sent.

  • Attributes. Attributes to be included in the label request, e.g., Hop Count, Path Vector.

Additional Context:

  • LSR. The LSR executing the procedure.

Algorithm:

SLRq.1 Has a label request for FEC previously been sent to Peer and is it marked as outstanding? If so, Return success. (See Note 1.)

SLRq.2 Is status record indicating it is OK to send label requests to Peer set? If not, goto SLRq.6

SLRq.3 Execute procedure Send_Message (Peer, Label Request, FEC, Attributes).

SLRq.4 Record that label request for FEC has been sent to Peer and mark it as outstanding.

SLRq.5 Return success.

SLRq.6 Postpone the label request by recording that label mapping for FEC and Attributes from Peer is needed but that no label resources are available.

SLRq.7 Return failure.

Note:

  1. If the LSR is a non-merging LSR, it must distinguish between attempts to send label requests for a FEC triggered by different upstream LDP peers from duplicate requests. This procedure will not send a duplicate label request.

A.2.3. Send_Label_Withdraw​

Summary:

An LSR uses the Send_Label_Withdraw procedure to withdraw a label for a FEC from an LDP peer. To do this, the LSR sends a Label Withdraw message to the peer.

Parameters:

  • Peer. The LDP peer to which the label withdraw is to be sent.

  • FEC. The FEC for which a label is being withdrawn.

  • Label. The label being withdrawn.

Additional Context:

  • LSR. The LSR executing the procedure.

Algorithm:

SWd.1 Execute procedure Send_Message (Peer, Label Withdraw, FEC, Label).

SWd.2 Record that label withdraw for FEC has been sent to Peer and mark it as outstanding.

A.2.4. Send_Notification​

Summary:

An LSR uses the Send_Notification procedure to send an LDP peer a Notification message.

Parameters:

  • Peer. The LDP peer to which the Notification message is to be sent.

  • Status. Status code to be included in the Notification message.

Additional Context:

None.

Algorithm:

SNt.1 Execute procedure Send_Message (Peer, Notification, Status)

A.2.5. Send_Message​

Summary:

An LSR uses the Send_Message procedure to send an LDP peer an LDP message.

Parameters:

  • Peer. The LDP peer to which the message is to be sent.

  • Message Type. The type of message to be sent.

  • Additional message contents . . . .

Additional Context:

None.

Algorithm:

This procedure is the means by which an LSR sends an LDP message of the specified type to the specified LDP peer.

A.2.6. Check_Received_Attributes​

Summary:

Check the attributes received in a Label Mapping or Label Request message. If the attributes include a Hop Count or Path Vector, perform a Loop Detection check. If a loop is detected, cause a Loop Detected Notification message to be sent to MsgSource.

Parameters:

  • MsgSource. The LDP peer that sent the message.

  • MsgType. The type of message received.

  • RAttributes. The attributes in the message.

Additional Context:

  • LSR Id. The unique LSR Id of this LSR.

  • Hop Count. The Hop Count, if any, in the received attributes.

  • Path Vector. The Path Vector, if any, in the received attributes.

Algorithm:

CRa.1 Do RAttributes include Hop Count? If not, goto CRa.5.

CRa.2 Does Hop Count exceed Max allowable hop count? If so, goto CRa.6.

CRa.3 Do RAttributes include Path Vector? If not, goto CRa.5.

CRa.4 Does Path Vector include LSR Id? OR Does length of Path Vector exceed Max allowable length? If so, goto CRa.6

CRa.5 Return No Loop Detected.

CRa.6 Is MsgType LabelMapping? If so, goto CRa.8. (See Note 1.)

CRa.7 Execute procedure Send_Notification (MsgSource, Loop Detected).

CRa.8 Return Loop Detected.

CRa.9 DONE.

Note:

  1. When the attributes being checked were received in a Label Mapping message, the LSR sends the Loop Detected notification in a Status Code TLV in a Label Release message. (See Section "Receive Label Mapping".)

A.2.7. Prepare_Label_Request_Attributes​

Summary:

This procedure is used whenever a Label Request is to be sent to a Peer to compute the Hop Count and Path Vector, if any, to include in the message.

Parameters:

  • Peer. The LDP peer to which the message is to be sent.

  • FEC. The FEC for which a label request is to be sent.

  • RAttributes. The attributes this LSR associates with the LSP for FEC.

  • SAttributes. The attributes to be included in the Label Request message.

Additional Context:

  • LSR Id. The unique LSR Id of this LSR.

Algorithm:

PRqA.1 Is Hop Count required for this Peer? (See Note 1.) OR Do RAttributes include a Hop Count? OR Is Loop Detection configured on LSR? If not, goto PRqA.14.

PRqA.2 Is LSR ingress for FEC? If not, goto PRqA.6.

PRqA.3 Include Hop Count of 1 in SAttributes.

PRqA.4 Is Loop Detection configured on LSR? If not, goto PRqA.14.

PRqA.5 Is LSR merge-capable? If so, goto PRqA.14. If not, goto PRqA.13.

PRqA.6 Do RAttributes include a Hop Count? If not, goto PRqA.8.

PRqA.7 Increment RAttributes Hop Count and copy the resulting Hop Count to SAttributes. (See Note 2.) Goto PRqA.9.

PRqA.8 Include Hop Count of unknown (0) in SAttributes.

PRqA.9 Is Loop Detection configured on LSR? If not, goto PRqA.14.

PRqA.10 Do RAttributes have a Path Vector? If so, goto PRqA.12.

PRqA.11 Is LSR merge-capable? If so, goto PRqA.14. If not, goto PRqA.13.

PRqA.12 Add LSR Id to beginning of Path Vector from RAttributes and copy the resulting Path Vector into SAttributes. Goto PRqA.14.

PRqA.13 Include Path Vector of length 1 containing LSR Id in SAttributes.

PRqA.14 DONE.

Notes:

  1. The link with Peer may require that Hop Count be included in Label Request messages; for example, see [RFC3035] and [RFC3034].

  2. For hop count arithmetic, unknown + 1 = unknown.

A.2.8. Prepare_Label_Mapping_Attributes​

Summary:

This procedure is used whenever a Label Mapping is to be sent to a Peer to compute the Hop Count and Path Vector, if any, to include in the message.

Parameters:

  • Peer. The LDP peer to which the message is to be sent.

  • FEC. The FEC for which a label request is to be sent.

  • RAttributes. The attributes this LSR associates with the LSP for FEC.

  • SAttributes. The attributes to be included in the Label Mapping message.

  • IsPropagating. The LSR is sending the Label Mapping message to propagate one received from the FEC next hop.

  • PrevHopCount. The Hop Count, if any, this LSR associates with the LSP for the FEC.

Additional Context:

  • LSR Id. The unique LSR Id of this LSR.

Algorithm:

PMpA.1 Do the RAttributes include any unknown TLVs? If not, goto PMpA.4.

PMpA.2 Do the settings of the U- and F-bits require forwarding of these TLVs? If not, goto PMpA.4.

PMpA.3 Copy the unknown TLVs in SAttributes.

PMpA.4 Is Hop Count required for this Peer? (see Note 1.) OR Do RAttributes include a Hop Count? OR Is Loop Detection configured on LSR? If not, goto PMpA.24.

PMpA.5 Is LSR egress for FEC? If not, goto PMpA.7.

PMpA.6 Include Hop Count of 1 in SAttributes. Goto PMpA.24.

PMpA.7 Do RAttributes have a Hop Count? If not, goto PMpA.11.

PMpA.8 Is LSR a member of the edge set for an LSR domain whose LSRs do not perform TTL decrement AND Is Peer in that domain? (See Note 2.) If not, goto PMpA.10.

PMpA.9 Include Hop Count of 1 in SAttributes. Goto PMpA.12.

PMpA.10 Increment RAttributes Hop Count and copy the resulting Hop Count to SAttributes. (See Note 2.) Goto PMpA.12.

PMpA.11 Include Hop Count of unknown (0) in SAttributes.

PMpA.12 Is Loop Detection configured on LSR? If not, goto PMpA.24.

PMpA.13 Do RAttributes have a Path Vector? If so, goto PMpA.22.

PMpA.14 Is LSR propagating a received Label Mapping? If not, goto PMpA.23.

PMpA.15 Does LSR support merging? If not, goto PMpA.17.

PMpA.16 Has LSR previously sent a Label Mapping for FEC to Peer? If not, goto PMpA.23.

PMpA.17 Do RAttributes include a Hop Count? If not, goto PMpA.24.

PMpA.18 Is Hop Count in RAttributes unknown(0)? If so, goto PMpA.23.

PMpA.19 Has LSR previously sent a Label Mapping for FEC to Peer? If not, goto PMpA.24.

PMpA.20 Is Hop Count in RAttributes different from PrevHopCount? If not, goto PMpA.24.

PMpA.21 Is the Hop Count in RAttributes > PrevHopCount? OR Is PrevHopCount unknown(0)? If not, goto PMpA.24.

PMpA.22 Add LSR Id to beginning of Path Vector from RAttributes and copy the resulting Path Vector into SAttributes. Goto PMpA.24.

PMpA.23 Include Path Vector of length 1 containing LSR Id in SAttributes.

PMpA.24 DONE.

Notes:

  1. The link with Peer may require that Hop Count be included in Label Mapping messages; for example, see [RFC3035] and [RFC3034].

  2. If the LSR is at the edge of a cloud of LSRs that do not perform TTL-decrement and it is propagating the Label Mapping message upstream into the cloud, it sets the Hop Count to 1 so that Hop Count across the cloud is calculated properly. This ensures proper TTL management for packets forwarded across the part of the LSP that passes through the cloud.

  3. For hop count arithmetic, unknown + 1 = unknown.