Repository navigation
Add BGP peer and route flap control operations - #485
atul-nexthop wants to merge 2 commits into
Conversation
- action.protocol.bgp.peer.flap: flap BGP peer sessions on the fly - state.protocol.route.flap: flap routes (generic - BGP/ISIS/OSPF) on the fly Both are enable/up_time/down_time toggles, marked x-status under_review. Regenerate artifacts (openapi.yaml, otg.proto). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@apratimmukherjee @sasubrata this implements #484 — on-the-fly flap for BGP peers and routes. I've raised it as a proposal and I'm happy to adjust the modeling to fit the project's conventions. Could you take a look or assign a reviewer when you have a chance? Thanks! |
|
@atul-nexthop Thanks for raising this — appreciate the initiative on both the issue and the PR. I want to check this against a related ask: I was forwarded an email thread describing a need to not auto-advertise routes on session up, and instead control route transmission (and flapping) explicitly from the test. Could you clarify whether this PR is: An additional requirement — i.e., flap control exposed via the API itself, rather than driven from test code (e.g., a loop issuing adv/withdraw), or |
@apratimmukherjee Thank you for your quick response. This is separate task from the one raised via support team.
Please let me know if this makes sense. |
Route flap was modeled on the generic State.Protocol.Route, but only BGP route ranges support flapping in IxNetwork (ISIS/OSPF route ranges have no flap fields, only a static Active flag). Move route flap to a BGP-scoped action so the schema only advertises what the backend can honor. - Remove flap from generic State.Protocol.Route (keeps names + state, honored by BGP/ISIS/OSPF via Active). - Add action.protocol.bgp.route.flap alongside action.protocol.bgp.peer.flap. - Add route-range flap fields confirmed in restpy: delay, partial_flap, flap_from_route_index, flap_to_route_index (plus enable/up_time/down_time). Regenerate artifacts (openapi.yaml, otg.proto). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@apratimmukherjee @indraniBh @kamalsahu0001 I would appreciate your help on this if these fields can be exposed on OTG and allows us to set these using snappi. if you would like me to open a support ticket - please let me know |
|
@atul-nexthop : One point worth highlighting is that the background thread mechanism would only be required if this verification needs to run asynchronously in the background. Otherwise, the same behavior can be implemented in a straightforward manner as a direct library function/wrapper. We are leaning toward a library-based solution rather than introducing a new OTG API for a couple of reasons:
We are putting together this approach and will update the thread shortly. |
|
Thanks @indraniBh — and I appreciate you working up a concrete approach. I agree with both goals: keep OTG vendor-neutral, and don't add API surface where existing primitives compose. Before the script lands, two things I'd ask you to weigh, because I don't think a wrapper can cover them. 1. Call volume, and the robustness that follows from it. With engine-driven flap the test makes two calls total — start with the up/down timers, stop when done — and the chassis runs the pattern itself. A wrapper makes two calls per flap cycle, so the count scales with duration and flap rate: a 10-minute run at a 1-second period is ~1,200 REST calls instead of 2, and a longer or faster test multiplies from there. That has two consequences. The obvious one is load — those calls land on a shared API server that other sessions and other teams are using at the same time. The one that worries me more is fidelity: every transition depends on that path staying healthy for the whole run, so the flap pattern degrades exactly when the controller is busiest, which on a scale test is precisely when the flap is running. The stimulus the test asked for stops being the stimulus the DUT sees, and a flap test is only meaningful if the stimulus is known and repeatable. Is that something the wrapper approach can guarantee? 2. Partial flap. On genericity — I think we want the same thing. An earlier revision of this PR put flap on the generic If the concern is protocol-specific surface, I'm happy to move it back to a generic route/protocol scope with capability reporting, so unsupported backends report unsupported rather than silently no-op. That gives one operation instead of per-protocol APIs, addresses the overlap concern, and keeps the engine-side execution a wrapper can't provide. Happy to revise the PR that way, or to review your script against these two cases once it's up. |
Addresses #484
What this adds
On-the-fly flap operations (start/stop while the session is up, no config change), per the requirements in #484:
action.protocol.bgp.peer.flap— flap BGP peer sessions.action.protocol.bgp.route.flap— flap BGP route ranges.Design
Flapping is only supported on BGP peers and route ranges in IxNetwork; ISIS/OSPF route ranges have no flap fields (only a static
Activeflag). So both flap operations are modeled BGP-scoped underAction.Protocol.Bgp, alongsidenotificationandinitiate_graceful_restart:Action.Protocol.Bgp.Peer.Flap—peer_names(BGP peers),enable,up_time,down_time.Action.Protocol.Bgp.Route.Flap—route_names(BGP v4/v6 route ranges),enable,up_time,down_time, plus the extra route-range controls IxNetwork exposes:delay— delay (seconds) before flapping begins.partial_flap— flap only a subset of the routes within each range.flap_from_route_index/flap_to_route_index— inclusive index window for the subset whenpartial_flapis enabled.Flap is a triggered operation with timing, which fits the action scope per
control/readme.md(states are representable purely by enums; actions are triggers).x-field-uids are appended so existing fields are untouched. Both new operations are markedx-status: under_review.Note on scope (changed from the earlier revision of this PR)
Route flap was initially placed on the generic
State.Protocol.Route(cross-protocol via itsx-constraint). That advertised a flap capability for ISIS/OSPF that the backend can't honor, and the extra fields (partial_flap,flap_from/to_route_index) are BGP-route-range specific. It has been moved toaction.protocol.bgp.route.flapand removed fromState.Protocol.Route(which keepsnames+statewithdraw/advertise, honored by BGP/ISIS/OSPF viaActive).Files
control/bgp.yaml,control/protocol.yaml(source)artifacts/openapi.yaml,artifacts/otg.proto(regenerated viabuild.py)Testing
python build.pypasses (openapiart validation green).