Skip to content
SpeedTestGO

The OSI Model: The 7 Layers Explained With an Example

Shawn Stolting

2 min read

Published Updated

Short answer

The OSI model has seven layers from physical to application. It maps onto TCP/IP, and it helps with troubleshooting: hubs are layer 1, switches layer 2, routers layer 3.

The OSI Model: Understanding the Layers of Network Communication
In this article (5 sections)
  1. The seven layers
  2. An example: loading a web page
  3. OSI and TCP/IP
  4. Why it is useful
  5. FAQs

The OSI model splits network communication into seven layers, from the cable up to the application you use. Each layer does one job and talks only to the layers directly above and below it. It is a reference model for learning and troubleshooting. The real internet runs on the simpler four-layer TCP/IP model, which maps onto it.

The seven layers

#LayerJobData unitExamples
7ApplicationServices that programs useDataHTTP, DNS, SMTP
6PresentationFormat, encryption, compressionDataTLS, JPEG
5SessionStarting, keeping and ending conversationsDataSession setup, RPC
4TransportEnd-to-end delivery, ports, reliabilitySegments or datagramsTCP, UDP
3NetworkAddressing and routing between networksPacketsIP, routers
2Data linkDelivery on one local network, using MAC addressesFramesEthernet, Wi-Fi, switches
1PhysicalMoving raw bits over a mediumBitsCables, radio, hubs

A common memory aid, from layer 7 down, is "All People Seem To Need Data Processing".

An example: loading a web page

  1. Application: your browser asks for a page over HTTP, after DNS finds the address.
  2. Presentation: TLS encrypts the request.
  3. Transport: TCP splits the data and tracks delivery.
  4. Network: IP gives each packet the source and destination address.
  5. Data link: the packet is wrapped in a frame for your Wi-Fi or Ethernet hop.
  6. Physical: the frame is sent as radio waves or electrical or light signals.

The data then passes up the layers on the other side. Sending adds a header at each layer, and receiving removes it.

OSI and TCP/IP

TCP/IP layerOSI layers
Application5, 6, 7
Transport4
Internet3
Link1, 2

Why it is useful

  • Troubleshooting: work from the bottom up. Is the cable or Wi-Fi connected (1)? Can you reach the router (2 and 3)? Is a port or firewall blocking it (4)? Does DNS or the app fail (7)?
  • Naming devices: a hub works at layer 1, a switch at layer 2 and a router at layer 3. That is why switches and routers split collision domains and broadcast domains differently.
  • Security: a basic firewall filters at layers 3 and 4, and application firewalls work at layer 7.

When a slow connection puzzles you, ping tests layer 3 and a speed test covers the stack above it:

Internet Speed Tester

Press Start. After the test you get a network quality score and what your speed is good for.

Download

0.0 Mbps

Upload

0.0 Mbps

Ping

0.0 ms

Jitter

0.0 ms

Your last results

How this test measures

The test runs against the nearest Cloudflare data center, shown above as the server. Results describe the path between you and that server, which can differ from the path to a particular website, game or call server.

Ping is the median round-trip time of 60 small requests, and jitter is the average difference between consecutive ones. Download and upload use files of growing size sent one after another over a single connection, and the result is the 90th percentile of the requests that ran long enough to be reliable. Speeds are in megabits per second (1 Mbps = 1,000,000 bits).

Because it uses one connection, the test can read lower than a multi-connection test on very fast or distant links. Wi-Fi, a VPN, other devices and a busy browser can all lower the result, so use a cable and close other apps for the most accurate number. Nothing from the test is stored on our servers.

Powered by Cloudflare's network. No account needed.

FAQs

What is the OSI model?
A seven-layer reference model that describes how data moves between devices, from physical signals up to applications. Each layer has one job.
What are the 7 layers of the OSI model?
From the top: Application, Presentation, Session, Transport, Network, Data link and Physical.
At which layer does a router work?
Layer 3, the Network layer, where it routes packets by IP address. A switch works at layer 2 and a hub at layer 1.
Is the OSI model used on the internet?
The internet runs on the TCP/IP model. OSI is a teaching and troubleshooting reference, and its layers map onto TCP/IP's.
Where do TCP and UDP fit?
They are Transport layer (layer 4) protocols. TCP provides reliable delivery. UDP is faster and lighter, with no delivery guarantee.
Read nextCollision Domain Explained: Hubs, Switches and RoutersTry itInternet Speed TestDownload, upload, ping and jitter in about half a minute.