OSI Model·Lesson 11 of 12

Functions of Each Layer (Summary)

01

The Whole Model on One Page

You've now met all seven layers one at a time. This lesson pulls them together into a single reference you can revise from. If you're short on time before an interview, this is the page to read. We'll recap each layer's job, the name of the data at each layer, and the devices and protocols that live there.

The mental model

Read from the bottom up: Layer 1 moves bits, Layer 2 delivers frames locally, Layer 3 routes packets between networks, Layer 4 delivers end-to-end, and Layers 5–7 organize, translate, and serve the data to your apps.

Here's the full stack, top to bottom, with each layer's one-line job and the name of its data unit shown as a pill on the right:

The seven layers, their jobs, and their data units

7

Application

Network services and protocols for apps

Data
6

Presentation

Translation, encryption, compression

Data
5

Session

Open, manage, and close conversations

Data
4

Transport

End-to-end delivery, reliability, ports

Segment
3

Network

Logical addressing and routing

Packet
2

Data Link

Node-to-node delivery, MAC addressing

Frame
1

Physical

Raw bits as signals on the medium

Bit
02

Every Layer's Job at a Glance

This table is the classic summary interviewers expect you to have in your head — each layer, its main function, its data unit (PDU), and a familiar example:

LayerMain functionData unitExample
7 — ApplicationNetwork services for appsDataHTTP, DNS, SMTP
6 — PresentationTranslate, encrypt, compressDataTLS, JPEG, Unicode
5 — SessionOpen, manage, close sessionsDataSession setup, RPC
4 — TransportEnd-to-end deliverySegmentTCP, UDP
3 — NetworkRouting across networksPacketIP, routers
2 — Data LinkNode-to-node deliveryFrameEthernet, switches
1 — PhysicalRaw bits as signalsBitCables, hubs
03

Addressing and Devices by Layer

A second angle that trips people up: which layer uses which kind of address, and which devices operate where. Only three layers do addressing, and the classic devices sit in the bottom three layers:

LayerAddress usedDevices / protocols
7 — ApplicationNone (names like URLs)HTTP, DNS, SMTP, FTP
6 — PresentationNoneTLS, JPEG, ASCII/Unicode
5 — SessionNoneRPC, NetBIOS
4 — TransportPort numberTCP, UDP
3 — NetworkIP address (logical)Router, IP
2 — Data LinkMAC address (physical)Switch, bridge
1 — PhysicalNoneHub, repeater, cables

The three-address rule

Only three layers address data, and they climb in scope: Layer 2 uses the MAC address (this device on the local network), Layer 3 uses the IP address (which network to route to), and Layer 4 uses the port number (which program on the device).

04

Remembering the Order

Finally, the memory aids. Take the first letter of each layer and turn it into a sentence — whichever direction you find easier to recall:

Mnemonics for the layer order

  • Top to bottom (7 to 1): "All People Seem To Need Data Processing" — Application, Presentation, Session, Transport, Network, Data Link, Physical
  • Bottom to top (1 to 7): "Please Do Not Throw Sausage Pizza Away" — Physical, Data Link, Network, Transport, Session, Presentation, Application

Q:Quick-fire: name each OSI layer and its data unit, top to bottom.

A: Application (data), Presentation (data), Session (data), Transport (segment), Network (packet), Data Link (frame), Physical (bit). Addressing: Transport uses ports, Network uses IP addresses, Data Link uses MAC addresses. Devices: routers at Layer 3, switches at Layer 2, hubs and repeaters at Layer 1.

Quick Revision Cheat Sheet

7 Application: Services for apps — HTTP, DNS, SMTP (data)

6 Presentation: Translate, encrypt, compress — TLS (data)

5 Session: Open/manage/close sessions (data)

4 Transport: End-to-end delivery — TCP/UDP, ports (segment)

3 Network: Routing — IP, routers (packet)

2 Data Link: Local delivery — MAC, switches (frame)

1 Physical: Bits as signals — cables, hubs (bit)