ospfd: Implement RFC4222 Recommendation 5#22175
Draft
raviravindran123 wants to merge 5 commits into
Draft
Conversation
Implement RFC 4222 recommendation 5: per-interface adjacency pacing to limit the number of simultaneous OSPF adjacency formations and avoid database-exchange bursts on bandwidth-constrained interfaces. Two modes are provided: - Static: a fixed concurrency limit configured per interface. - Dynamic: an AIMD-based limit that adjusts automatically using the total unacknowledged LSA count (U) across the interface as a congestion signal. When U rises above a high-water mark the limit is halved; when U falls below a low-water mark the limit is incremented by one. Neighbors that cannot immediately enter ExStart are queued per interface in FIFO order. When a slot opens, ospf_adj_pacing_kick() restarts the next queued neighbor. The dynamic limit is re-evaluated on LSA acknowledgement and on the retransmit timer. Signed-off-by: Ravi Ravindran <rravindran@labn.net>
Add topotests for RFC 4222 recommendation 5 adjacency pacing covering three test files: - test_ospf_adj_pacing_config.py: verifies static and dynamic pacing configuration persistence, interface flap behavior, FRR daemon restart, no-command cleanup, threshold validation, and defaults. - test_ospf_broadcast_router_dynamic_pacing.py: verifies dynamic pacing on a 7-router broadcast topology with DR election; tests AIMD congestion detection under LSA flood and queue-kick behavior when the dynamic limit increases after congestion clears. - test_ospf_broadcast_router_static_pacing.py: verifies static pacing on the same broadcast topology. Router configurations cover point-to-point (r1-r3) and broadcast (r1_broadcast through r7_broadcast) topologies with hello/dead timers tuned for fast convergence. Signed-off-by: Ravi Ravindran <rravindran@labn.net>
Add developer and user documentation for RFC 4222 recommendation 5 adjacency pacing. doc/developer/ospf-adj-pacing.rst: describes the static and dynamic pacing modes, the AIMD algorithm, code paths in ospf_nsm.c, and how unacknowledged LSA counting works across broadcast and point-to-point segments. doc/developer/ospf.rst: add ospf-adj-pacing to the OSPF developer documentation toctree. doc/user/ospfd.rst: add four clicmd entries for the adjacency pacing interface commands: static limit, dynamic mode, dynamic thresholds, and no-form. Signed-off-by: Ravi Ravindran <rravindran@labn.net>
Add 7 test cases to test_ospf_adj_pacing_config.py covering static pacing configuration that was missing from initial test coverage: - config persistence (write memory / running-config) - persistence across ospfd restart - persistence across interface flap - no-command removes static config - boundary values (limit=1 minimum, limit=65535 maximum) - transition from static to dynamic mode - transition from dynamic to static mode Signed-off-by: Ravi Ravindran <rravindran@labn.net>
Fix checkpatch violations flagged by FRR CI Verify Source: - trailing whitespace in ospf_nsm.c, ospf_vty.c, ospf_interface.c - brace placement and spacing in ospf_nsm.c - tabs vs spaces indentation in ospf_vty.c - pointer style and operator spacing in ospf_interface.h - missing blank lines after declarations in ospf_packet.c Applied via git clang-format against upstream base. Signed-off-by: Ravi Ravindran <rravindran@labn.net>
9b612e9 to
f6be918
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements RFC 4222 Recommendation 5: per-interface adjacency pacing
to limit the number of simultaneous OSPF adjacency formations and
avoid database-exchange bursts on bandwidth-constrained interfaces.
Two modes are provided:
Static mode — a fixed concurrency limit per interface:
ip ospf adjacency-pacing static <1-65535>
Dynamic mode — an AIMD-based limit that adapts to retransmission
pressure on the interface:
ip ospf adjacency-pacing dynamic
ip ospf adjacency-pacing dynamic thresholds
In dynamic mode the total unacknowledged LSA count U(t) across all
neighbors on the interface is used as the congestion signal. When
U(t) rises above the high-water mark H the limit is halved; when it
falls below the low-water mark L the limit is incremented by one.
The limit starts at 1 and is bounded at 50. Default thresholds are
H=100, L=2.
Neighbors that cannot immediately enter ExStart are queued per
interface in FIFO order and restarted (via NSM_AdjOK) when a slot
opens.
Testing
Three topotest files covering:
no-command cleanup, threshold validation (point-to-point topology)
limit increase (7-router broadcast topology)
Documentation