summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_gr.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospfd, ospf6d: fix time_t truncationRenato Westphal2023-05-311-1/+1
| | | | | | | | Change timestamp parameter from int to time_t to avoid truncation. Found by Coverity Scan (CID 1563226 and 1563222) Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd, ospf6d: introduce the "graceful-restart hello-delay" commandRenato Westphal2023-05-091-0/+1
| | | | | | | | | This command makes unplanned GR more reliable by manipulating the sending of Grace-LSAs and Hello packets for a certain amount of time, increasing the chance that the neighboring routers are aware of the ongoing graceful restart before resuming normal OSPF operation. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: add support for unplanned graceful restartRenato Westphal2023-05-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practical terms, unplanned GR refers to the act of recovering from a software crash without affecting the forwarding plane. Unplanned GR and Planned GR work virtually the same, except for the following difference: on planned GR, the router sends the Grace-LSAs *before* restarting, whereas in unplanned GR the router sends the Grace-LSAs immediately *after* restarting. For unplanned GR to work, ospf6d was modified to send a ZEBRA_CLIENT_GR_CAPABILITIES message to zebra as soon as GR is enabled. This causes zebra to freeze the OSPF routes in the RIB as soon as the ospfd daemon dies, for as long as the configured grace period (the defaults is 120 seconds). Similarly, ospfd now stores in non-volatile memory that GR is enabled as soon as GR is configured. Those two things are no longer done during the GR preparation phase, which only happens for planned GRs. Unplanned GR will only take effect when the daemon is killed abruptly (e.g. SIGSEGV, SIGKILL), otherwise all OSPF routes will be uninstalled while ospfd is exiting. Once ospfd starts, it will check whether GR is enabled and enter in the GR mode if necessary, sending Grace-LSAs out all operational interfaces. One disadvantage of unplanned GR is that the neighboring routers might time out their corresponding adjacencies if ospfd takes too long to come back up. This is especially the case when short dead intervals are used (or BFD). For this and other reasons, planned GR should be preferred whenever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-1/+1
| | | | | | | | | Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospfd: introduce support for Graceful Restart (restarting mode)Renato Westphal2021-07-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 3623 specifies the Graceful Restart enhancement to the OSPF routing protocol. This PR implements support for the restarting mode, whereas the helper mode was implemented by #6811. This work is based on #6782, which implemented the pre-restart part and settled the foundations for the post-restart part (behavioral changes, GR exit conditions, and on-exit actions). Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ospf` EXEC-level command needs to be issued before restarting the ospfd daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospfd is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: rename the graceful restart headerRenato Westphal2021-07-051-0/+182
Both the GR helper code and the upcoming GR restarting code are going to share a lot of definitions. As such, rename ospf_gr_helper.h to ospf_gr.h, which will be the central point of all GR definitions and prototypes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>