1 Physical2 Data link3 Network4 Transport5 Session6 Presentation7 Application
Layer blocks: application, transport, internet, link, top to bottom; height = how many OSI layers each coversEnvelopes: one per layer, in that layer's colour; the dark tab is its headerDots on the cable: the frame sent as bitsOSI board: the seven-layer reference model, level with the four layersOne HTTP request of 38 bytes goes from 192.168.1.20 to 192.168.1.30 over one Ethernet cable. Going down the sender's stack, TCP adds a 20-byte header (segment, 58 bytes), IPv4 a 20-byte header (packet, 78 bytes) and Ethernet a 14-byte header plus a 4-byte FCS (frame, 96 bytes), which crosses the cable as 768 bits. Going up the receiver's stack, each layer checks and removes the header its twin added, until the application gets the same bytes. The OSI board shows how its seven layers line up with the four TCP/IP layers. Header sizes are the minimums (no options): TCP 20 bytes (RFC 9293), IPv4 20 bytes (RFC 791), Ethernet 14 bytes plus a 4-byte FCS (IEEE 802.3). The drawing is not to scale. 192.168.1.20 and 192.168.1.30 are private home-network addresses (RFC 1918); the MAC addresses are documentation values (RFC 9542, formerly RFC 7042). Port 51514 is illustrative.

Wrapping, layer by layer

  1. Your web browser wants a page from a computer on your home network. At the top of a stack of four layers, the application layer writes the request: 38 bytes of plain text. This is the data.

On the wire

Unwrapping

The big picture

The headers, field by field

;; step 1/10 · write-message · data 38 bytes
APPLICATION (HTTP)
data  "GET / HTTP/1.1\r\nHost: 192.168.1.30\r\n\r\n"
size  38 bytes
no header of its own at this layer: HTTP is the message

Not shown: the TCP connection was opened first (the three-way handshake), and the sender found the receiver's MAC address with ARP. On the cable each frame is also preceded by 8 bytes of preamble and start-of-frame delimiter, and frames are spaced by a 12-byte gap.