High Availability · Topic 3 of 5

Graceful Restart, GRES, NSR and NSB

Compare Junos graceful restart, GRES, NSR and NSB, how they depend on each other, the commit synchronize requirement, and how to configure and verify them.

  • 6 min
In a nutshell
  • GRES: set chassis redundancy graceful-switchover; keeps the forwarding plane up on an RE switchover.
  • GRES alone does not preserve routing protocol sessions.
  • GR: neighbors act as helpers and hold routes while the router restarts; needs neighbor support.

What it is

A device with two Routing Engines (REs) has a master RE that runs the control plane and a backup RE that waits. A switchover to the backup should not drop traffic. Four Junos features work toward that, and each does a different part of the job.

FeatureWhat it does
GRES (graceful Routing Engine switchover)Keeps the forwarding plane and interface state running while the backup RE becomes master
Graceful restart (GR)Asks neighbors to keep forwarding to the restarting router while its routing protocols restart
NSR (nonstop active routing)Copies routing protocol state to the backup RE so protocols continue with no help from neighbors
NSB (nonstop bridging)The same idea for Layer 2 protocols, such as spanning tree and LACP
Master RE failsGRESforwarding keeps runningBackup RE becomes masterNSR or GRrouting continuesNeighbors see no loss

How it works

GRES

With GRES, the backup RE keeps a copy of the kernel state and interface information from the master. When the master fails, the backup takes over without a reboot, and the Packet Forwarding Engine (PFE) is not reset. Traffic keeps flowing through the PFE during the switchover.

GRES alone does not keep routing protocols alive. The new master starts its protocols fresh, so neighbors see the sessions go down unless graceful restart or NSR is also in use. GRES gives the PFE and interface continuity, and the other features give protocol continuity.

user@router# set chassis redundancy graceful-switchover
user@router# set system commit synchronize

commit synchronize makes every commit apply to both REs, so the backup always has the same configuration. GRES needs two REs, or two RE members in a virtual chassis.

Graceful restart

Graceful restart is the older method. A restarting router tells its neighbors that it is restarting, and the neighbors, called helpers, keep the routes learned from it for a limited time and keep forwarding to it. When the router comes back, it relearns its routes, and the helpers stop holding stale ones.

ItemDetail
Restarting routerRuns the restart and must support GR
HelperA neighbor that supports GR and holds the routes during the restart
NeedsNeighbors that cooperate
Works withOSPF, IS-IS, BGP and other protocols that support it

Enable it globally for all supported protocols, or per protocol.

user@router# set routing-options graceful-restart
user@router# set protocols ospf graceful-restart
user@router# set protocols bgp group CORE graceful-restart

Helper mode is on by default for the main protocols, so a router can help a restarting neighbor even if the router itself has no GR configured. It can be disabled per protocol with helper-disable.

NSR

Nonstop active routing keeps the backup RE up to date with the state of the routing protocols and their sessions, including the TCP connections of BGP. When the master fails, the backup already has the state and continues with the neighbors, and the neighbors do not see any change. No neighbor cooperation is needed.

RequirementReason
Two REsMaster and backup
GRES enabledThe forwarding and kernel state continue
commit synchronizeThe backup has the same configuration
user@router# set chassis redundancy graceful-switchover
user@router# set system commit synchronize
user@router# set routing-options nonstop-routing

The commit fails if NSR is configured without GRES or without commit synchronize. Do not combine NSR with the restarting-router side of graceful restart. NSR replaces the need for it, and the two are alternatives.

NSB

Nonstop bridging does for Layer 2 what NSR does for routing. It keeps the backup RE synchronized with the state of Layer 2 protocols, such as spanning tree, LACP and similar protocols, so they continue after a switchover. It also needs GRES.

user@switch# set chassis redundancy graceful-switchover
user@switch# set system commit synchronize
user@switch# set protocols layer2-control nonstop-bridging

NSB is used on the EX switches that have two REs or a virtual chassis, and on other Layer 2 platforms with the feature.

Exam tip

The one sentence to remember: GRES protects the forwarding plane, and NSR, NSB or GR protect the protocols that run on top of it.

Monitoring and switching

user@router> show system switchover
fpc1:
--------------------------------------------------------------------------
Graceful switchover: On
Configuration database: Ready
Kernel database: Ready
Peer state: Steady State

Graceful switchover: On shows GRES is enabled. Steady State means the backup is in sync and ready. Ready for the configuration and kernel databases means they are synchronized.

CommandWhat it shows
show system switchoverGRES state and readiness of the backup
show task replicationReplication status of the protocols for NSR
show bgp replicationBGP synchronization state on the backup
show chassis routing-engineWhich RE is master and which is backup
request chassis routing-engine master switchStarts a manual switchover to the backup RE
show ospf overviewWhether graceful restart is configured for OSPF

A planned switchover is the best test. Check that show system switchover shows a ready backup, then run the request, and watch that neighbors stay up and traffic keeps flowing. Do the switchover only when the backup is in sync.

Check backup readyshow system switchoverreadyRequest master switchBackup becomes masterVerify neighbors and traffic
Watch out

Do not request a switchover while the backup is still synchronizing. The transition can drop traffic or reset protocols.

Common mistakes

Enabling GRES and expecting protocols to survive. GRES keeps forwarding, not routing sessions.

Configuring NSR without commit synchronize. The commit check fails.

Mixing NSR with graceful restart. They are alternatives, and NSR needs no helper.

What to remember for the exam

  • GRES: set chassis redundancy graceful-switchover; keeps the forwarding plane up on an RE switchover.
  • GRES alone does not preserve routing protocol sessions.
  • GR: neighbors act as helpers and hold routes while the router restarts; needs neighbor support.
  • NSR: set routing-options nonstop-routing; needs GRES and commit synchronize; no neighbor help.
  • NSB: set protocols layer2-control nonstop-bridging; needs GRES; for Layer 2 protocols.
  • show system switchover shows whether the backup is ready.
  • request chassis routing-engine master switch triggers a manual switchover.
  • GR and NSR are alternatives; do not combine the restarting router role with NSR.

Check yourself

  • What do you need on top of GRES so a BGP session survives a switchover without neighbor help?

    NSR, which replicates the protocol state to the backup RE; it also needs commit synchronize.

  • Why does a neighbor reset sessions after a switchover with only GRES configured?

    GRES keeps the forwarding plane but not protocol state, so the new master restarts its protocols unless GR or NSR is in use.

  • Which feature keeps spanning tree and LACP running through a switchover?

    Nonstop bridging, configured under protocols layer2-control nonstop-bridging, together with GRES.

Topic 3 of 5 in High Availability

Test yourself on High Availability

The full Juniper JNCIS-ENT JN0-352 question bank has 846 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.