Skip to content

Beginner · How networks work · topic 3 of 57 · 30 min

The OSI model

Explanation

The OSI model splits the job of networking into 7 layers, from the physical signal (Layer 1) up to the application you use (Layer 7). Each layer has its own job and its own name for the data unit: bits, frames, packets, segments and data. Engineers use the layers as a shared language and as a checklist for troubleshooting from the bottom up.

Why a model?

Sending a message from your phone to a server involves electricity or radio, addresses, routes, error checks, and the app itself. That is too much to think about at once. A model breaks the job into layers. Each layer does one part and trusts the layers below to do theirs. This lets different companies build parts that work together: a Wi-Fi chip from one maker, an operating system from another and a browser from a third.

The OSI model (Open Systems Interconnection), published by the ISO in the 1980s, has 7 layers. Real networks run the TCP/IP protocols, covered in the next topic, but everyone still uses OSI layer numbers when they talk. "It is a Layer 1 problem" means "check the cable".

Think of it like this: Sending a courier is layered too. You write a letter (application), put it in an envelope with the name of the person (transport), the courier company adds a city and PIN code label (network), the local van driver uses a street address to reach the next depot (data link), and the van and road carry it physically (physical). Each person only cares about their own label.

The seven layers

No.LayerJobExamplesPDU
7ApplicationNetwork services for appsHTTP, DNS, SMTP, FTP, SSHData
6PresentationFormat, encryption, compressionTLS encryption, JPEG, UTF-8Data
5SessionOpens, manages and closes conversationsSession setup in RPC, NetBIOSData
4TransportProcess-to-process delivery, ports, reliabilityTCP, UDPSegment (TCP) or datagram (UDP)
3NetworkLogical addressing and routing between networksIPv4, IPv6, ICMP, OSPF; routersPacket
2Data linkDelivery on the local link, MAC addresses, error detectionEthernet, Wi-Fi (802.11), ARP; switchesFrame
1PhysicalBits as signals on the mediumCables, connectors, fibre, radio; hubsBits

PDU means Protocol Data Unit: the name for a chunk of data at a given layer. Learn the PDUs by heart: data at the top, segment at Layer 4, packet at Layer 3, frame at Layer 2, bits at Layer 1.

Remembering the order

From Layer 7 down: All People Seem To Need Data Processing (Application, Presentation, Session, Transport, Network, Data link, Physical). From Layer 1 up: Please Do Not Throw Sausage Pizza Away. Pick one and practise writing the list from memory.

A closer look at each layer

  • Layer 1, Physical: voltage on copper, light in fibre, radio waves. Cable types, connector pins and signal timing live here.
  • Layer 2, Data link: frames on one local link. Uses MAC addresses to say which NIC on this link should take the frame, and a checksum (FCS) to detect damage.
  • Layer 3, Network: IP addresses that work across the whole internet, and routing, which picks the path through many networks.
  • Layer 4, Transport: delivers data to the right program using port numbers. TCP adds reliability; UDP is fast and simple.
  • Layers 5 to 7: in practice, apps and protocols like HTTP, TLS and DNS handle these jobs together. That is why the TCP/IP model merges them into one Application layer.

Troubleshooting with layers

When "the network is down", work through the layers in order. The bottom-up method starts at Layer 1: is the cable plugged in and is the port light on? Then Layer 2: does the switch see the MAC address? Then Layer 3: does the PC have the right IP address and gateway, and does ping work? Then Layer 4 and above: is the service listening on its port, is a firewall blocking it?

output
Layer 1  Link light off?            -> reseat or swap the cable
Layer 2  MAC not in switch table?   -> check port, VLAN, port security
Layer 3  Wrong IP or gateway?       -> fix addressing, test with ping
Layer 4  Port blocked or closed?    -> check firewall rules, the service
Layer 7  App error (HTTP 500)?      -> it is the application, not the network
A bottom-up checklist. Most real faults are found at Layers 1 to 3.
Careful: Common mistakes: mixing up the PDU names (a packet is Layer 3, a frame is Layer 2), putting switches at Layer 3 (a basic switch is Layer 2; only multilayer switches also route), and thinking encryption like TLS lives at Layer 4. In the OSI model, encryption and formatting belong to Layer 6. In exam questions, read whether they ask about OSI or TCP/IP.
Tip: Learn a device for each of the bottom three layers: hub at Layer 1, switch at Layer 2, router at Layer 3. Many exam questions are just this table in disguise.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

The OSI model · 1/7

The OSI model 7 layers

Networking is a big job, so the OSI model splits it into seven layers, each with one task.

Prefer a video by a teacher? Find free videos on “OSI model 7 layers explained with examples CCNA” on YouTube ↗

In real life: A BPO floor in Gurugram loses one agent

One agent cannot reach the customer CRM; everyone else can. The network engineer works bottom up. Layer 1: the link light on the PC is on. Layer 2: the switch shows the PC MAC address on port 14. Layer 3: ipconfig shows 169.254.10.5, an address Windows gives itself when DHCP fails, so the PC never got a proper IP address. The port had been put in the wrong VLAN during a desk move. Moving it back fixed the problem in five minutes, without anyone touching the CRM server.

Practice (0/3 done)

Task 1 · Question

At which OSI layer does a router make its forwarding decision?

Task 2 · Code · Javascript

Write pduFor(layer) that returns the PDU name for an OSI layer number: 1 gives "bits", 2 "frame", 3 "packet", 4 "segment", and 5, 6 or 7 give "data". Any other number returns "unknown".

Task 3 · Practice

Write the seven OSI layers from memory, top to bottom, and next to each write one protocol or device and its PDU. Then describe how you would troubleshoot "my laptop cannot open any website" layer by layer.

Quick quiz

Question 1

1.Which layer adds source and destination MAC addresses?

Question 2

2.What is the PDU at the network layer called?

Question 3

3.In the OSI model, which layer handles encryption and data formats such as JPEG?

Question 4

4.A PC shows no link light on its network port. Which layer should you check first?

Question 5

5.Which device works mainly at Layer 1?

Read more (free)

Before this, learn

This topic builds on these. If something here feels new, open them first.

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which layer adds source and destination MAC addresses?

Answer: Data link

MAC addresses are Layer 2, the data link layer.

What is the PDU at the network layer called?

Answer: Packet

Layer 3 data units are packets.

In the OSI model, which layer handles encryption and data formats such as JPEG?

Answer: Presentation

Layer 6, presentation, deals with formats, encryption and compression.

A PC shows no link light on its network port. Which layer should you check first?

Answer: Layer 1

No link light points to the physical layer: cable, port or NIC.

Which device works mainly at Layer 1?

Answer: Hub

A hub just repeats signals, which is physical layer work.

Which layer of the 4-layer TCP/IP model matches OSI Layer 3?Related

Answer: Internet

The Internet layer, where IP lives, matches the OSI network layer.

From The TCP/IP model and encapsulation

How many layers does the OSI model have?Related

Answer: 7

OSI has 7 layers; the practical TCP/IP model has 4.

From TCP/IP and the network layers

Which command gives a layer 2 switch a gateway for its own management traffic?Related

Answer: ip default-gateway 10.99.0.1

A layer 2 switch does not route, so it uses ip default-gateway, like a PC.

From Switch management and interface troubleshooting

Which device forwards a frame only out of the port where the destination MAC address is?Related

Answer: Switch

A switch learns MAC addresses per port and forwards frames only where needed.

From Network devices

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 2 more topics in “How networks work” before its exam: The TCP/IP model and encapsulation, TCP, UDP and port numbers.
  2. Module 1 exam: How networks work · 13 questions · 20 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Ethernet, MAC addresses and the Cisco CLI. 57 topics left in the course before the final exam.

← Previous: Network devices