System Design Cases
OSI / TCP-IP Model
OSI / TCP-IP model concept page. 7 OSI layers (Application/Presentation/Session/Transport/Network/Data Link/Physical) mapped to practical TCP/IP stack. Shows where each network device lives (switch=L2, router=L3, NLB/firewall=L4, ALB/WAF/Envoy=L7). Three scenarios: encapsulation-decapsulation HTTP request walkthrough, L4 vs L7 load balancer comparison, troubleshooting by layer (production debugging).
OSI и стек Internet: модель, а не трасса исполнения
OSI is a reference model for separating communication responsibilities. It is not an implementation specification and it is not a promise that every Internet protocol or appliance maps to exactly one of seven boxes. For production reasoning, pair the OSI vocabulary with the Internet suite's application, transport, Internet, and link layers.
Mental model
- ISO/IEC 7498-1 explicitly presents OSI as a common basis for coordinating standards, not an implementation specification.
- The Internet architecture combines OSI presentation and application responsibilities in its application layer and does not require a separate session layer.
- Encapsulation is local composition: an application message is protected and transported; routers normally forward IP packets hop by hop while link headers change.
- A product called a switch, firewall, or load balancer can perform several functions. State what evidence and header fields the active function uses.
Гарантии и границы
- TCP provides an ordered byte stream, not application-message boundaries.
- IP forwarding is best effort; delivery, ordering, and duplicate suppression are not IP guarantees.
- TLS protects a peer-to-peer transport segment only between its TLS endpoints. Termination creates a new trust boundary for any downstream connection.
- A response traverses the same physical dependency edges in reverse; it does not require duplicate reverse topology edges.
Сценарии диаграммы
Encapsulation and decapsulation. A teaching path through Internet layers; OSI names organize responsibilities but do not prescribe one implementation.
Device scope is a function, not a brand label. A switch, router, firewall, or proxy is described by the function used on this path; appliances can implement several layers.
Diagnose from evidence by layer. Symptoms narrow hypotheses but do not uniquely identify a layer or root cause.
Архитектурные решения
- Use OSI to name responsibilities and fault domains, then use the protocol's own specification for exact state and failure semantics.
- Document every termination point: TCP proxying, TLS termination, HTTP gatewaying, and tunneling imply different visibility and trust.
- Treat symptom-to-layer mappings as hypotheses. Collect packet, socket, certificate, intermediary, and application evidence.
Сбои и неоднозначные исходы
- A TCP refusal usually involves an explicit reset or local rejection; a silent drop more often appears as a timeout.
- A TLS alert proves handshake failure but not necessarily the certificate; version, algorithm, name, trust, and time checks are separate.
- HTTP 502 denotes a gateway/proxy failure while acting as an intermediary; DNS, connection, protocol, or upstream response faults can all lead there.
Операционный checklist
- Name both the conceptual layer and the concrete protocol.
- Mark all encryption and proxy termination points.
- Do not infer a unique root cause from ping, a status code, or one timeout.
- Verify the actual dependency edge for every forward and response animation.