TodayTools

Networking basics

The OSI model, explained with one real request

Seven layers, each with one job. Tap a layer, then watch a web request get wrapped on your laptop and unwrapped on the server.

Donate
What brings you here?
How much detail

The OSI model in one paragraph

The OSI model splits networking into seven layers: Application, Presentation, Session, Transport, Network, Data link and Physical. Each layer adds its own header to the data and trusts the layer below to carry it. The internet itself runs on the simpler four-layer TCP/IP model, but people still use the OSI numbers to say where a protocol, a device or a problem sits.

The seven layers and the TCP/IP four

OSI model, 7 layers

Sending goes down from 7 to 1. Receiving goes back up from 1 to 7. TCP/IP, which the internet really runs on, folds the same jobs into four layers.

Watch one request get wrapped

Opening www.example.com. Each layer on your laptop wraps the message in its own header. A router opens only the outer layers. The server unwraps it all in reverse.

Laptop

  1. 7
  2. 6
  3. 5
  4. 4
  5. 3
  6. 2
  7. 1

Router

  1. Layer 7 not opened
  2. Layer 6 not opened
  3. Layer 5 not opened
  4. Layer 4 not opened
  5. 3
  6. 2
  7. 1

Server

  1. 7
  2. 6
  3. 5
  4. 4
  5. 3
  6. 2
  7. 1

wraps going down

opens layers 1 to 3 only

unwraps going up

Now it is just data

The request GET / on its own.

Step 1 of 18 · Your laptop · layer 7 Application

The browser writes a request

You open www.example.com. The browser writes a short note: GET /, which means please send the home page.

Remember it

Two memory lines for the layer names, the units, and which box works where.

From layer 7 down
  1. All7 Application
  2. People6 Presentation
  3. Seem5 Session
  4. To4 Transport
  5. Need3 Network
  6. Data2 Data link
  7. Processing1 Physical
From layer 1 up
  1. Please1 Physical
  2. Do2 Data link
  3. Not3 Network
  4. Throw4 Transport
  5. Sausage5 Session
  6. Pizza6 Presentation
  7. Away7 Application

Units on the way down

DataSegmentPacketFrameBits

Memory line: Do Some People Fear Birthdays. Data at 5 to 7, segment at 4, packet at 3, frame at 2, bits at 1.

Which box works where

  • HubLayer 1repeats signals
  • SwitchLayer 2reads MAC
  • RouterLayer 3reads IP

Questions people ask

What are the 7 layers of the OSI model?

From the top: 7 Application, 6 Presentation, 5 Session, 4 Transport, 3 Network, 2 Data link and 1 Physical. Data goes down the layers on the sender and back up on the receiver.

What is the difference between the OSI model and the TCP/IP model?

OSI has seven layers and is a teaching model. TCP/IP has four (Application, Transport, Internet, Link) and matches how the internet is really built. TCP/IP's Application layer covers OSI layers 5, 6 and 7, and its Link layer covers 1 and 2.

What is encapsulation in networking?

Each layer wraps the data from the layer above in its own header. Data becomes a segment (TCP), then a packet (IP), then a frame (Ethernet or Wi-Fi), then bits. The receiver removes the headers in reverse order. This is called decapsulation.

Which OSI layer do routers and switches work at?

A switch works at layer 2 and forwards frames by MAC address. A router works at layer 3 and forwards packets by IP address. A hub only repeats signals, so it is layer 1. A layer 3 switch does both 2 and 3.

What layer are TCP, IP, HTTP and TLS?

IP is layer 3. TCP and UDP are layer 4. HTTP, DNS and SMTP are layer 7. TLS sits between them. It is usually placed at layer 6 (some say 5), and in the TCP/IP model it is part of the Application layer.

Is the OSI model still used?

Not as a set of protocols. Real networks run TCP/IP. But the OSI layer numbers are used every day to say where a problem or a device sits, as in a layer 2 switch or a layer 7 load balancer.

Quick self check

Seven questions. Put the layers in order, then pick the layer for a protocol or a device.

Question 1 of 7

Put the layers in order. Tap them from the top, 7 down to 1.

  1. 7Empty
  2. 6Empty
  3. 5Empty
  4. 4Empty
  5. 3Empty
  6. 2Empty
  7. 1Empty

See the layers in action

Donate