Architecting BGP Anycast Routing Nodes (6938)
Technical Overview
Engineering breakdown of Architecting BGP Anycast Routing Nodes (6938). Bare-metal hardware performance requires isolated kernel parameters, dedicated NIC queues, and careful IRQ affinity. At Votion Cloud we run a fleet of 6938-series nodes across 12 metros, each announcing identical /24 prefixes via eBGP to upstream transit providers. The anycast design ensures that user traffic lands on the topologically closest node, reducing latency and providing automatic failover when a node withdraws its routes.
Key Constraints
- State synchronization: Anycast works best for stateless services (DNS, CDN edge, load balancers). For stateful workloads, combine with a distributed data plane (e.g., CRDTs, Raft).
- Route propagation delay: BGP convergence across multiple upstreams can take 30–90 seconds. Design health-checks to withdraw routes within 5 seconds of local failure.
- Asymmetric routing: Return paths may differ. Ensure firewalls and connection tracking are symmetric or disabled for anycast traffic.
Anycast Design Principles
Prefix Strategy
Announce a /24 per service per region. Aggregate at the regional border router to a /20 for upstream peers, but keep the /24s intact on the anycast nodes themselves. This allows granular withdrawal without affecting sibling services.
Node Placement
Deploy nodes in at least three geographically diverse PoPs per continent. Use latency-based DNS (e.g., Route 53 latency records) as a fallback for clients that cannot rely on BGP anycast (e.g., some mobile carriers).
Failure Domains
Each node must be in a separate power, cooling, and network failure domain. Avoid sharing top-of-rack switches between anycast nodes of the same service.
Capacity Planning
Size each node for 1.5x peak regional traffic. During a regional outage, traffic shifts to the next-closest node; headroom prevents cascade failures.
BGP Configuration & Tuning
FRR / Bird Template
We standardize on FRR (Free Range Routing) for Linux-based nodes. Below is a hardened configuration snippet used on all 6938 nodes.
Critical Timers
timers bgp 3 9– aggressive keepalive/hold for fast failure detection.bgp graceful-restart– preserves forwarding plane during control-plane restarts.bgp bestpath as-path multipath-relax– enables ECMP across upstreams with different AS paths.
Route Maps
Apply inbound route-maps to tag routes with community 6938:100 (anycast-node). Outbound maps prepend AS_PATH 3x for backup nodes, ensuring primary nodes are preferred.
Health Checks & Automated Withdrawal
Each node runs a local health-check daemon (written in Go) that monitors:
- Application liveness (HTTP 200 on /healthz)
- System metrics: CPU steal < 5%, disk latency p99 < 10ms
- BGP session state (Established with ≥2 upstreams)
- Flowspec DDoS mitigation activation
On any check failure, the daemon calls vtysh -c "configure terminal" -c "no network 198.51.100.0/24" to withdraw the prefix instantly. A separate watchdog re-announces after 5 consecutive healthy intervals (30s each).
Chaos Engineering
We run weekly bgp-anycast-failover drills using the Votion CLI (see below) to validate withdrawal/re-announcement latency and client impact.
eBPF/XDP kernel filter evaluates TCP/UDP frames directly on server NIC.
Operational Best Practices
Monitoring Stack
- BGP: ExaBGP + Prometheus exporter for per-peer RIB metrics.
- Data plane: eBPF-based XDP counters for per-prefix packet rates.
- Synthetic: RIPE Atlas probes measuring anycast latency from 500+ vantage points.
Incident Response
- Alert on
bgp_session_down > 1for > 30s. - Auto-withdraw via health daemon (already described).
- Runbook:
votion anycast drain --node fra-6938-03 --reason maintenancegracefully shifts traffic. - Post-mortem: correlate BGP updates with synthetic latency delta.
Future Work
Evaluating BGPsec for route origin validation and SRv6 for programmable anycast steering. Also prototyping a control-plane mesh using gRPC to synchronize withdrawal decisions across nodes in < 200ms.