Lição 06 · Unit 2 · Networking for a Backend Engineer & Application Support
The Failure Alphabet
Almost every "A can't reach B" ticket is one of five failure signatures. Name the signature and you've named the mechanism, the usual culprit, what it rules out, and which tool to reach for next. This is the alphabet the rest of the course is written in — learn it cold.
The two you'll meet most: refused vs timeout
Both mean "curl couldn't connect." Underneath they are opposites. Run them:
curl -v http://127.0.0.1:9999/ # nothing is listening there* Trying 127.0.0.1:9999...
* connect to 127.0.0.1 port 9999 failed: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 9999curl -v --connect-timeout 3 http://10.255.255.1/ # a black hole* Trying 10.255.255.1:80...
* ipv4 connect timeout after 3000ms, move on!
curl: (28) Failed to connect to 10.255.255.1 port 80Same goal, two different worlds — and you already know why from the last lesson:
- refused — exit
(7) - An
RSTcame back. The host is up, the packet arrived, nothing is listening. This rules out the network path and the firewall. Culprit: service down, or wrong port. Next:ss -tlnpon the target. - timeout — exit
(28) - Silence — no reply at all. The packet was dropped: firewall, routing, or a dead host. This rules out "actively refused". Next: is the host even up? is a firewall dropping it?
The full alphabet
| Signature | Mechanism | Usual culprit | Next tool |
|---|---|---|---|
| refused | RST from a closed port | service down / wrong port | ss -tlnp |
| timeout | packet silently dropped | firewall, routing, dead host | is the host up? path? |
| reset | RST mid-stream | idle timeout, crash, proxy | logs, capture (Unit 9) |
| hang | connected, no reply comes | app stuck, or reply lost | curl -w TTFB (Unit 1) |
| resolves-wrong | name → wrong IP / no IP | DNS record, resolver, cache | dig (Unit 3) |
The curl exit code names three of these on sight:
curl: (6)- Couldn't resolve host — resolves-wrong (a DNS problem, deep-dived in Unit 3).
curl: (7)- Couldn't connect — refused (an
RSTcame back from a closed port). curl: (28)- Timed out — timeout (silence; the packet was dropped on the way).
curl: (7) ... Connection refused. Which suspect is now ruled out?
A curl sat for 30s, then failed with exit (28). What happened on the wire?
A connection was healthy, then died mid-download with an RST. Which signature is it?
Which signature sends you straight to dig instead of curl or ss?
Keep it on your desk: Failure Alphabet reference.
Then drill it in the app once /author-bank has built Unit 2's questions —
symptom → mechanism → rules-out → next tool is exactly what the Bank grades.
everything curl — Exit codes
by Daniel Stenberg. The authoritative list; 6, 7, 28, 35, and 56 are
the ones you'll read on call.
Sou seu professor — traga suas perguntas difíceis de “mas por quê”. Exporte seu progresso na página do curso e cole no /teach.