MPLS · Topic 4 of 5
LDP-Signaled LSPs
Learn LDP for the JN0-364: hello discovery, TCP sessions, loopback label advertisement, inet.3 preference 9 and how to configure and verify LDP on Junos.
- 5 min
- LDP hellos use UDP 646 to 224.0.0.2; sessions use TCP 646 between transport addresses.
- Junos defaults: link hello every 5 seconds, hold time 15 seconds, keepalive every 10 seconds, timeout 30 seconds.
- Downstream unsolicited advertisement with liberal label retention.
What it is
The Label Distribution Protocol (LDP) builds LSPs automatically along the IGP shortest path. You do not name LSPs or choose paths. Every LDP router advertises a label for the FECs it knows, and a full mesh of LSPs to every advertised egress appears on its own.
LDP has no traffic engineering: no bandwidth reservation and no explicit routes. It is simple to run, which is why many providers use it for BGP-free cores and Layer 3 VPN transport. LDP routes are installed in inet.3 with preference 9.
How it works
Discovery and sessions
- LDP sends link hellos as UDP packets to 224.0.0.2, port 646, on each LDP interface. By default Junos sends them every 5 seconds with a hold time of 15 seconds.
- When two routers hear each other, they form an LDP neighbor (adjacency).
- The router with the higher transport address opens a TCP session on port 646. The transport address is the router ID by default, normally the lo0 address, so the loopbacks must be reachable through the IGP.
- Over the session, the routers exchange label mappings. Keepalives default to every 10 seconds with a 30 second timeout.
Targeted hellos to a remote, non-adjacent router are also possible, for example for LDP tunneling over RSVP. Their default interval is 15 seconds.
Label advertisement
Junos LDP uses downstream unsolicited mode: a router sends label mappings to all neighbors without being asked. It keeps every received mapping (liberal retention), but installs only the label from the neighbor that is the IGP next hop.
By default, Junos LDP advertises only the router's loopback address as a FEC. Each egress advertises label 3 (implicit null) for its own loopback, so PHP happens at the penultimate router. To advertise other prefixes, you apply an egress-policy. A policy that does not include the loopback stops the loopback from being advertised.
LDP follows the IGP
An LDP label is installed only for a FEC whose IGP next hop is the neighbor that sent the label. If the IGP has no route to the FEC, no LSP is built. If the IGP route changes, the LDP path changes with it.
| RSVP | LDP | |
|---|---|---|
| Path | Chosen by the ingress (CSPF or explicit) | Follows the IGP shortest path |
| Configuration | LSP named on the ingress | Interfaces only; LSPs appear automatically |
| Traffic engineering | Bandwidth, explicit paths, fast reroute | None |
| inet.3 preference | 7 | 9 |
| Transport | Raw IP (protocol 46) | UDP 646 hellos, TCP 646 session |
Configuration
On every router in the LDP domain:
user@R2# set interfaces ge-0/0/1 unit 0 family mpls
user@R2# set protocols mpls interface ge-0/0/1.0
user@R2# set protocols ldp interface ge-0/0/1.0
There is no LSP definition. The protocols mpls interface statement is still needed so the interface forwards labeled packets, and the IGP must already advertise every router's loopback.
Optional settings include track-igp-metric, which copies the IGP metric into the LDP route, and explicit-null, which makes the egress advertise label 0 instead of 3.
Monitoring
| Command | Shows |
|---|---|
show ldp interface | Interfaces running LDP and their neighbor count |
show ldp neighbor | Neighbors discovered through hellos |
show ldp session | TCP sessions and their state (Operational when up) |
show ldp database | Input and output label bindings per session |
show route table inet.3 protocol ldp | Installed LDP LSP routes |
user@R1> show ldp session
Address State Connection Hold time Adv. Mode
192.168.0.2 Operational Open 26 DU
ping mpls ldp 192.168.0.4 checks the LDP path to a FEC.
Troubleshooting checklist
| Symptom | Likely cause |
|---|---|
| No LDP neighbor | protocols ldp interface missing on one side, or the link is down |
| Neighbor seen but no session | Transport address (remote loopback) not reachable through the IGP |
| Session up but no route in inet.3 | No IGP route to the FEC, or the binding came from a neighbor that is not the IGP next hop |
| inet.3 route present but traffic dropped | family mpls or protocols mpls interface missing on a link |
| Only some prefixes have labels | Expected: only loopbacks are advertised unless an egress-policy is applied |
If show ldp neighbor shows the peer but show ldp session is empty or not Operational, check routing to the neighbor's loopback first. The session runs between transport addresses, not between the link addresses.
Common mistakes
Expecting LDP to advertise every route. Junos LDP advertises only the loopback by default. Other prefixes need an egress-policy.
Forgetting the IGP. LDP needs an IGP route to the FEC and to the neighbor's transport address. Without the IGP, LDP builds nothing.
Looking for an LSP name on the ingress. LDP LSPs have no names and are not shown in show mpls lsp as RSVP LSPs are. Check inet.3 and show ldp database.
Mixing up the preferences. LDP is 9 and RSVP is 7. If both reach the same egress, the RSVP route is active in inet.3.
An egress-policy replaces the default. If the policy does not match the loopback, the loopback is no longer advertised and LSPs to it disappear.
What to remember for the exam
- LDP hellos use UDP 646 to 224.0.0.2; sessions use TCP 646 between transport addresses.
- Junos defaults: link hello every 5 seconds, hold time 15 seconds, keepalive every 10 seconds, timeout 30 seconds.
- Downstream unsolicited advertisement with liberal label retention.
- Only the loopback is advertised by default; use
egress-policyfor more. - LDP LSPs follow the IGP shortest path and have no traffic engineering.
- LDP route preference is 9, so RSVP (7) wins when both exist.
- Configure
family mpls,protocols mpls interfaceandprotocols ldp interface.
Check yourself
Two LDP routers are neighbors but have no session. What should you check first?
Whether each router can reach the other's transport address, normally the loopback, through the IGP.
Which prefixes does Junos LDP advertise with no egress policy?
Only the router's own loopback address.
An egress router has both an RSVP and an LDP LSP to it from the same ingress. Which route is active in inet.3?
The RSVP route, because its preference of 7 beats LDP's 9.
Topic 4 of 5 in MPLS
Test yourself on MPLS
The full Juniper JNCIS-SP JN0-364 question bank has 860 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.