Scaling BGP Anycast Routing Nodes (2119)
Executive Summary
Votion Cloud operates one of the planet's largest anycast footprints—2,119 BGP-speaking routing nodes across 87 countries—delivering authoritative DNS, CDN edge, and DDoS scrubbing with a median failover time of 38 ms. This article dissects the kernel, control-plane, and observability layers that make that scale possible.
1. Kernel-Bypass Data Plane
Traditional Linux networking stacks introduce ~15 µs per-packet overhead at 100 Gbps. We bypass the kernel entirely using XDP (eXpress Data Path) + AF_XDP zero-copy sockets, pinning each RX queue to a dedicated physical core via taskset and irqbalance disable.
// XDP program: early drop for bogon / martian prefixes
SEC("xdp")
int xdp_bogon_filter(struct xdp_md *ctx) {
void *data_end = (void *)(long)ctx->data_end;
void *data = (void *)(long)ctx->data;
struct ethhdr *eth = data;
if ((void *)eth + sizeof(*eth) > data_end) return XDP_PASS;
if (eth->h_proto != bpf_htons(ETH_P_IP)) return XDP_PASS;
struct iphdr *ip = data + sizeof(*eth);
if ((void *)ip + sizeof(*ip) > data_end) return XDP_PASS;
__be32 src = ip->saddr;
if (bogon_check(src)) return XDP_DROP; // 3.2 ns lookup in BPF map
return XDP_PASS;
}Result: 2.1 Mpps/core at 64-byte frames with 99.999% tail latency < 8 µs.
2. Control-Plane: RIB Sharding & Graceful Restart
Each node runs GoBGP with a custom RIB sharding patch: the global table (≈ 950 k IPv4 + 180 k IPv6 prefixes) is split into 64 shards, each owned by a goroutine. BGP graceful-restart (RFC 4724) with stale-path-time 300 ensures zero traffic loss during daemon upgrades.
3. RPKI & ASPA Validation at Line Rate
We validate every inbound UPDATE against a local RPKI-RTR cache (RFC 8210) refreshed every 60 s. Invalid AS_PATHs are tagged with community 65535:666 and dropped in XDP before reaching the RIB. ASPA (RFC 9234) enforcement prevents route-leak propagation across 2,119 nodes in < 200 ms.
4. DDoS Mitigation: Synproxy + Flowspec
SYN flood protection uses kernel tcp_synproxy (since 5.10) offloaded to XDP. For volumetric attacks, we inject BGP FlowSpec rules (RFC 5575) via a dedicated GoBGP peer group; rules propagate to all 2,119 nodes in < 1.2 s median.
5. Telemetry Pipeline: eBPF → Kafka → ClickHouse
Per-packet metadata (src/dst IP, ASN, prefix, action) is pushed via bpf_perf_event_output to a userspace collector writing to Kafka (topic bgp.xdp.events). ClickHouse materializes 15-second rollups for Grafana dashboards and ML-based anomaly detection.
eBPF/XDP kernel filter evaluates TCP/UDP frames directly on server NIC.