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.
Kadé’s Google Cloud project, as you find it. Five things are wrong.
- The default network is still there, open to the internet.
- SSH on tcp:22 is open to 0.0.0.0/0.
- Web ports 80, 443 and 8080 are open to everyone.
- Internal traffic is allowed on every port.
- kade-api has no external IP and no NAT, so it cannot reach PayGate.
Try five stepsFive steps of that request.
You learn it by trying it. The two courses hold 158 figures you can change by hand. Here are five small ones, one for each step Kadé’s request takes, in order. Each chapter goes much further.
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.
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.
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.
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.
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.
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.
Where is api.kade.lk?
Before anything is sent, the laptop needs an address. Look the name up, look again a minute later, then once the answer's 300 s TTL has run out.
Taught in chapter 22, DNS: how resolution works
Read the chapterThree servers asked before the laptop gets 34.120.88.10. Each one only knows who to ask next.
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.Networking fundamentalsFrom a fetch() call to bytes on the wire, and beyond.34 chapters · 4.5 hours of reading
- 2.Networking on GCPKadé's network, from inside the Google Cloud project. Continues the fundamentals course.26 chapters · 5 hours of reading
- 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.
Solid boxes exist today. Dashed boxes join the map when a chapter needs them.
Wide by design - scroll it sideways.
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. Find it
harbour-api is fronted by a load balancer, but its run.app URL still answers the internet.
2. Put it in order
D6 closes in phase 3, Close the bypasses, together with D8. Nothing has to close before it.
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.
harbour-api is fronted by a load balancer, but its run.app URL still answers the internet.
gcloud run services describe harbour-api \ --region=asia-southeast1 \ --format=yaml | grep ingress # then confirm the bypass actually answerscurl -sI https://harbour-api-xxxx.a.run.app/ \ | head -1