You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bgp: multiprotocol capability negotiation in OPEN (RFC 4760 / RFC 5492)
For an IPv6 BGP session the speaker now advertises the Multiprotocol Extensions
capability in the OPEN message, so the peer learns we use the IPv6 (AFI=2,
SAFI=1) address family instead of relying on out-of-band agreement. IPv4 unicast
is BGP's default address family (RFC 4271), so IPv4 sessions send no capabilities
and their OPEN encoding (and all 8 IPv4 bgpv4 fingerprints) stay byte-identical.
- BgpHeader.msg: add the RFC 5492 Capabilities optional parameter
(BgpOptionalParameterCapabilities, parameter type 2) carrying a list of
capabilities, and the RFC 4760 Multiprotocol Extensions capability
(BgpCapabilityMultiprotocol, code 1: AFI + reserved + SAFI).
- BgpSession::sendOpenMessage(): for IPv6 sessions attach one Multiprotocol
capability (AFI=2, SAFI=1) and size the optional-parameters / total / chunk
lengths accordingly; IPv4 sessions are unchanged.
- BgpHeaderSerializer: serialize and deserialize the Capabilities parameter and
Multiprotocol capability (unknown optional-parameter / capability types still
round-trip as raw / header-only). Also fixes a latent infinite-loop guard in
the raw optional-parameter serialize loop.
- BgpRouter::printOpenMessage(): parse and log the peer's advertised
capabilities (AFI/SAFI). Advertise + parse only; no enforcement / NOTIFICATION.
Verified: new tests/unit/Bgp_open_capability_serializer.test (serialize->
deserialize round-trip for IPv6 and IPv4 advertisements) PASSES; IPv4
(Bgp2RoutersInAS: OPEN carries no capabilities, sessions ESTABLISHED, UPDATEs
flow) stays byte-identical, IPv6 (BgpIpv6Basic: hostA->hostB 20/21 pings)
advertises the capability and converges. Only the 2 IPv6 bgpv4 fingerprints
(BgpIpv6Basic, BgpAndOspfv3) change; the 8 IPv4 ones are byte-identical.
0 commit comments