Load Balancing with BGP in Red Hat OpenStack Platform¶
Red Hat OpenStack Platform leverages BGP for network performance optimization and high availability. The implementation combines FRR’s BGP capabilities with the OVN BGP agent for efficient traffic distribution.
ECMP Implementation¶
Equal-Cost Multi-Path (ECMP) routing is configured through FRR’s BGP daemon:
# FRR configuration for ECMP
router bgp 64999
# Enable up to 8 equal-cost paths
maximum-paths 8
# Enable ECMP for iBGP peering
maximum-paths ibgp 8
This configuration allows FRR to maintain multiple equal-cost paths in the routing table. The kernel then distributes traffic using a hash algorithm based on packet header information.
Traffic Flow and Redirection¶
When network traffic arrives at a node, the OVN BGP agent adds several components to redirect traffic:
IP Rules: Direct traffic to specific routing tables
Routes: Point to the OVS provider bridge
OVS Flow Rules: Redirect traffic to the OVN overlay
These configurations work together to enable traffic to flow between external networks and the OVN overlay using RHEL kernel networking, without requiring Layer 2 connectivity between nodes.
Technical Components¶
The load balancing implementation includes these key components:
Route Advertisement: The OVN BGP agent identifies routes to advertise: * Virtual IP addresses for OpenStack services * Provider network endpoints * Floating IP addresses
Multiple BGP Peers: Configuration with multiple Top-of-Rack switches:
# Multiple BGP peers configuration router bgp 64999 neighbor 192.168.1.1 remote-as 65000 # ToR Switch 1 neighbor 192.168.2.1 remote-as 65000 # ToR Switch 2 address-family ipv4 unicast network 10.0.0.0/24 # Advertise network to both peers exit-address-family
VIP Failover: When a node fails, the OVN BGP agent: * Removes VIP advertisement from the failed node * Triggers advertisement from a healthy node * External routers automatically update routing tables
Advanced Traffic Engineering¶
Red Hat OpenStack Platform supports traffic engineering through BGP attributes:
AS Path Prepending: Influence path selection:
# Make a path less preferred router bgp 64999 address-family ipv4 unicast neighbor 192.168.1.1 route-map PREPEND out exit-address-family route-map PREPEND permit 10 set as-path prepend 64999 64999
BGP Communities: Tag routes for selective routing:
# Set community values router bgp 64999 address-family ipv4 unicast network 10.0.0.0/24 route-map SET-COMMUNITY exit-address-family
- route-map SET-COMMUNITY permit 10
set community 64999:100
BFD Integration: Fast failure detection:
# Enable BFD router bgp 64999 neighbor 192.168.1.1 bfd neighbor 192.168.2.1 bfd
Monitoring¶
Commands to monitor BGP load balancing status:
# Check BGP peers status
$ sudo podman exec -it frr vtysh -c 'show bgp summary'
# View active routes and next-hops
$ sudo podman exec -it frr vtysh -c 'show ip bgp'
# Verify ECMP routes
$ sudo podman exec -it frr vtysh -c 'show ip route'
These commands help administrators verify that load balancing is functioning correctly and troubleshoot any issues that might arise.