Skip to content

Conversation

@digizeph
Copy link
Member

@digizeph digizeph commented Aug 3, 2025

No description provided.

Implements RFC 8950 "Advertising IPv4 Network Layer Reachability Information (NLRI)
with an IPv6 Next Hop" to enable parsing of VPN-IPv4 routes with VPN-IPv6 next-hops.

Changes include:

- Extended Safi enum with MplsVpn (128) and MulticastVpn (129) for VPN address families
- Added RouteDistinguisher type for 8-byte VPN route distinguisher parsing
- Extended NextHopAddress enum with VpnIpv6 and VpnIpv6LinkLocal variants
- Updated parse_mp_next_hop to handle 24-byte and 48-byte VPN next-hops:
  * 24 bytes: 8-byte RD + 16-byte IPv6 (VPN-IPv6 next hop)
  * 48 bytes: 8-byte RD + 16-byte IPv6 + 8-byte RD + 16-byte IPv6 link-local
- Updated all exhaustive pattern matches to handle new NextHopAddress variants
- Added comprehensive tests for VPN next-hop parsing and encoding
- Updated documentation to mark RFC 8950 as supported

This implementation is fully backward compatible and enables parsing of
previously unsupported VPN next-hop formats per RFC 8950 Section 4.
Implements RFC 8950 Section 3 Extended Next Hop capability negotiation
for BGP OPEN messages. This enables BGP speakers to advertise their
ability to receive IPv4 NLRI with IPv6 next-hops and other cross-protocol
combinations.

Key features:
- ExtendedNextHopCapability struct with parsing/encoding support
- Integration with BGP OPEN message capability parsing infrastructure
- Comprehensive validation and error handling with fallback to raw bytes
- Helper methods: supports() and supported_nlri_for_nexthop()
- Full test coverage including round-trip and integration tests

Changes:
- Add ExtendedNextHopCapability and ExtendedNextHopEntry structs
- Extend CapabilityValue enum to support structured capability parsing
- Update BGP capability parsing to handle Extended Next Hop capabilities
- Add 8 comprehensive test cases covering all functionality
- Maintain backward compatibility with existing capability parsing

RFC 8950 compliance:
- Supports arbitrary AFI/SAFI combinations per specification
- Validates 6-byte entry format (AFI + SAFI + AFI)
- Handles SAFI encoding differences (2 bytes in capability vs 1 byte normally)
…tion

Documents the RFC 8950 Extended Next Hop capability parsing and encoding
feature added in the previous commit, including structured capability
parsing, BGP OPEN message integration, and comprehensive validation.
@digizeph digizeph merged commit fde4826 into main Aug 3, 2025
2 of 3 checks passed
@digizeph digizeph deleted the RFC8950 branch August 3, 2025 22:44
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