← architecture

The OSI Model

A 7-layer reference model for how data moves across a network. The top four layers run as software on the two hosts; the bottom three move the actual bits across the wire. As data is sent it travels down the stack, each layer wrapping it in a header, then up the stack on the far side.

1 · The seven layers

Grouped the standard way: host layers (software on your computer) versus media layers (the network hardware that carries the signal). Blue chips are protocols; bordered chips are the hardware or software that lives at that layer.

Layers 7–4
Host / Softwareruns on the computer: apps + OS kernel
7
ApplicationPDU: Data
The interface applications use to reach the network.
HTTPHTTPSDNSSMTP ๐ŸŒ Browserโœ‰๏ธ Mail client
6
PresentationPDU: Data
Formatting, encryption, and compression so both ends agree.
TLSUTF-8JPEGgzip ๐Ÿ” Crypto / codec libs
5
SessionPDU: Data
Opens, maintains, and closes conversations between apps.
SocketsRPCNetBIOS ๐Ÿ”— OS / app APIs
4
TransportPDU: Segment
End-to-end delivery between processes via ports; reliability (TCP) or speed (UDP).
TCPUDPQUIC ๐Ÿงฑ Firewallโš–๏ธ Load balancer
Layers 3–1
Media / Hardwarecarries bits across the network: routers, switches, cables
3
NetworkPDU: Packet
Logical addressing and routing between networks (source IP → destination IP).
IPICMPBGP ๐Ÿงญ RouterL3 switch
2
Data LinkPDU: Frame
Node-to-node delivery on the local link using hardware (MAC) addresses.
EthernetARPWi-Fi ๐Ÿ”€ Switch๐Ÿชช NIC
1
PhysicalPDU: Bits
Raw bits as electrical, optical, or radio signals on the medium.
Voltages802.3 ๐Ÿ”Œ Cable๐Ÿงต Fiber๐Ÿ“ก Radio

The split is a useful approximation: the host OS also implements layers 3–4, while dedicated hardware (routers at L3, switches at L2) lives in the media layers.

2 · How data actually flows

OSI encapsulation and forwarding Top: a data unit descending the stack, each layer adding a header (encapsulation). Bottom: the path across the network, where a switch forwards at layer 2 and a router at layer 3, but only the two hosts process all seven layers. Sending: each layer wraps the data in its own header encapsulation Data L7–5 · Data (message) TCP Data L4 · Segment IP TCP Data L3 · Packet Eth IP TCP Data FCS L2 · Frame 0100 0101 0111 0100 0110 1000 1011 … L1 · Bits on the wire Across the network: only the endpoints open all 7 layers ๐Ÿ’ป Host A Layers 1–7 opens full stack ๐Ÿ”€ Switch Layers 1–2 forwards by MAC ๐Ÿงญ Router Layers 1–3 forwards by IP ๐Ÿ–ฅ๏ธ Host B Layers 1–7 opens full stack

Going down, every layer treats what it received as opaque payload and prepends its own header (the frame also adds a trailer, FCS, for error checking). A switch unwraps only to the frame (L2) to forward it; a router unwraps to the packet (L3) to route it, then both re-wrap and pass it on. The software layers (L4–L7) are only ever processed at the two endpoints.

Top to bottom (7 → 1): All People Seem To Need Data Processing.