Beginner · How networks work · topic 3 of 57 · 30 min
The OSI model
Explanation
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".
The seven layers
| No. | Layer | Job | Examples | PDU |
|---|---|---|---|---|
| 7 | Application | Network services for apps | HTTP, DNS, SMTP, FTP, SSH | Data |
| 6 | Presentation | Format, encryption, compression | TLS encryption, JPEG, UTF-8 | Data |
| 5 | Session | Opens, manages and closes conversations | Session setup in RPC, NetBIOS | Data |
| 4 | Transport | Process-to-process delivery, ports, reliability | TCP, UDP | Segment (TCP) or datagram (UDP) |
| 3 | Network | Logical addressing and routing between networks | IPv4, IPv6, ICMP, OSPF; routers | Packet |
| 2 | Data link | Delivery on the local link, MAC addresses, error detection | Ethernet, Wi-Fi (802.11), ARP; switches | Frame |
| 1 | Physical | Bits as signals on the medium | Cables, connectors, fibre, radio; hubs | Bits |
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?
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 networkNeed 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
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)
At which OSI layer does a router make its forwarding decision?
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".
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
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- The TCP/IP model and encapsulationHow networks work · same module
- TCP/IP and the network layersCyber Security: from zero to SOC analyst · Networking for security
- Switch management and interface troubleshootingSwitching and VLANs
- A structured troubleshooting methodTroubleshooting and the CCNA exam
- Inter-VLAN routingSwitching and VLANs
- Ethernet frames and MAC addressesEthernet, MAC addresses and the Cisco CLI
Questions people ask about this
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.
How many layers does the OSI model have?Related
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.
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
- 2 more topics in “How networks work” before its exam: The TCP/IP model and encapsulation, TCP, UDP and port numbers.
- Module 1 exam: How networks work · 13 questions · 20 min, without help. 5 topics of this module still to finish first.
- Then the next module, Ethernet, MAC addresses and the Cisco CLI. 57 topics left in the course before the final exam.