Skip to main content
  1. Network Articles/
  2. MPLS Articles/

LDP Label Distribution Modes and Label Spaces

Table of Contents

LDP Label Distribution Modes and Label Spaces

RFC 5036 defines three pairs of choices for how LDP behaves: when to advertise a label, how much of what is received to keep, and in what order to advertise upstream. Only one of the three is selectable in real implementations; the others are fixed. This article explains the three pairs and the idea of a label space, then confirms what can be confirmed in an IOS XR (XRd) lab. The basics of LDP are covered in What Is LDP.

The three pairs

PairRFC 5036ChoicesWhat changes
Label advertisementSection 2.6.3Downstream Unsolicited / Downstream on DemandWhether a label is sent before being asked for
Label retentionSection 2.6.2liberal / conservativeWhether labels from non-next-hop peers are discarded
Label distribution controlSection 2.6.1independent / orderedWhether a label may go upstream before one arrives from downstream

All three share the same premise: the downstream LSR chooses the label and hands it upstream. In MPLS the receiving side picks the label, so the LSR nearer the destination is the one that says “use this label when you send to me”.

Label advertisement: DU and DoD

Downstream Unsolicited sends one Label Mapping for every prefix it holds as soon as the session comes up, without considering whether the peer will use them. Downstream on Demand waits for a Label Request from upstream and answers with the Label Mapping for that FEC.

DoD exists for environments such as ATM where label resources are scarce. On the Ethernet-based routers of today labels do not run out, so the default is DU.

On IOS XR, session downstream-on-demand with <ACL> under mpls ldp names the peers to use DoD with. Both routers must be configured or the session stays DU.

Label retention: liberal and conservative

LDP receives Label Mappings from every peer it has a session with. Only those from the next hop chosen by the IGP are actually used.

liberal keeps the rest as well. It costs memory, but when routing changes and the next hop swaps, the label it already holds can be used immediately. conservative keeps only the next hop’s and has to ask again when routing changes. It saves resources at the cost of convergence time.

Label distribution control: independent and ordered

independent allows an LSR to advertise its own label upstream before it has received one from downstream. ordered does not advertise upstream until a label has arrived from downstream, the egress LSR being the exception because it is the destination itself.

Ordered means labels are only advertised once the LSP is complete end to end, which avoids traffic entering an LSP that breaks partway. Independent gives up that guarantee in exchange for faster convergence.

What implementations actually let you choose

Only label advertisement is selectable. The other two are fixed per implementation.

ImplementationLabel advertisementLabel retentionLabel distribution control
IOS XRDU / DoD selectableliberal onlyindependent only
IOS XEDU / DoD selectableliberal onlyindependent only
JunosDU / DoD selectableliberal onlyordered only

All three use liberal retention. Label distribution control is the opposite between Cisco and Juniper. Juniper’s documentation states plainly, “Ordered mode is supported, but not Independent mode.”

IOS XE has mpls ldp atm control-mode which accepts ordered and independent, but it applies only to LC-ATM interfaces, not to Ethernet. The RFC offers two choices because it had to cover ATM as well; router implementations have settled on liberal plus independent, or liberal plus ordered.

When control mode differs across a mixed network, the LDP message exchange itself is unchanged. Only the order in which the LSP completes differs.

This lab confirms only label advertisement and label retention. Label distribution control cannot be configured, so it was not observed.

Label spaces

A label space is the scope in which an LSR manages label values (RFC 5036 section 2.2.1).

TypeMeaningWhere it is used
per-platformOne label space for the whole deviceEthernet and anything else with no constraint on label values
per-interfaceA separate label space per interfaceATM VPI/VCI and similar, where the link owns the label resource

Which one is in use shows in the last two octets of the LDP Identifier (section 2.2.2). For per-platform they are always zero, so 3.3.3.3:0 means per-platform.

With per-platform, a packet arriving on any link resolves to the same forwarding entry for the same label value. That is why a single LDP session suffices even with several links to the same peer.

Lab verification

Lab setup

CE1 — PE1 — P1 — P2 — PE2 — CE2 are connected in a line. PE1 / P1 / P2 / PE2 in AS 65001 form the MPLS network, distributing routes with OSPF (area 0) and labels with LDP. PE1 and P1 are joined by two links. CE3 and CE4 are customers in VRF CUST-A.

RouterRoleLo0
CE1Customer side (AS 65101), advertises 192.168.1.0/241.1.1.1/32
PE1Ingress / egress LSR (AS 65001)2.2.2.2/32
P1Transit LSR3.3.3.3/32
P2Transit LSR4.4.4.4/32
PE2Ingress / egress LSR (AS 65001)5.5.5.5/32
CE2Customer side (AS 65102), advertises 192.168.6.0/246.6.6.6/32
CE3Customer side in VRF CUST-A (AS 65107)7.7.7.7/32
CE4Customer side in VRF CUST-A (AS 65108)8.8.8.8/32

Observation centres on P1, which holds LDP sessions with both PE1 and P2 and so suits the retention check.

Verification steps

STEPChangeWhat it shows
0Initial stateThe default is DU. The LDP Identifier ends in :0, so per-platform. Labels from a peer that is not the next hop are kept
1session downstream-on-demand on PE1 onlyOne side alone does not switch to DoD
2The same on P1With both sides configured it becomes DoD and Label Requests flow
3Remove STEP 1 and STEP 2 (final state)The state returns to that of STEP 0

STEP 0: Initial state

The two peers as seen from P1. Both are Downstream-Unsolicited and both LDP Identifiers end in :0.

STEP 0 P1 show mpls ldp neighbor detail (excerpt)
Peer LDP Identifier: 4.4.4.4:0
  TCP connection: 4.4.4.4:39224 - 3.3.3.3:646
  State: Oper; Msgs sent/rcvd: 18/17; Downstream-Unsolicited
Peer LDP Identifier: 2.2.2.2:0
  TCP connection: 2.2.2.2:646 - 3.3.3.3:28568
  State: Oper; Msgs sent/rcvd: 16/18; Downstream-Unsolicited

Retention shows up in the bindings. For P1, 5.5.5.5/32 is PE2’s Loopback0 and the next hop is P2.

STEP 0 P1 show route ospf (excerpt)
O    2.2.2.2/32 [110/2] via 10.2.3.2, 00:05:12, GigabitEthernet0/0/0/0
O    4.4.4.4/32 [110/2] via 10.3.4.4, 00:06:11, GigabitEthernet0/0/0/1
O    5.5.5.5/32 [110/3] via 10.3.4.4, 00:04:01, GigabitEthernet0/0/0/1
O    10.4.5.0/24 [110/2] via 10.3.4.4, 00:06:11, GigabitEthernet0/0/0/1

The next hop for 5.5.5.5/32 is 10.3.4.4, which is P2 and nothing else. Even so, the bindings still hold PE1’s label.

STEP 0 P1 show mpls ldp bindings 5.5.5.5/32
5.5.5.5/32, rev 17
	Local binding: label: 24003
	Remote bindings: (2 peers)
	    Peer                Label    
	    -----------------   ---------
	    2.2.2.2:0           24004   
	    4.4.4.4:0           24004   

Remote bindings: (2 peers) includes 2.2.2.2 (PE1), which is not the next hop. That is liberal retention. Conservative would list only 4.4.4.4.

STEP 1: Configure DoD on PE1 only

An ACL naming the peer was created on PE1 and session downstream-on-demand applied.

STEP 1 configuration on PE1
ipv4 access-list DOD-PEERS
 10 permit ipv4 host 3.3.3.3 any
!
mpls ldp
 session downstream-on-demand with DOD-PEERS

The session is rebuilt when this is applied. The syslog gives the reason as Label advertisement mode changed.

STEP 1 PE1 show logging (excerpt)
RP/0/RP0/CPU0:Sep 11 05:49:10.357 UTC: mpls_ldp[1178]: %ROUTING-LDP-5-NBR_CHANGE : VRF 'default' (0x60000000), Neighbor 3.3.3.3:0 is DOWN (Label advertisement mode changed) 
RP/0/RP0/CPU0:Sep 11 05:49:14.891 UTC: mpls_ldp[1178]: %ROUTING-LDP-5-NBR_CHANGE : VRF 'default' (0x60000000), Neighbor 3.3.3.3:0 is UP (IPv4 connection) 

After the rebuild the mode is unchanged.

STEP 1 PE1 show mpls ldp neighbor detail (excerpt)
Peer LDP Identifier: 3.3.3.3:0
  TCP connection: 3.3.3.3:15840 - 2.2.2.2:646
  Graceful Restart: No
  Session Holdtime: 180 sec
  State: Oper; Msgs sent/rcvd: 15/14; Downstream-Unsolicited
  Up time: 00:03:15

One side alone does not produce DoD. P1 shows the same thing.

STEP 2: Configure P1 as well

With the same configuration on P1, both ends change.

STEP 2 PE1 show mpls ldp neighbor detail (excerpt)
Peer LDP Identifier: 3.3.3.3:0
  TCP connection: 3.3.3.3:22947 - 2.2.2.2:646
  Graceful Restart: No
  Session Holdtime: 180 sec
  State: Oper; Msgs sent/rcvd: 14/14; Downstream-on-Demand
  Up time: 00:04:20

At this point P1 is DoD toward PE1 and DU toward P2. The advertisement mode is per session.

The capture now holds Label Requests, which never appear under DU. Four seconds after the session comes up PE1 sends five Requests and P1 answers with Label Mappings.

STEP 2 PE1 - P1 capture (Hellos filtered out)
19	9.533811000	3.3.3.3	2.2.2.2	Initialization Message 
28	14.245187000	3.3.3.3	2.2.2.2	Initialization Message 
29	14.266202000	2.2.2.2	3.3.3.3	Initialization Message Keep Alive Message 
30	14.269227000	3.3.3.3	2.2.2.2	Keep Alive Message 
31	14.273151000	2.2.2.2	3.3.3.3	Address Message 
32	14.275792000	3.3.3.3	2.2.2.2	Address Message 
35	18.254353000	2.2.2.2	3.3.3.3	Label Request Message Label Request Message Label Request Message Label Request Message Label Request Message [Malformed Packet]
36	18.258873000	3.3.3.3	2.2.2.2	Label Mapping Message Label Mapping Message Label Mapping Message Label Mapping Message Label Mapping Message 
41	20.712829000	3.3.3.3	2.2.2.2	Label Request Message [Malformed Packet]
42	20.716533000	2.2.2.2	3.3.3.3	Label Mapping Message 

Under DU the Label Mappings follow the Address message directly (see STEP 1 of What Is LDP). Under DoD a Label Request comes between them.

Inside the Request is a Prefix FEC saying which FEC the label is wanted for.

STEP 2 No.35 Label Request (tshark -V excerpt)
Label Distribution Protocol
    Label Space ID: 0
    Label Request Message
        Message Type: Label Request Message (0x401)
            FEC Elements
                FEC Element 1
                    FEC Element Type: Prefix FEC (2)
                    FEC Element Address Type: IPv4 (1)
                    FEC Element Length: 32
                    Prefix: 3.3.3.3
Download the pcap of the packet in the tshark output above (No.35 Label Request)

The Type is 0x0401, matching the RFC 5036 definition. The [Malformed Packet] note is tshark failing to decode several Requests packed into one segment; the routers processed them correctly.

STEP 3: Remove the configuration (final state)

Removing it from both ends returns the session to DU and the bindings to nine entries, the same state as STEP 0.

Captures

The first PE1 - P1 link was captured, with no filter.

STEP 2 switching to DoD

Verification config and show output

The following file types were collected from all eight routers at every STEP, split per router. The verification config is these ..._run.txt files (the final state is the one from the last STEP).

FileContents
..._show.txtshow version / show interface description / show route and the OSPF, LDP, MPLS forwarding and BGP set
..._log.txtshow logging limited to that STEP
..._run.txtshow running-config at that STEP (the verification config for that STEP)
..._trace.txtLDP and LSD traces on the four core routers

STEP 0: Initial state

Routershowsyslogrunning-configtrace
CE1showlogrun-
PE1showlogruntrace
P1showlogruntrace
P2showlogruntrace
PE2showlogruntrace
CE2showlogrun-
CE3showlogrun-
CE4showlogrun-

STEP 1: Configure DoD on PE1 only

Routershowsyslogrunning-configtrace
CE1showlogrun-
PE1showlogruntrace
P1showlogruntrace
P2showlogruntrace
PE2showlogruntrace
CE2showlogrun-
CE3showlogrun-
CE4showlogrun-

STEP 2: Configure P1 as well

Routershowsyslogrunning-configtrace
CE1showlogrun-
PE1showlogruntrace
P1showlogruntrace
P2showlogruntrace
PE2showlogruntrace
CE2showlogrun-
CE3showlogrun-
CE4showlogrun-

STEP 3: Remove the configuration (final state)

Routershowsyslogrunning-configtrace
CE1showlogrun-
PE1showlogruntrace
P1showlogruntrace
P2showlogruntrace
PE2showlogruntrace
CE2showlogrun-
CE3showlogrun-
CE4showlogrun-

References

RFCTitleSummary
RFC 5036LDP SpecificationLabel distribution control (2.6.1), label retention (2.6.2), label advertisement (2.6.3), label spaces (2.2.1) and their relation to the LDP Identifier (2.2.2).

Book: Luc De Ghein, MPLS Fundamentals (Cisco Press, 2006), Chapters 2 and 4

Related articles