BNK
One name, three factories
How GSLB sends a caller to one site
The other lessons happen inside one factory. A real service runs in several: here Frankfurt, Amsterdam and Madrid, each with its own GPUs and its own address. Callers still know a single name. Something has to decide which factory a caller reaches, before any packet of the request exists. That decision is made in DNS. The server that answers for the name does global server load balancing, GSLB for short: it knows every site, keeps checking them, and answers each lookup with the address of the one that should take this caller right now. Inside the chosen factory, BNK then picks the GPU. Two tiers, two different questions.
- One name
- api.northlight.example
- Three factories
- Frankfurt · Amsterdam · Madrid
- Tier 1 · which site
- F5 DNS, with GSLB
- Tier 2 · which GPU
- BNK and the endpoint picker, inside the site
Read the whole lesson as text
1. One name
A user in Lisbon opens the chat app. The same would be true of an agent or a backend service: all of them are configured with a name, not an address. The browser asks the resolver of the user's internet provider for the IP address of api.northlight.example. The resolver doesn't know it. It has to find the DNS server that is responsible for this name and ask there.
- The browser asks its resolver for the address of the factory's name.
2. The resolver asks F5 DNS
The zone northlight.example hands this one name over to a different server: ns1.northlight.example, which is F5 DNS. That handover is what puts GSLB in charge of the name. The resolver sends its question there. It adds one detail that matters a lot: the network the user is in. Without it, F5 DNS would only see the resolver's own address, and a resolver can be far from its users. With it, the answer can depend on where the caller really is.
- The resolver asks F5 DNS, the server in charge of this name, and tells it which network the user is in.
3. What gslb knows
F5 DNS doesn't start investigating when the question arrives. It already knows the state of every factory, because it checks them all the time with monitors. A monitor is a small test request that F5 DNS sends to a site's address every few seconds. Here it asks each factory two things: are you up, and how much room do you have. Frankfurt answers and has room. Amsterdam answers, but its GPU pools are almost full. Madrid, the factory closest to Lisbon, doesn't answer at all.
- Its last check of Frankfurt came back healthy, with plenty of free GPU capacity.
- Amsterdam is up too, but its GPU pools are nearly full.
- Madrid has not answered its last three checks, so F5 DNS has marked it down.
4. The decision
Now F5 DNS answers the question. In its configuration the name is a wide IP: one name with a pool of members, one member for each factory's address. It goes through them in order. First the rules that are never broken: this customer's data must stay in the European Union, so a factory outside it is not a candidate at all. Then health: Madrid is down. Then the caller's location, from topology records that map networks to regions: Lisbon is nearest to Madrid, then Frankfurt and Amsterdam. Then capacity: Amsterdam has almost none. Frankfurt is what remains. It is not the closest factory. It is the closest one that can do the work.
- F5 DNS rules out the factories that may not or can not take this caller, and picks Frankfurt.
- It answers with Frankfurt's address, and says the answer is good for 30 seconds.
- The resolver passes the address on to the browser and keeps it for 30 seconds.
5. To frankfurt
The browser now has an address and opens a connection to it. From here on DNS plays no part. The packets go to Frankfurt because the internet's routers know the way to 203.0.113.80: the Frankfurt factory announces the address block it belongs to with BGP. F5 DNS never sees the request, the prompt or the answer. It chose the site and stepped aside.
- The browser opens a TLS connection to the address it was given: the Frankfurt factory.
6. Inside the factory
Zoom into Frankfurt. This is the factory of the other lessons, and the connection lands where every request does: on the BNK data plane at its border. Everything after this is the second tier of the decision. The gateway works out who is calling and which model answers. The endpoint picker chooses a GPU. GSLB chose among three sites on what it could learn from outside. The picker chooses among GPUs on what it knows from inside: their queues and their KV caches.
- The request itself arrives at the factory's border, and the factory's own decisions begin.
7. A factory fails
Zoom back out, and suppose Frankfurt loses its uplink a minute later. F5 DNS notices after three missed checks and marks Frankfurt down. It can't call anyone back. All it can do is answer the next question differently. Resolvers that still hold the old answer keep handing it out until its 30 seconds are over. Then they ask again and get Amsterdam, which is full but alive. So the gap a caller can see is the time to notice plus the lifetime of the answer. A request that was streaming from Frankfurt when it failed is lost, and the caller has to send it again. That is the trade in the lifetime: short answers move callers quickly and cost more lookups.
- A minute later Frankfurt stops answering its checks. After three misses F5 DNS marks it down.
- The resolver's cached answer runs out, and the next caller makes it ask again.
- With Madrid and Frankfurt down, F5 DNS answers with Amsterdam. Full is better than gone.
Summary
One name can lead to many factories because the choice is made in DNS, before the request exists. F5 DNS keeps a picture of every site from its monitors and answers each lookup with one address: the nearest factory that is allowed to serve this caller, is healthy and has room. Then it is out of the way, and BNK inside the factory picks the model and the GPU. When a site fails, DNS can only change its next answer, so callers move over as their cached answers expire. Both tiers need the same thing to decide well: live knowledge of how busy the GPUs are, not just whether a server is up.
Next lesson: A request through the factory