POPs and anycast — one IP, many doors
Every POP advertises the same IP; the internet's BGP routing fabric — not a CDN dispatcher — delivers each user's packets to the topologically-nearest POP.
Edges only help if users actually land on a nearby one — so how does a user in Sydney find Sydney's edge with no load balancer in the middle?
Scene 03
POPs and anycast — one IP, many doors
- Watch
- Try it
- Predict
- Capture
A user in Sydney fires a request to 104.16.0.1. Notice every POP on the map advertises the same IP. The user's ISP picks the shortest BGP path — that's the Sydney POP, ~15 ms away.
Highlighted lines are the ones running in the diagram right now.
def resolve(name):# cdn.example.com -> 104.16.0.1 for EVERYONE# no geo-IP lookup, no per-region answerreturn ANYCAST_VIP # 104.16.0.1
def routePacket(pkt):# bgp_table[prefix] -> list of (nextHop, asPath)routes = bgp_table[pkt.dstPrefix] # 104.16.0.0/24best = min(routes, key=lambda r: len(r.asPath))forward(pkt, nextHop=best.nextHop)# The CDN never saw this decision. Each ISP made# it independently from its own BGP table.
def comeOnline():# tell upstream peers 'I have a path to 104.16.0.0/24'bgp.announce(ANYCAST_PREFIX, asPath=[self.asn])def goOffline():# withdraw the route — peers stop seeing usbgp.withdraw(ANYCAST_PREFIX)# ISPs recompute; users land on next-shortest POP.# No client change. No DNS change. No CDN dispatcher.
Where this sits in Build a CDN
Scene 03 of 13, in the Edge basics act — The request journey, origin pain, an edge near each user, POPs and anycast.. Every POP advertises the same IP; the network's BGP routing fabric, not a CDN dispatcher, picks which edge each user reaches.
Up next. The user is now reaching a nearby POP — but how long does that POP hold the cached copy before checking origin again?