Learn how networks work. Then fix one that doesn’t.

Two courses and a case study, in order. Follow one request from a laptop to a server, see how Google Cloud does the same job, then take apart a platform I built wrong on purpose. Free, with no sign-up.

Shoppersapp + websiteCloud DNS→ 34.120.88.10Load balancer34.120.88.10:443TLS ends herePayGateonly 34.87.200.75no NAT, no replykade-vpc · 10.10.0.0/16sn-app · 10.10.1.0/24kade-api-110.10.1.10:8080kade-api-210.10.1.11:8080sn-data · 10.10.2.0/24kade-db (PostgreSQL)10.10.2.5:5432

Kadé’s Google Cloud project, as you find it. Five things are wrong.

  1. The default network is still there, open to the internet.
  2. SSH on tcp:22 is open to 0.0.0.0/0.
  3. Web ports 80, 443 and 8080 are open to everyone.
  4. Internal traffic is allowed on every port.
  5. kade-api has no external IP and no NAT, so it cannot reach PayGate.

Five steps of that request.

The stops Kadé’s request makes on its way, in order. Each one is a figure you can change by hand in the chapter that teaches it.

  1. Resolve a name

    Where is api.kade.lk?

    Three servers are asked before the laptop gets 34.120.88.10. Each one only knows who to ask next.

    Try it in chapter 22

  2. Leave home

    How does a private address reach the internet?

    The router swaps the private source for its own public address and a free port, 40001, and writes the pair down.

    Try it in chapter 10

  3. Cross the load balancer

    Which VM gets the request?

    A firewall clean-up removed the rule for the health-check probes. Both VMs looked unhealthy while the app was fine, and Kadé’s shop was down for twenty minutes.

    Try it in GCP chapter 12.1

  4. Pass the firewall

    Will the firewall let it in?

    kade-allow-ssh lets anyone on the internet try SSH. Allowed, and that is a problem: GCP chapter 6.1 closes it with IAP.

    Try it in GCP chapter 5.1

  5. Reach the database

    Is kade-db on the same network?

    With a /24 mask, 10.10.1.10 and 10.10.2.5 are on different networks, so the packet goes to the gateway, not straight across.

    Try it in chapter 4

Three stages, in this order.

The courses teach and the case study puts it to work. Each stage uses what the one before it taught, and every defect in the case study links back to the chapter that explains it.

  1. 1.Networking fundamentalsFrom a fetch() call to bytes on the wire, and beyond.34 chapters · 4.5 hours of reading
  2. 2.Networking on GCPKadé's network, from inside the Google Cloud project. Continues the fundamentals course.26 chapters · 5 hours of reading
  3. 3.Case study: HarbourA small marketplace on Google Cloud, built the way real platforms get built: one reasonable shortcut at a time. Read how it works, follow its traffic, then take apart the 17 things wrong with it.6 packet journeys · 17 defects

One small company, from the first packet to the cloud.

Both courses follow Kadé, an online grocery shop in Colombo, and you are its backend engineer. The fundamentals assume no networking background. The GCP course opens Kadé’s Google Cloud project and shows how its network really works.

Then see it in a real platform.

Harbour is a marketplace on Google Cloud with 17 defects planted on purpose. Follow its traffic through 6 packet journeys, as found and fixed, then take each defect apart. Knowing each fix is the easy half: the fixes block each other, so the order is the argument.

Here is one of them, D6, followed from finding to fix.

  1. 1. Find it

    harbour-api is fronted by a load balancer, but its run.app URL still answers the internet.

  2. 2. Put it in order

    D6 closes in phase 3, Close the bypasses, together with D8. Nothing has to close before it.

  3. 3. Fix it

    --ingress=all becomes --ingress=internal-and-cloud-load-balancingOnly the LB and the VPC can reach it.

I’m Thirana, and I broke Harbour on purpose.