Skip to content

virtual router: Add a minimum BGP hold time setting - #14869

Open
MitchDrage wants to merge 2 commits into
apache:mainfrom
MitchDrage:bgp-min-holdtime
Open

MitchDrage wants to merge 2 commits into
apache:mainfrom
MitchDrage:bgp-min-holdtime

Conversation

@MitchDrage

Copy link
Copy Markdown
Contributor

Description

A BGP peer can propose hold time 0, which turns keepalives off. The virtual router then never notices when that peer goes away. This PR adds a router-wide minimum hold time.

  • New account setting routed.bgp.min.holdtime (default 3) on BGPService. It applies to every router with Dynamic routing, isolated routed networks included. The value is read from the router's owning account.
  • The BGP peers command carries the value to the router, and CsBgpPeers renders bgp minimum-holdtime under router bgp. It applies to every peer on the router.
  • BGP allows a hold time of 0 or 3 and up, so the default refuses only peers that turn keepalives off. Setting it to 0 turns the minimum off and renders no line. Values outside 0-65535 are refused when the setting is saved.

After upgrading, a router with Dynamic routing refuses a peer that proposes hold time 0. Set routed.bgp.min.holdtime to 0 for an account to keep accepting it.

This was split from #14841, where the review of the setting's name, scope and default took place. It touches CsBgpPeers.py, as does #14841, so it will need a rebase after that merges.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

N/A

How Has This Been Tested?

  • New unit tests: SetBgpPeersMinHoldtimeTest, CommandSetupHelperBgpPeersMinHoldtimeTest and TestCsBgpPeersFrr. BGPServiceImplTest covers the new setting, ConfigurationManagerImplTest covers its range, and TestCsBgpPeers and its fixture are updated for the new line.
  • Tested in a lab environment: CloudStack 4.22.1.1 with KVM hosts, systemvm template 4.22.0, a ROUTED VPC with Dynamic routing, and this change on the management server, the agents and the router.
    • The setting registered with default 3 and Account scope, and the router rendered bgp minimum-holdtime 3 after the router ID.
    • A peer proposing hold time 0 was refused with Unacceptable Hold Time. Peers with timers 1/3 and 3/9 came up with hold time 3 and 9.
    • An account value of 9 reached the router on the next peer configuration change, and the 1/3 peer was then refused. Resetting the account value gave 3 again.
    • An account value of 0 rendered no line, and the hold time 0 peer came up.
    • A change to the global value reached the router on the next peer configuration change.

How did you try to break this feature and the system with this change?

  • Saved -1, 65536 and 70000 at global and account scope: the setting refuses them.
  • Pushed a value outside 1-65535, or one that is not a whole number, straight to the router: it is logged and ignored, no line is rendered, and the rest of the config still applies.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant