Skip to content

Add BGP peer and route flap control operations - #485

Open
atul-nexthop wants to merge 2 commits into
open-traffic-generator:masterfrom
atul-nexthop:atul.bgp-flap
Open

Add BGP peer and route flap control operations#485
atul-nexthop wants to merge 2 commits into
open-traffic-generator:masterfrom
atul-nexthop:atul.bgp-flap

Conversation

@atul-nexthop

@atul-nexthop atul-nexthop commented Jul 9, 2026

Copy link
Copy Markdown

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 Active flag). So both flap operations are modeled BGP-scoped under Action.Protocol.Bgp, alongside notification and initiate_graceful_restart:

  • Action.Protocol.Bgp.Peer.Flappeer_names (BGP peers), enable, up_time, down_time.
  • Action.Protocol.Bgp.Route.Flaproute_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 when partial_flap is 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 marked x-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 its x-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 to action.protocol.bgp.route.flap and removed from State.Protocol.Route (which keeps names + state withdraw/advertise, honored by BGP/ISIS/OSPF via Active).

Files

  • control/bgp.yaml, control/protocol.yaml (source)
  • artifacts/openapi.yaml, artifacts/otg.proto (regenerated via build.py)

Testing

  • python build.py passes (openapiart validation green).

- 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>
@atul-nexthop

Copy link
Copy Markdown
Author

@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!

@apratimmukherjee
apratimmukherjee self-requested a review July 9, 2026 16:08
@apratimmukherjee

apratimmukherjee commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@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
Related to the same need described in that email thread?
That'll help us figure out whether this should land together with the session-bringup/route-advertisement separation work, or as its own item — will follow up once we hear back. Thanks!

@atul-nexthop

atul-nexthop commented Jul 9, 2026

Copy link
Copy Markdown
Author

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.

@apratimmukherjee Thank you for your quick response.

This is separate task from the one raised via support team.

  • So the first ask which was raised via support team, It was ability to bifurcation of the route advertisement or withdrawl from BGP session establishment - currently, The routes are auto advertised when session comes up - The specific use for this is to allow us to measure route programing learning capability.
  • The ask in this PR is separate - We would like the ability to set the flap and timers via api - If you refer to the screenshot attached on this Issue description - IXIA already has flap parameter in BGP Peer and BGP route ranges - so, This PR is to allow us ability to set those so specific routes are only flapped allowing us better control over flap timers as well.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants