OcNOS-SP : Multi-Protocol Label Switching Guide : Multi-Protocol Label Switching Configuration Guide : LDP Graceful Restart
LDP Graceful Restart
LDP graceful restart (GR) minimizes the negative effects on MPLS traffic caused by control-plane restarts in Label Switching Routers (LSR), especially by the restart of the Label Distribution Protocol (LDP).
LDP graceful restart enables a router whose LDP control plane is undergoing a restart to continue forwarding traffic while recovering its state from neighboring routers. This requires a restarting LDP router that retains established LSP labels. In helper mode, the router maintains label bindings as stale and reprocesses them, after the router undergoing graceful restart reestablishes its LDP session.
The MPLS forwarding state, which is the minimum state required to avoid any disturbance to LSPs traversing a restarting LSR, is preserved during the restart. This mechanism does not require any of the LDP-related states to be preserved across the restart. This means that when LDP restarts, there are minimal or no changes made to the forwarding table entries, and MPLS forwarding continues uninterrupted. This supports Graceful Restart in restarting routers as well as in neighbor routers.
Topology
LDP Graceful Restart
Configuration
R1
 
#configure terminal
Enter Configure mode.
(config)#interface lo
Enter Interface mode for loopback.
(config-if)# ip address 1.1.1.1/32 secondary
Assign secondary IP address.
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ldp
Enter the Router LDP mode
(config-router)# router-id 1.1.1.1
Assign router id for LDP
(config-router)# graceful-restart full
Enable graceful restart in LDP configure mode
(config-router)# graceful-restart timers neighbor-liveness 130
Configuring graceful neighbor-liveness timer to 130 sec.
(config-router)# graceful-restart timers max-recovery 150
Configuring graceful max recovery timer to 150 sec
(config-router)# exit
Exit Router LDP mode and return to Configure mode.
(config)#interface ce49
Enter Interface mode for ce49.
(config-if)# ip address 20.20.20.1/24
Assign IP address on ce49 interface.
(config-if)# enable-ldp ipv4
Enable LDP on the interface.
(config-if)# label-switching
Enable Label switching on the interface
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ospf
Enter the Router OSPF mode
(config-router)# network 1.1.1.1/32 area 0.0.0.0
Advertise loopback address in OSPF
(config-router)# network 20.20.20.0/24 area 0.0.0.0
Advertise network address in OSPF
(config-router)# redistribute connected
Configure redistribution connected.
(config-router)#exit
Exit from Router OSPF mode and enter into config mode
(config)#commit
Commit the candidate configuration to the running configuration
(config)#exit
Exit from configuration mode
R2
 
#configure terminal
Enter Configure mode.
(config)#interface lo
Enter Interface mode for loopback.
(config-if)# ip address 2.2.2.2/32 secondary
Assign secondary IP address.
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ldp
Enter the Router LDP mode
(config-router)# router-id 2.2.2.2
Assign router id for LDP
(config-router)# graceful-restart helper-only
Enable graceful restart helper in LDP configure mode
(config-router)# exit
Exit Router LDP mode and return to Configure mode.
(config)#interface ce0
Enter Interface mode for ce0.
(config-if)# ip address 20.20.20.2/24
Assign IP address on ce0 interface.
(config-if)# enable-ldp ipv4
Enable LDP on the interface.
(config-if)# label-switching
Enable Label switching on the interface
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)#interface xe13
Enter Interface mode for xe13.
(config-if)# ip address 30.30.30.1/24
Assign IP address on xe13 interface.
(config-if)# enable-ldp ipv4
Enable LDP on the interface.
(config-if)# label-switching
Enable Label switching on the interface
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ospf
Enter the Router OSPF mode
(config-router)# network 2.2.2.2/32 area 0.0.0.0
Advertise loopback address in OSPF
(config-router)# network 20.20.20.0/24 area 0.0.0.0
Advertise network address in OSPF
(config-router)# network 30.30.30.0/24 area 0.0.0.0
Advertise network address in OSPF
(config-router)#exit
Exit from Router OSPF mode and enter into config mode
(config)#commit
Commit the candidate configuration to the running configuration
(config)#exit
Exit from configuration mode
R3
 
#configure terminal
Enter Configure mode.
(config)#interface lo
Enter Interface mode for loopback.
(config-if)# ip address 3.3.3.3/32 secondary
Assign secondary IP address.
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ldp
Enter the Router LDP mode
(config-router)# router-id 3.3.3.3
Assign router id for LDP
(config-router)# graceful-restart helper-only
Enable graceful restart helper in LDP configure mode
(config-router)# exit
Exit Router LDP mode and return to Configure mode.
(config)#interface xe13
Enter Interface mode for xe13.
(config-if)# ip address 30.30.30.2/24
Assign IP address on xe13 interface.
(config-if)# enable-ldp ipv4
Enable LDP on the interface.
(config-if)# label-switching
Enable Label switching on the interface
(config-if)#exit
Exit Interface mode and return to Configure mode.
(config)# router ospf
Enter the Router OSPF mode
(config-router)# network 3.3.3.3/32 area 0.0.0.0
Advertise loopback address in OSPF
(config-router)# network 30.30.30.0/24 area 0.0.0.0
Advertise network address in OSPF
(config-router)# redistribute connected
Configure redistribution connected.
(config-router)#exit
Exit from Router OSPF mode and enter into config mode
(config)#commit
Commit the candidate configuration to the running configuration
(config)#exit
Exit from configuration mode
Validation
R1
Before LDP Graceful Restart:
RTR1#show running-config ldp
!
router ldp
graceful-restart full
graceful-restart timers neighbor-liveness 130
graceful-restart timers max-recovery 150
!
!
interface ce49
enable-ldp ipv4
!
RTR1#show ldp session
Peer IP Address IF Name My Role State KeepAlive UpTime
2.2.2.2 ce49 Passive OPERATIONAL 30 01:00:10
 
RTR1#show mpls ldp parameter
Router ID : 1.1.1.1
LDP Version : 1
Global Merge Capability : Merge Capable
Label Advertisement Mode : Downstream Unsolicited
Label Retention Mode : Liberal
Label Control Mode : Independent
Instance Loop Detection : Off
Request Retry : Off
Propagate Release : Disabled
Graceful Restart : Enabled
Hello Interval : 5
Targeted Hello Interval : 15
Hold time : 15
Targeted Hold time : 45
Keepalive Interval : 10
Keepalive Timeout : 30
Request retry Timeout : 5
Neighbor liveness Time : 130
Max recovery Time : 150
Transport Address data :
Labelspace 0 : 1.1.1.1 (in use)
Import BGP routes : No
 
RTR1#show mpls forwarding-table
Codes: > - installed FTN, * - selected FTN, p - stale FTN,
B - BGP FTN, K - CLI FTN, t - tunnel, P - SR Policy FTN,
L - LDP FTN, R - RSVP-TE FTN, S - SNMP FTN, I - IGP-Shortcut,
U - unknown FTN, O - SR-OSPF FTN, i - SR-ISIS FTN, k - SR-CLI FTN
(m) - FTN mapped over multipath transport
 
Code FEC FTN-ID Nhlfe-ID Tunnel-id Pri LSP-Type Out-Label Out-Intf ELC Nexthop
L> 2.2.2.2/32 1 1 - - LSP_DEFAULT 3 ce49 No 20.20.20.2
L> 3.3.3.3/32 2 2 - - LSP_DEFAULT 24321 ce49 No 20.20.20.2
L> 30.30.30.0/24 3 1 - - LSP_DEFAULT 3 ce49 No 20.20.20.2
RTR1#
 
Steps for LDP Graceful Restart:
RTR1#write
Building configuration...
2021 Sep 28 12:54:36.418 : RTR1 : CML : INFO : [CML_5]: Copy-config requested by client '82'
[OK]
RTR1#restart ldp graceful
 
Validation after Graceful Restart:
RTR1#show mpls forwarding-table
Codes: > - installed FTN, * - selected FTN, p - stale FTN,
B - BGP FTN, K - CLI FTN, t - tunnel, P - SR Policy FTN,
L - LDP FTN, R - RSVP-TE FTN, S - SNMP FTN, I - IGP-Shortcut,
U - unknown FTN, O - SR-OSPF FTN, i - SR-ISIS FTN, k - SR-CLI FTN
(m) - FTN mapped over multipath transport
 
Code FEC FTN-ID Nhlfe-ID Tunnel-id Pri LSP-Type Out-Label Out-Intf ELC Nexthop
L> p 2.2.2.2/32 1 1 - - LSP_DEFAULT 3 ce49 No p 20.20.20.2
L> p 3.3.3.3/32 2 2 - - LSP_DEFAULT 24321 ce49 No p 20.20.20.2
L> p 30.30.30.0/24 3 1 - - LSP_DEFAULT 3 ce49 No p 20.20.20.2
RTR1#show nsm ldp forwarding-timer
Protocol-Name GR-State Time Remaining (sec) Disconnected-time
LDP ACTIVE 118 2021/09/28 12:54:47
RTR1#
 
RTR1#show mpls ftn-table
Primary FTN entry with FEC: 2.2.2.2/32, id: 1, row status: Active, Tunnel-Policy: N/A
Owner: LDP, distance: 0, Action-type: Redirect to LSP, Exp-bits: 0x0, Incoming DSCP: none
Tunnel id: 0, Protected LSP id: 0, Description: N/A, Color: 0
Cross connect ix: 1, in intf: - in label: 0 out-segment ix: 1
Owner: N/A, Persistent: No, Admin Status: Up, Oper Status: Up
Out-segment with ix: 1, owner: N/A, Stale: YES, out intf: ce49, out label: 3
Nexthop addr: 20.20.20.2 cross connect ix: 1, op code: Push
 
 
Primary FTN entry with FEC: 3.3.3.3/32, id: 2, row status: Active, Tunnel-Policy: N/A
Owner: LDP, distance: 0, Action-type: Redirect to LSP, Exp-bits: 0x0, Incoming DSCP: none
Tunnel id: 0, Protected LSP id: 0, Description: N/A, Color: 0
Cross connect ix: 2, in intf: - in label: 0 out-segment ix: 2
Owner: LDP, Persistent: No, Admin Status: Up, Oper Status: Up
Out-segment with ix: 2, owner: LDP, Stale: YES, out intf: ce49, out label: 24321
Nexthop addr: 20.20.20.2 cross connect ix: 2, op code: Push
 
 
Primary FTN entry with FEC: 30.30.30.0/24, id: 3, row status: Active, Tunnel-Policy: N/A
Owner: LDP, distance: 0, Action-type: Redirect to LSP, Exp-bits: 0x0, Incoming DSCP: none
Tunnel id: 0, Protected LSP id: 0, Description: N/A, Color: 0
Cross connect ix: 1, in intf: - in label: 0 out-segment ix: 1
Owner: N/A, Persistent: No, Admin Status: Up, Oper Status: Up
Out-segment with ix: 1, owner: N/A, Stale: YES, out intf: ce49, out label: 3
Nexthop addr: 20.20.20.2 cross connect ix: 1, op code: Push
 
RTR1#ping 3.3.3.3
Press CTRL+C to exit
PING 3.3.3.3 (3.3.3.3) 56(84) bytes of data.
64 bytes from 3.3.3.3: icmp_seq=1 ttl=64 time=0.540 ms
64 bytes from 3.3.3.3: icmp_seq=2 ttl=64 time=0.539 ms
64 bytes from 3.3.3.3: icmp_seq=3 ttl=64 time=0.491 ms
64 bytes from 3.3.3.3: icmp_seq=4 ttl=64 time=0.501 ms
 
--- 3.3.3.3 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 69ms
rtt min/avg/max/mdev = 0.491/0.517/0.540/0.035 ms
RTR1#ping 30.30.30.2
Press CTRL+C to exit
PING 30.30.30.2 (30.30.30.2) 56(84) bytes of data.
64 bytes from 30.30.30.2: icmp_seq=1 ttl=64 time=0.519 ms
64 bytes from 30.30.30.2: icmp_seq=2 ttl=64 time=0.540 ms
64 bytes from 30.30.30.2: icmp_seq=3 ttl=64 time=0.549 ms
 
--- 30.30.30.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 39ms
rtt min/avg/max/mdev = 0.519/0.536/0.549/0.012 ms
 
ROUTER-2
 
RTR2#show mpls forwarding-table
Codes: > - installed FTN, * - selected FTN, p - stale FTN,
B - BGP FTN, K - CLI FTN, t - tunnel, P - SR Policy FTN,
L - LDP FTN, R - RSVP-TE FTN, S - SNMP FTN, I - IGP-Shortcut,
U - unknown FTN, O - SR-OSPF FTN, i - SR-ISIS FTN, k - SR-CLI FTN
(m) - FTN mapped over multipath transport
 
Code FEC FTN-ID Nhlfe-ID Tunnel-id Pri LSP-Type Out-Label Out-Intf ELC Nexthop
L> p 1.1.1.1/32 1 1 - - LSP_DEFAULT 3 ce0 No p 20.20.20.1
L> 3.3.3.3/32 2 2 - - LSP_DEFAULT 3 xe13 No 30.30.30.2
RTR2#
 
After Restarting LDP processes:
root@RTR1:/home/ocnos# cd /usr/local/sbin/
root@RTR1:/usr/local/sbin# ./ldpd -d
 
RTR1#show mpls forwarding-table
Codes: > - installed FTN, * - selected FTN, p - stale FTN,
B - BGP FTN, K - CLI FTN, t - tunnel, P - SR Policy FTN,
L - LDP FTN, R - RSVP-TE FTN, S - SNMP FTN, I - IGP-Shortcut,
U - unknown FTN, O - SR-OSPF FTN, i - SR-ISIS FTN, k - SR-CLI FTN
(m) - FTN mapped over multipath transport
 
Code FEC FTN-ID Nhlfe-ID Tunnel-id Pri LSP-Type Out-Label Out-Intf ELC Nexthop
L> 2.2.2.2/32 1 1 - - LSP_DEFAULT 3 ce49 No 20.20.20.2
L> 3.3.3.3/32 2 2 - - LSP_DEFAULT 24321 ce49 No 20.20.20.2
L> 30.30.30.0/24 3 1 - - LSP_DEFAULT 3 ce49 No 20.20.20.2
RTR1#
 
RTR2#show mpls forwarding-table
Codes: > - installed FTN, * - selected FTN, p - stale FTN,
B - BGP FTN, K - CLI FTN, t - tunnel, P - SR Policy FTN,
L - LDP FTN, R - RSVP-TE FTN, S - SNMP FTN, I - IGP-Shortcut,
U - unknown FTN, O - SR-OSPF FTN, i - SR-ISIS FTN, k - SR-CLI FTN
(m) - FTN mapped over multipath transport
 
Code FEC FTN-ID Nhlfe-ID Tunnel-id Pri LSP-Type Out-Label Out-Intf ELC Nexthop
L> 1.1.1.1/32 1 1 - - LSP_DEFAULT 3 ce0 No 20.20.20.1
L> 3.3.3.3/32 2 2 - - LSP_DEFAULT 3 xe13 No 30.30.30.2
RTR2#