The whole picture
Layers 5, 6 and 7 do not necessarily add a fixed header the way TCP and Ethernet do. Their functions are largely implemented by application protocols and software. Do not teach "Layer 6 always adds a presentation header" — it is misleading.
Layer 7 — Application
Your browser generates the request. This layer is concerned with what network service the application wants.
Examples of Layer 7 protocols: HTTP, DNS, SMTP, FTP, SSH.
Layer 6 — Presentation
Format, encoding, compression and encryption. For HTTPS, TLS encryption happens conceptually here — although TLS does not map perfectly onto OSI Layer 6.
Layer 5 — Session
Conceptually manages the conversation: start communication, maintain it, synchronise, end it. Modern TCP/IP implementations generally do not have a separate session-layer protocol stack in the strict OSI sense.
Layer 4 — Transport
Now TCP adds its header. The unit is called a segment.
Port identifies the application or process. For HTTPS the destination port is 443. This is the same port number you type into an AWS security group rule.
Layer 3 — Network
IP adds its header in front of the TCP segment. The unit is now a packet.
IP identifies the host. Routers — and AWS route tables — operate primarily at this layer.
Layer 2 — Data Link
Ethernet adds a header and a trailer. The unit is now a frame.
MAC identifies the device on the local link. Notice that the IP packet is encapsulated inside the Ethernet frame — that nesting is the whole idea.
Layer 1 — Physical
The frame is converted into signals on the medium.
At the receiver — the exact reverse
Adding headers on the way down is encapsulation. Removing them on the way up is decapsulation. Each layer reads and removes only its own information.
The four terms you need to remember
| Layer | PDU | Address | Identifies |
|---|---|---|---|
| Layer 4 | Segment | Port | The process or application |
| Layer 3 | Packet | IP | The host on the network |
| Layer 2 | Frame | MAC | The local network interface |
| Layer 1 | Bits | — | Physical transmission |
HTTPS → TCP → IP → Ethernet/Wi-Fi → Bits
L7 L4 L3 L2 L1
Application tells what you want → Transport manages the conversation → IP finds where → MAC handles the next local device → Physical sends the bits.