Configuring LDP Graceful Restart
The graceful restart mechanism minimizes the negative effect on MPLS forwarding across an LSR restart. You can configure the neighbors of the LSR to wait for the LSR to restart (helper mode). When the LSR restarts, the neighbors mark their current label mapping entries from the LSR as stale. If the LSR recovers within the proper interval, the entries are no longer marked as stale and are used as they were before the LDP connection failed. If the LSR does not recover in time, the entries are deleted.
LDP graceful restart supports only the downstream-unsolicited mode of label distribution. Successful operation of LDP graceful restart requires that stateful SRP switchover (high availability) be configured on the router. Although you can configure LDP graceful restart if stateful SRP switchover is not configured on the router, the graceful restart capability will not function.
You can configure an LSR to restart itself gracefully and to support graceful restart in its neighbors (helper mode), or helper mode alone. In either case, the LSR includes the fault tolerant (FT) session TLV in the LDP initialization messages it sends at session startup. The TLV includes values for the reconnect timeout and the recovery time. When both graceful restart and the helper mode are disabled, the LSR does not include the TLV in its LDP initialization messages.
The configurable reconnect time specifies how long you want the LSR's neighbors to wait for the LSR to resume exchanging LDP messages with the neighbors after the connection failure. The reconnect timeout value is nonzero when graceful restart is enabled.
When you disable graceful restart but enable helper mode, the reconnect timeout is set to zero to announce to the neighbors that the LSR does not preserve MPLS forwarding state across the restart. The presence of the TLV indicates to the neighbors that the LSR supports them if they gracefully restart. That is, the LSR in this case waits for a gracefully restarting neighbor to resume sending messages.
Table 26 summarizes the states possible for LDP graceful restart.
The recovery time specifies how long the LSR retains its MPLS forwarding state across the restart. When the LSR restarts, it marks the forwarding state entries as stale. The forwarding state holding timer begins counting down from the configured recovery time value. If the timer expires before the restart completes, the LSR deletes all stale entries. When the LSR sends new LDP initialization messages to its neighbors, the messages contain the current value of the timer.
When the LSR restarts, if a neighbor of the LSR has previously received the FT session TLV from the LSR with a nonzero reconnect timeout value, the neighbor retains the label mapping information that it has previously received from the LSR and marks that information as stale. Alternatively, if the neighbor received an FT session TLV with a timeout value of zero (indicating that only helper mode is enabled) or no TLV at all (indicating that both graceful restart and helper mode are disabled), it deletes the label mapping information.
Also when the LSR restarts, the neighbor sets its neighbor liveness timer to the lesser of the two values, the reconnect timeout value and its own configurable neighbor liveness timer value. If the neighbor liveness timer expires, the neighbor deletes all the stale mappings from the LSR. The configurable value represents the maximum time that the neighbor waits for the restarting LSR to reestablish the LDP session. This enables the neighbor to avoid having to wait an unreasonably long time set by the reconnect timeout value from the restarting LSR.
If the recovery time value in the FT session TLV is zero when a neighbor receives the new LDP initialization message, the neighbor deletes all the stale mappings from the LSR.
If the recovery time value is nonzero, the neighbor starts a neighbor recovery timer set to the lesser of the two values, the recovery time value and its own configurable maximum recovery timeout value. The neighbor also cancels its neighbor liveness timer because the LDP session has been reestablished; it is now waiting on the successful completion of the restart.
The restarting LSR and its neighbors then exchange label mapping information. When a neighbor receives a labeltoFEC binding that matches a stale entry, it removes the staleness marker from the entry. If instead the neighbor receives a new label for the same FEC that is in a stale entry, the neighbor updates the entry with the new label and removes the staleness marker from the entry.
The neighbor deletes any stale entries that remain when the neighbor recovery timer expires.
Dynamic exchange of the graceful restart capability is not supported. In some circumstances, such as when a standby SRP module is removed, an LSR that has communicated to neighbors that it supports graceful restart might subsequently be unable to do so. In such cases, the neighbors receive no indication of that change in support unless you bounce the LDP sessions, for example by issuing the clear mpls ldp neighbor command.
mpls ldp graceful-restart
- Use to enable LDP graceful restart and helper mode. LDP graceful restart and helper mode are both disabled by default.
- Graceful restart causes the fault tolerant session TLV to be included in LDP initialization messages with a nonzero value for the reconnect timeout. This action announces to neighbors that the router preserves its forwarding state across a restart.
- Helper mode is automatically enabled when you enable graceful restart. Issue the helper keyword only when graceful restart is disabled and you want to enable helper mode alone.
- Helper mode causes the fault tolerant session TLV to be included in LDP initialization messages. The reconnect timeout value in the TLV is zero when LDP graceful restart is disabled. This TLV announces to neighbors that the router preserves any label-FEC mapping it has received from a neighbor in the event that the neighbor performs an LDP graceful restart.
- Example
host1(config)#mpls ldp graceful-restartUse the no version to disable both LDP graceful restart and helper mode. You cannot disable helper mode alone. mpls ldp graceful-restart reconnect-time
- Use to specify the length of time, in seconds, you want the neighbors to wait for the gracefully restarting router to resume sending LDP messages to neighbors after the LDP connection between them fails.
- This value is included in the fault tolerant session TLV sent in LDP initialization messages when LDP graceful restart is enabled.
- Specify a number in the range 60300.
- Example
host1(config)#mpls ldp graceful-restart reconnect-time 130Use the no version to restore the default value, 120 seconds. mpls ldp graceful-restart recovery-time
- Use to specify the length of time, in seconds, the router retains its MPLS forwarding state across a restart.
- Specify a number in the range 120600.
- Example
host1(config)#mpls ldp graceful-restart recovery-time 150Use the no version to restore the default value, 120 seconds. mpls ldp graceful-restart timers max-recovery
- Use to specify the maximum length of time, in seconds, that the router waits for a neighbor to complete a graceful LDP restart after the LDP session is reestablished.
- Specify a number in the range 15600.
- Example
host1(config)#mpls ldp graceful-restart timers max-recovery 150Use the no version to restore the default value, 120 seconds. mpls ldp graceful-restart timers neighbor-liveness
- Use to specify the length of time, in seconds, the router waits for a neighbor to reestablish the LDP session.
- Specify a number in the range 5300.
- Example
host1(config)#mpls ldp graceful-restart timers neighbor-liveness 150Use the no version to restore the default value, 120 seconds.