Architecture Layering Cheatsheet
Debug any infrastructure problem by knowing which layer you’re in — and which tools belong there.Why Layers Matter
Every infrastructure failure lives at a specific layer. The reason most debugging sessions take hours instead of minutes is layer confusion — using Layer 7 tools to debug a Layer 3 problem, or blaming DNS when it’s actually TCP, or assuming the application is broken when the auth protocol changed underneath it. This cheatsheet gives you the tools, the commands, and the mental model to locate the failure layer in minutes. It was born from a real debugging session where an SSH connection failed silently across five layers, with no error at any single one. The rule: Work bottom-up. Confirm each layer is clean before moving to the next. The bug lives at the first layer that breaks — or between two layers that individually look fine.The Full Stack: 7 Layers, 4 Languages
Each layer in a network stack can be debugged using tools from different language ecosystems. The layering patterns are consistent across languages, but the tools and failure modes differ. Plain English: This is the full debugging stack. Start at the bottom (is the cable plugged in? is WiFi connected?), move up through IP routing (can packets reach the host?), TCP (can a connection be established?), protocol-specific auth (is the handshake completing?), TLS/session (is encryption negotiating?), and finally the application itself. Each layer has tools in each language ecosystem. The arrow direction shows the debugging order — always start from the bottom.Layer-by-Layer Reference
Layer 1: Physical
“Is the wire connected?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| Interface up | ip link show | state UP | Cable/WiFi disconnected |
| WiFi signal | iwconfig or nmcli | Signal strength > -70 dBm | Move closer to AP |
| DC status | Provider status page | All green | Wait or call support |
Layer 2: Data Link
“Can frames reach the next hop?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| ARP resolution | arp -n or ip neigh | Gateway MAC visible | L2 isolation, VLAN issue |
| MTU | ip link show dev eth0 | 1500 (or your configured value) | Jumbo frame mismatch |
| Path MTU | ping -M do -s 1472 <host> | Replies received | MTU blackhole on path |
Layer 3: Network / IP
“Can packets reach the destination?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| Reachability | ping <host> | Replies received | Routing or firewall |
| Route path | traceroute <host> | Complete path, no * * * | Hop dropping packets |
| Route + latency | mtr <host> | Consistent latency, no loss | Congestion or blackhole |
| DNS resolution | dig <host> +short | IP address returned | DNS misconfiguration |
| Reverse DNS | dig -x <ip> | Hostname returned | PTR record missing |
vps.devarno.cloud pointing to 187.124.113.147. Before this, the hostname didn’t resolve at all — looked like a server problem, was actually a DNS problem.
Layer 4: Transport / TCP
“Can a connection be established?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| TCP connect | nc -zv <host> <port> | ”Connection succeeded” | Port closed or filtered |
| TCP connect (timeout) | nc -zv -w5 <host> <port> | Success within 5s | Firewall dropping SYN |
| Open ports (local) | ss -tlnp | Port listed and LISTEN | Service not running |
| Open ports (remote) | nmap -sT <host> -p <port> | ”open” | Firewall or service down |
| TCP dump | tcpdump -i any port <port> | SYN/SYN-ACK/ACK visible | Handshake failing |
nc fails but ping works. Or connections establish but reset immediately.
Layer 5: Auth / Protocol Negotiation
“Is the handshake completing?” This is the layer most people skip — and where the ghosts live.| Check | Command | Expected | Failure Means |
|---|---|---|---|
| SSH verbose | ssh -vvv user@host | ”Authentication succeeded” | Key/password/method issue |
| SSH server debug | sshd -d -p 2222 | Full handshake log | See what server receives |
| SSH auth method | Check for publickey-hostbound-v00 | Standard publickey | New OpenSSH extension |
| TLS handshake | openssl s_client -connect host:443 | Certificate chain shown | Cert/cipher mismatch |
publickey-hostbound-v00@openssh.com. The server accepted our key, but the signed auth response packet — larger than the key exchange packets — was silently dropped by a middlebox on the network path. Paramiko (using traditional publickey) connected instantly. The protocol layer was the problem.
Layer 6: Presentation / Session (TLS, Encryption, Encoding)
“Is the encrypted channel working?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| TLS cert valid | openssl s_client -connect host:443 2>/dev/null | openssl x509 -noout -dates | Valid dates | Expired cert |
| TLS version | openssl s_client -connect host:443 -tls1_3 | Handshake succeeds | TLS version mismatch |
| Cipher suites | nmap --script ssl-enum-ciphers -p 443 host | Strong ciphers listed | Weak/unsupported ciphers |
| Certificate chain | openssl s_client -showcerts -connect host:443 | Full chain to root CA | Missing intermediate cert |
| SSH key exchange | Check ssh -v for kex lines | Algorithm agreed | Incompatible algorithms |
Layer 7: Application
“Is the app doing what it should?”| Check | Command | Expected | Failure Means |
|---|---|---|---|
| HTTP status | curl -sI <url> | 200 OK (or expected code) | App error |
| Response body | curl -s <url> | head -20 | Expected content | Logic error or empty response |
| Health endpoint | curl -sf <url>/healthz | 200 | Service unhealthy |
| API auth | curl -H "Authorization: Bearer $TOKEN" <url> | Authenticated response | Token/credential issue |
| DNS + HTTP | curl -v <url> | Full negotiation log | Multi-layer visibility |
The Debugging Flowchart
Plain English: Start at the top: can you even reach the machine? If not, it’s a low-level network issue. If you can reach it, can you open a connection on the right port? If not, it’s a firewall or service issue. If you can connect, does the security handshake complete? If not, it’s a protocol/auth issue (this is where our SSH ghost packet lived). If the handshake works, it’s an application problem. Follow the arrows — you’ll find the layer in four questions.Quick Reference: Tools by Scenario
”I can’t connect to anything"
"I can ping but can’t connect to the service"
"Connection establishes but auth fails"
"SSH specifically: ‘Connection closed [preauth]‘"
"It works locally but not from CI/CD or another server”
Language Comparison: Connection Debugging Patterns
The Same Bug, Four Ways
This table shows how you’d diagnose a “connection works, auth fails” problem in each ecosystem:| Step | Bash/OpenSSH | Python | Node.js | Go |
|---|---|---|---|---|
| TCP test | nc -zv host 22 | socket.create_connection() | net.connect() | net.DialTimeout() |
| TLS test | openssl s_client | ssl.wrap_socket() | tls.connect() | tls.Dial() |
| SSH connect | ssh -v | paramiko.SSHClient() | ssh2.Client() | ssh.Dial() |
| Auth method | Reads ~/.ssh/config | Explicit in .connect() | Explicit in .connect() | Explicit in ClientConfig |
| Key format | OpenSSH native + PEM | PEM, OpenSSH (paramiko 2.10+) | PEM, OpenSSH | PEM, OpenSSH |
| Debug output | -v / -vvv flag | logging.basicConfig(level=DEBUG) | debug: console.log in config | Custom ssh.Logger |
Key Insight: Library vs. System Implementation
This is the lesson that burned four hours into my memory:| Property | System SSH (OpenSSH) | Library SSH (paramiko/ssh2/x-crypto) |
|---|---|---|
| Auth default | publickey-hostbound-v00 (10.2+) | Traditional publickey |
| Packet size | Larger (host-key binding included) | Standard |
| Config source | ~/.ssh/config, system sshd_config | Programmatic only |
| Middlebox risk | Higher (new extension, unfamiliar packets) | Lower (well-known packet format) |
| Best for | Interactive use, standard admin | Automation, CI/CD, middlebox-hostile paths |
Infra Patterns: Boxes and Arrows
Every architecture diagram has two types of elements: boxes (services, servers, databases) and arrows (connections between them). Most debugging guides focus on the boxes. This cheatsheet focuses on the arrows. Plain English: This is a real architecture. n8n (our orchestration brain) sends a webhook, which eventually needs to SSH into a VPS to run Claude Code CLI. The red and orange boxes are the network path — the middleboxes and transit providers that sit between the two services. These are invisible in most architecture diagrams, but they’re where our ghost packet was dropped. Lesson: When you draw architecture diagrams, the arrows are not free. Each arrow crosses real network infrastructure with real failure modes. The more arrows, the more ghosts.Campaign: Cross-Platform Strategy
Twitter/X Thread (4 tweets)
Tweet 1 (Hook):I made an infrastructure debugging cheatsheet that maps every network layer to its tools — in Bash, Python, Node, Rust, and Go. Born from 4 hours of debugging a ghost packet that vanished between two servers. Bookmark this. :thread:Tweet 2:
The flowchart: Can you ping it? No → Layer 1-3 Can you TCP connect? No → Layer 4 Does the handshake complete? No → Layer 5-6 Does the app respond? No → Layer 7 Four questions. That’s all you need.Tweet 3:
The insight that changed my debugging forever: When OpenSSH fails but paramiko succeeds with the same key to the same server — it’s not your key. It’s the PROTOCOL EXTENSION. OpenSSH 10.2+ uses a different (larger) auth packet. Some network paths drop it.Tweet 4 (CTA):
Full cheatsheet with mermaid diagrams, language comparisons, and copy-paste command blocks: [link] Plus the companion blog post telling the full debugging story: [link]
LinkedIn Post
Every infrastructure failure lives at a specific layer. I just published an Architecture Layering Cheatsheet — a practical guide to debugging any infrastructure problem by working through the network stack layer by layer. It maps each layer to its debugging tools across Bash, Python, Node, Rust, and Go. Includes a four-question flowchart that locates the failure layer in under a minute. Born from a real debugging session where an SSH connection failed silently — no error at any individual layer. The failure existed between layers, in the interaction between a new protocol extension and the network path. Bookmark it, print it, tape it to your monitor. The next time something breaks and “everything looks fine,” this will save you hours. [link] #DevOps #Networking #Debugging #InfraEngineering #Cheatsheet #SSH #Architecture
Instagram (Carousel — 8 slides)
- Cover: “ARCHITECTURE LAYERING CHEATSHEET” — clean, terminal-aesthetic design
- The Rule: “Work bottom-up. Confirm each layer before moving up.” — minimal text, bold
- Layer 1-3: Physical / Data Link / Network — key commands (ping, traceroute, dig)
- Layer 4: Transport — TCP debugging (nc, ss, tcpdump)
- Layer 5-6: Auth / TLS — the ghost layer (ssh -v, sshd -d, openssl)
- Layer 7: Application — app-level debugging (curl, health checks)
- The Flowchart: Simplified 4-question decision tree
- CTA: “Full cheatsheet with language comparisons at [link]” — save this post
Short-Form Video (45-60s)
Hook (0-5s): Whiteboard with 7 boxes stacked. “Every infra failure lives at one of these layers.” Body (5-45s): Fast marker-on-whiteboard walkthrough:- Cross out Layer 1 (“cable’s plugged in”)
- Cross out Layer 3 (“ping works”)
- Cross out Layer 4 (“TCP connects”)
- Circle Layer 5 in red (“THE HANDSHAKE. This is where the ghosts are.”)
- Show the four-question flowchart
Newsletter Section
New Reference: Architecture Layering Cheatsheet I’ve published the companion piece to this week’s debugging story — a practical cheatsheet that maps every network layer to its debugging tools across five language ecosystems. The core insight: work bottom-up, confirm each layer is clean before moving up, and when “everything looks fine” at every layer individually, look at the interactions between layers. That’s where the ghosts live. This is designed as an evergreen reference — the kind of thing you bookmark and pull up six months from now when something breaks at 3am. [Architecture Layering Cheatsheet →]
SEO Strategy: Making This the Reference
Target SERP Position
This cheatsheet targets informational intent queries where someone is actively debugging and searching for help. These are high-engagement, high-bookmark queries:| Target Query | Monthly Volume (est.) | Difficulty | Our Angle |
|---|---|---|---|
| ”ssh connection closed preauth” | ~2,400 | Medium | Direct solution + context |
| ”network debugging tools” | ~1,900 | High | Multi-language comparison (unique) |
| “osi model practical guide” | ~1,300 | Medium | Real debugging examples (not textbook) |
| “ssh debugging methodology” | ~800 | Low | Step-by-step with real story |
| ”infrastructure troubleshooting guide” | ~1,600 | High | Flowchart + cheatsheet format |
| ”tcp connection debugging linux” | ~900 | Medium | Copy-paste commands |
| ”paramiko vs openssh” | ~400 | Low | Direct comparison table |
| ”mtu troubleshooting” | ~700 | Low | When it matters + when it doesn’t |
| ”publickey-hostbound-v00” | ~100 (growing) | Very Low | First-mover SEO on new OpenSSH feature |
Content Structure for SEO
- H1: Architecture Layering Cheatsheet (matches “cheatsheet” queries)
- H2s: Each layer name (matches “Layer N debugging” queries)
- Tables: Scannable, featured-snippet friendly
- Code blocks: Copy-paste commands (matches “how to debug X” queries)
- Flowchart: Visual, shareable, linkable anchor
- Language comparison: Unique differentiator vs. existing cheatsheets (most are Bash-only)
- Real-world examples: Not textbook OSI — real failures from a real session
Backlinking Strategy
| Source | Action | Expected |
|---|---|---|
| Companion blog post | Links to cheatsheet as “the reference” | Internal link equity |
| GitHub README (atlas) | Link from docs index | Direct traffic |
| Dev.to cross-post | Republish with canonical URL | Community backlinks |
| Hacker News | Submit companion blog (story-first) | Discussion + organic links |
| Reddit r/sysadmin, r/devops | Post cheatsheet directly (value-first) | Community traffic |
| OpenSSH mailing list | Bug report referencing the publickey-hostbound finding | Authority backlink |
| Stack Overflow answers | Answer “connection closed preauth” questions, link to cheatsheet | High-intent referrals |
Schema Markup Recommendations
Virality Boosters
Emojis
- :mag: for debugging steps
- :ghost: for the ghost packet reference
- :bookmark: for “save this” CTAs
- :white_check_mark:/:x: for pass/fail in checklists
- :brain: for the mental model / flowchart
GIF Ideas
- “It’s a series of tubes” (Senator Stevens) — for the “arrows matter” section
- “Enhance” CSI zoom — for going layer by layer
- “I’m in” hacker movie trope — for when the flowchart finally locates the layer
Content Cadence Placement
Position: Evergreen reference (publish same week as companion blog post)| Piece | Type | Lifespan |
|---|---|---|
| The Packet That Never Arrived (blog) | Narrative/topical | 2-4 weeks of peak traffic, then long tail |
| This cheatsheet | Evergreen reference | Months to years — becomes the bookmarked resource |
Extra Opportunities
Spin-Off Content
- “Architecture Layering Cheatsheet: Cloud Edition” — AWS/GCP/Azure-specific tools per layer (VPC flow logs, Cloud Armor, etc.)
- “Architecture Layering Cheatsheet: Kubernetes Edition” — Pod networking, service mesh, CNI plugin debugging
- Printable PDF version — gated download for email list building
- Interactive web version — click a layer, see the tools + examples expand (Mintlify interactive blocks)
Interactive Audience Prompts
- “Which layer do YOU get stuck on most? (Poll: DNS / Firewall / Auth / App)”
- “What’s your go-to first debugging command when something breaks? Drop it below.”
- “Has anyone else hit the publickey-hostbound-v00 issue? I want to map which ISP/hosting combos trigger it.”
Collaboration Angles
- Julia Evans (b0rk) — her zine format + this content = perfect match. She’s done networking zines before.
- Cloudflare blog — they write about middlebox/protocol issues regularly. Pitch a guest post.
- Hostinger blog — “Debugging SSH on Hostinger VPS” version targeted at their customer base.