Vašek's blog

Modern networking infrastructure is awesome

Today, I've been sitting on a bus a German highway when a friend of mine wrote me. He asked me to start a web service that I experimentally hosted on my laptop couple of days ago. I started it and everything just worked.

Wait a second! How is his web browser accessing my laptop? It's "super simple". Let me explain:

  1. The browser located in Czechia opens a connection to example.vsq.cz.
  2. The packets travel to Warsaw, where they reach my hacky gateway server running on fly.io. There are actually 2 servers running with the same anycast IP, so one of them is picked and receives the connection.
  3. The server in Warsaw accepts the connection, figures out that it does not know what to do with it and forwards it over Tailscale VPN to my home server in Munich, Germany.
  4. The home server, running in a VM on a crappy PC I bought from ebay, terminates the TLS connection and also figures out, that it can't handle the request. So it forwards it again over the Tailscale VPN to my laptop.
  5. My laptop is driving around 130kmh on a highway and is connected to the internet through a mobile hotspot on my phone. It receives the connection and sends it to a locally running Docker container.
  6. The Docker container runs a server, which can't do much on it's own. So it processes the request by calling an API running somewhere in the cloud.

... from the cloud, the result flows back. To my laptop on the highway over cellular network. Back to my home server in Germany over a residential connection, then to Fly.io in Poland, then to the web browser.

I am just in awe that everything works just fine. The overall experience is snappy. Yes the latency could be better, but that's about the only complaint I have.

Don't get me wrong, I know that there are way more complicated data pathways out there in the world. Some connections over geostationary satellites take longer routes. But I still find it amusing that I didn't have to think about much and everything just worked flawlessly. Congrats to all the networking engineers that made this possible.

Thoughts? Leave a comment