What is the OSI Model?
Understand the OSI model’s 7 layers — Physical to Application — their jobs, example protocols, encapsulation and networking interview questions.
Expected Interview Answer
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes network communication into seven layers — Physical, Data Link, Network, Transport, Session, Presentation, and Application — where each layer serves the one above it and relies on the one below, so that different systems can interoperate.
From bottom to top: Physical moves raw bits over a medium; Data Link (MAC, switches) frames bits and handles local addressing; Network (IP, routers) handles logical addressing and routing between networks; Transport (TCP, UDP) provides end-to-end delivery and reliability; Session manages dialogues between applications; Presentation handles encryption, compression, and data format translation; and Application is where user-facing protocols like HTTP and SMTP live. The model is a teaching and troubleshooting tool — real stacks like TCP/IP collapse several layers — but it lets engineers reason about where a problem sits and how protocols encapsulate one another.
- Common vocabulary for describing network functions
- Isolates problems to a specific layer during troubleshooting
- Lets protocols and vendors interoperate via clear boundaries
- Explains encapsulation as data moves down the stack
AI Mentor Explanation
The OSI model is like the layered chain that turns a captain’s plan into action on the field: the strategy (top layer) is translated into agreed signals, then hand gestures, then the physical throw of the ball (bottom layer), and unwrapped in reverse by the receiving player. Each level only talks to the one directly above and below it, so the captain need not think about wrist mechanics. Break the flow at one level — a missed signal versus a dropped ball — and you know exactly which layer to fix.
Step-by-Step Explanation
Step 1
Layers 1–2
Physical moves bits on the wire; Data Link frames them and uses MAC addresses.
Step 2
Layers 3–4
Network (IP) routes between networks; Transport (TCP/UDP) delivers end-to-end.
Step 3
Layers 5–7
Session manages dialogue, Presentation handles format/encryption, Application serves protocols like HTTP.
Step 4
Encapsulation
Each layer wraps the one above with its own header as data moves down the stack.
What Interviewer Expects
- All seven layers named in the correct order
- The main job of each layer
- Example protocols or devices per layer (IP, TCP, switch, router)
- That OSI is conceptual and TCP/IP collapses some layers
Common Mistakes
- Listing the layers out of order
- Confusing the Network and Transport layers’ roles
- Treating OSI as a literal implementation instead of a model
- Placing HTTP or IP in the wrong layer
Best Answer (HR Friendly)
“The OSI model breaks networking into seven layers, from the physical cable at the bottom up to the apps you use at the top, with each layer doing one job. It gives engineers a shared language and makes troubleshooting easier, because you can pinpoint which layer a problem lives in instead of guessing.”
Code Example
7. Application HTTP, SMTP, DNS, FTP
6. Presentation TLS/SSL, JPEG, ASCII (encryption, compression, format)
5. Session session setup/teardown, RPC
4. Transport TCP, UDP (end-to-end delivery)
3. Network IP, ICMP, routers (logical addressing, routing)
2. Data Link Ethernet, MAC, switches (framing, local addressing)
1. Physical cables, radio, voltages (raw bits)Follow-up Questions
- How does the OSI model differ from the TCP/IP model?
- What is encapsulation as data moves down the layers?
- At which layer does a router versus a switch operate?
- Where does TLS sit in the OSI model?
MCQ Practice
1. How many layers does the OSI model have?
The OSI model defines seven layers, from Physical up to Application.
2. At which layer does IP addressing and routing happen?
The Network layer (layer 3) handles logical addressing and routing with IP.
3. HTTP operates at which OSI layer?
HTTP is an Application-layer (layer 7) protocol.
Flash Cards
Order of OSI layers (bottom-up)? — Physical, Data Link, Network, Transport, Session, Presentation, Application.
Transport layer job? — End-to-end delivery and reliability (TCP, UDP).
Network layer job? — Logical addressing and routing between networks (IP, routers).
Is OSI a real implementation? — No — it is a conceptual model; TCP/IP collapses several of its layers.