Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Render 11 min read How-to mediumAdept

How to Build an Anycast Network

An anycast network advertises the same IP prefix from multiple servers worldwide so BGP routes each user to the nearest healthy point of presence, giving lower latency and automatic failover when a node stops sending keep-alives. Render uses a single anycast IP for custom domains, forwarding requests to web service origins or to nearby CDN edges for static sites. Building one takes four steps: get an ASN from a Regional Internet Registry such as ARIN (multi-homing is a valid justification), buy or lease at least a /24 IPv4 or /48 IPv6 block and check it against blocklists, choose BGP-capable hosts such as Vultr, and configure a BGP daemon like BIRD to peer and announce the route. Fewest-hops routing isn't always fastest, so traffic may need tuning with BGP communities and AS-path prepending.

Related posts

  • Traffic 101: Packets Mostly Flow

    Slack Engineering mediumAdept

    A Slack request reaches its main region in AWS us-east-1 through a chain of hops. DNS answers come from Route53, or from NS1 for websocket records, and use edns-client-subnet to pick the nearest edge PoP. From there, Layer 4 NLBs pass traffic to Envoy-based Layer 7 tiers (envoy-wss for websockets, envoy-edge for API traffic), which route to internal services like Gatewayserver, Applink, Flannel, Imgproxy and Supra/Miata. Traffic from a PoP to the main region rides the AWS backbone, encrypted by Nebula. Failure handling is layered: a backup websocket domain uses an NS1 filter chain that shuffles among the three nearest regions to avoid thundering herds, a Degraded Mode falls back to the HTTP API when websockets fail, an Edge Pop Drain tool flips DNS to drain unhealthy PoPs automatically, and CloudFront has a backup CDN domain with client-side failover.

  • How DeepL keeps closest-exit routing during maintenance with AWS Cloud WAN

    AWS Architecture Blog hardMaster

    DeepL drains a single AWS Direct Connect link for maintenance by prepending AS_PATH on that link's virtual interface. The prepend shifts only the affected Region's egress to a peer core network edge, and every other Region keeps its closest exit. Local preference communities don't work for this because the Direct Connect gateway evaluates them before AS_PATH, and they would re-rank exits for all Regions at once. The core network edge, by contrast, picks paths by AS_PATH length. Use at least two prepends (DeepL uses five), since one prepend ties and Cloud WAN then still prefers the gateway path. Lower on-premises local preference so inbound traffic moves too, keep flows symmetric if a stateful firewall sits in the path, and budget for inter-Region transfer charges during the drain.

  • How Mux Routed Around a Major Network Outage | Mux

    Mux mediumAdept

    During the June 24 Verizon BGP route leak (AS701), Mux Video's dynamic CDN selection, built on Citrix ITM and Radar RTT data, automatically shifted affected viewers from Fastly to Stackpath/Highwinds. Fastly RTT on AS701 jumped from 11ms to 80ms while Highwinds rose only from 12ms to 26ms, which overrode a cost-based handicap favoring Fastly. The cutover was limited to the impacted ASNs and geographies, and because Highwinds still pulled through the Fastly origin shield, origin egress did not increase.

  • Throwing Out The Phonebook

    Fly.io hardMaster

    Fly.io rebuilt 6PN, its private IPv6 network between Fly Machines, replacing a fleet-wide eBPF map of every migrated Machine's location (hundreds of thousands of entries kept in sync from Corrosion's gossip-replicated SQLite) with lazy, on-demand routes. VXLAN's netlink event for unknown addresses is passed through drift-agent to s6pnforwarderd, which queries local Corrosion and installs a single kernel route. Each host now carries only 100–200 routes, addresses no longer need rewriting, and routes can forward through intermediate hosts to tolerate stale entries or steer around bad links. udp-xdp now only validates same-network traffic and sets an fwmark so the design fails closed. The costs are a roughly one-second first-connection delay from TCP retransmission and broken new conversations if the daemons crash. The migration ran both paths side by side behind per-host flags, tolerating asymmetric routing.

  • How OpenAI delivers low-latency voice AI at scale

    OpenAI hardMaster

    OpenAI rearchitected its WebRTC stack for ChatGPT voice and the Realtime API by splitting a stateless UDP relay from a stateful Go/Pion transceiver that owns ICE, DTLS and SRTP state. The design avoids one-public-port-per-session media termination, which fits poorly with Kubernetes and cloud load balancers. Server-generated ICE ufrags encode routing hints, so the relay can steer the first STUN packet to the owning transceiver without an external lookup. Relay flows are kept in memory with Redis as a backup, and Cloudflare geo-steered signaling plus a globally distributed relay fleet shorten the first hop and cut setup latency.

The quest for software engineering knowledge.

Look:
Layout: