OSI Model



🌐 OSI Model: Deep Dive (Layman's Terms)

OSI stands for Open Systems Interconnection. It's a 7-layer model that explains how data travels from one device to another over a network.

📦 Think of sending a parcel (data) from your home to a friend's home:

  • You pack it, label it, give it to a courier, they transport it, it reaches your friend, he opens it, and uses the content.

That’s exactly what the OSI model does with data, in 7 steps (layers):


🔢 OSI 7 Layers (Bottom-Up):

Layer

Name

What It Does

Real-Life Analogy

7

Application

Interface for user apps

WhatsApp, Gmail

6

Presentation

Data translation & encryption

Google Translate + Zipper

5

Session

Manages sessions/connections

Logging in to a website

4

Transport

Ensures delivery (TCP/UDP)

Delivery guarantee or speed post

3

Network

Routing & IP addressing

GPS navigation

2

Data Link

MAC addressing & switching

Local delivery guy

1

Physical

Wires, signals, bits

Road or courier van


🧠 Tricks to Remember OSI Layers:

Mnemonic (Bottom to Top):
👉 Please Do Not Throw Sausage Pizza Away
(Physical, Data Link, Network, Transport, Session, Presentation, Application)

Or

👉 All People Seem To Need Data Processing
(Application → Physical)


📥 Practical Example: Sending a WhatsApp Message

  1. Application (7): You type "Hi!" in WhatsApp.

  2. Presentation (6): WhatsApp encrypts it.

  3. Session (5): WhatsApp establishes a connection to the recipient.

  4. Transport (4): TCP ensures the message is delivered in order, no loss.

  5. Network (3): IP helps find the recipient’s phone (via their IP address).

  6. Data Link (2): MAC address helps deliver data over Wi-Fi or mobile.

  7. Physical (1): Data is turned into electrical signals sent via Wi-Fi or 4G.


🧠 Why OSI Matters in FAANG Interviews:

FAANG companies don’t expect you to just memorize OSI, but to:

  • Debug real network issues

  • Design scalable systems (e.g. load balancers, proxies)

  • Optimize data transfer (latency, throughput)

  • Build chat/video apps (protocol awareness)


🧪 20 FAANG-Level OSI Model Questions & Answers


✅ Beginner Level

  1. Q1: What is the OSI Model? Why do we need it?
    A: A conceptual framework for understanding how data flows through a network. It helps standardize communication between systems, ensuring compatibility.


  1. Q2: Which layer is responsible for routing packets?
    A: Network Layer (Layer 3) – uses IP for routing.


  1. Q3: Which layer ensures reliable delivery?
    A: Transport Layer (Layer 4) – uses TCP for reliability.


  1. Q4: What's the difference between TCP and UDP in the OSI Model?
    A: TCP (reliable, connection-oriented) vs UDP (fast, connectionless).
    TCP is like sending a registered letter. UDP is like broadcasting radio.


  1. Q5: Which layer deals with MAC addresses?
    A: Data Link Layer (Layer 2).


✅ Intermediate Level

  1. Q6: What happens at the Presentation Layer?
    A: Data translation (e.g., ASCII to EBCDIC), encryption, compression.


  1. Q7: What's the role of the Session Layer?
    A: Establishes, manages, and terminates sessions. Example: FTP or video call session.


  1. Q8: DNS works at which layer?
    A: Application Layer (Layer 7) – it’s an application service.


  1. Q9: What layers do switches, routers, and hubs operate on?
    A:

  • Hub → Physical (1)

  • Switch → Data Link (2)

  • Router → Network (3)


  1. Q10: What layer would SSL/TLS work on?
    A: Presentation Layer (6) – for encryption/decryption.


  1. Q11: What layer handles retransmissions and flow control?
    A: Transport Layer (4) – TCP handles this.


  1. Q12: What does the Physical Layer include?
    A: Cables, switches, NICs, radio waves, fiber optics.


  1. Q13: Difference between Layer 2 and Layer 3 switches?
    A: Layer 2 switch uses MAC (LAN). Layer 3 switch does routing using IP.


✅ Advanced Level / FAANG Debugging

  1. Q14: A packet reaches the server but the app doesn’t respond. Which OSI layer might be failing?
    A: Possibly Layer 7 (Application). Lower layers worked.


  1. Q15: If data is corrupted but reaches the destination, which layer failed?
    A: Data Link (2) or Transport (4) – both handle integrity.


  1. Q16: Which layer would you debug if DNS is failing?
    A: Application Layer (7).


  1. Q17: A website is slow to load. What layers could be bottlenecks?
    A: Could be any of:

  • Network (3): bad routing

  • Transport (4): slow retransmission

  • Application (7): server response time


  1. Q18: Can Layer 3 work without Layer 2?
    A: No. Layer 2 (MAC addressing) is needed to deliver packets inside local networks.


  1. Q19: If packets are being dropped but connection exists, which layer?
    A: Transport Layer (4) – TCP tries to recover, but dropping continues → network congestion.


  1. Q20: What layer is responsible for load balancer IP forwarding?
    A: Network Layer (3) – routes traffic via IP.


💡 Bonus: Mind Map Style Summary

[Layer 7: Application] - Gmail, WhatsApp, HTTP

[Layer 6: Presentation] - Encryption, Encoding (TLS, JPEG)

[Layer 5: Session]      - Login sessions, FTP

[Layer 4: Transport]    - TCP, UDP (Port numbers)

[Layer 3: Network]      - IP, Routers

[Layer 2: Data Link]    - MAC, Switches

[Layer 1: Physical]     - Cables, Wi-Fi, Signals



🔍 Example: Sending a Web Request

  1. You type a URL → application layer sets HTTP request.

  2. Presentation layer encodes it (e.g., UTF-8, TLS).

  3. Session layer establishes/mantains connection.

  4. Transport layer packs data into TCP segments.

  5. Network layer adds IP header → routes Internet.

  6. Data Link layer frames it for Ethernet or Wi‑Fi.

  7. Physical layer sends actual electrical bits on the wire.

Each layer encapsulates and decapsulates headers/trailers, passing data up/down until delivery to the target application.



Here are 20 FAANG-level scenario-based OSI Model troubleshooting questions with realistic interview-style context, layer identification, and answer explanations — ideal for DevOps, SRE, Backend, or Systems Engineer roles.


✅ 20 FAANG-Level OSI Troubleshooting & Scenario-Based Questions


🔧 Q1. You're pinging a server and getting “Destination Host Unreachable.” Which layer(s) could be at fault?

Answer:
Layer 3 – Network
This error implies your system can't find a route to the destination IP. Could be due to misconfigured routing tables or incorrect default gateway.


🔧 Q2. The user can open the login page of a web app but gets “500 Internal Server Error” after submitting credentials. Which layer?

Answer:
Layer 7 – Application
Transport and lower layers are fine since page loads. The backend service likely crashed or failed to handle the request.


🔧 Q3. An HTTPS site is giving certificate errors. Which layer is affected?

Answer:
Layer 6 – Presentation
TLS/SSL handshake and encryption/decryption issues happen here.


🔧 Q4. A VoIP call has choppy audio. Network looks fine. Which OSI layer and why?

Answer:
Layer 4 – Transport
If using UDP, there's no retransmission. Choppiness suggests packet loss or jitter. Inspect transport metrics.


🔧 Q5. You're able to SSH into a server using IP but not hostname. Which layer?

Answer:
Layer 7 – Application (DNS issue)
DNS resolves names → IPs. If IP works but hostname doesn't, DNS is misconfigured or unreachable.


🔧 Q6. User can access internal sites but not public websites. What OSI layers to check?

Answer:
Layer 3 (Network): Check NAT, routing to public internet.
Layer 7 (Application): Ensure DNS is resolving public names.


🔧 Q7. Data packets are arriving out of order. Which OSI layer ensures proper sequencing?

Answer:
Layer 4 – Transport (TCP)
TCP handles sequencing. UDP doesn’t. Reordering could be due to misconfigured load balancer or NIC offloading.


🔧 Q8. You're using traceroute and it times out at the third hop. What does this tell you?

Answer:
Layer 3 – Network
Traceroute uses ICMP (or UDP) and TTL. Timeout = router may drop or block packets. Check firewall or routing loop.


🔧 Q9. After a switch replacement, some devices can’t communicate on the LAN. Why?

Answer:
Layer 2 – Data Link
MAC address table may not have populated, or VLAN configuration is missing.


🔧 Q10. Developer reports REST API is not returning data, but TCP connection is successful. What layer?

Answer:
Layer 7 – Application
TCP (Layer 4) is okay. Check application logs for endpoint failures.


🔧 Q11. FTP connection is established but directory listing fails. What's wrong?

Answer:
Layer 5+ – Session/Application
FTP uses two connections: control and data. Passive mode/firewall/NAT issues may break data channel.


🔧 Q12. An EC2 instance receives ICMP ping but can’t access the internet. Possible issue?

Answer:
Layer 3 – Network
Ping proves Layer 3 connectivity internally. Check NAT Gateway or routing table for outbound internet access.


🔧 Q13. A containerized app can't connect to a database using the service name, but works with IP. What’s broken?

Answer:
Layer 7 – Application (DNS inside container)
Likely a DNS resolution issue in Docker/Kubernetes.


🔧 Q14. A VM sends packets, but the MAC address of the destination is not resolving. Where's the issue?

Answer:
Layer 2 – Data Link (ARP failure)
Check ARP cache or broadcast behavior on the network.


🔧 Q15. HTTPS site loads on Chrome but not on curl. Why?

Answer:
Layer 6/7 – TLS handshake
Curl may not trust the certificate or requires updated CA bundle.


🔧 Q16. Network speed tests show good throughput, but application is slow. Where to look?

Answer:
Layer 7 – Application bottlenecks
Check app performance, API latency, server processing time. Lower layers are fine.


🔧 Q17. Load balancer routes traffic but users experience session loss. Layer?

Answer:
Layer 5 – Session
Sticky sessions may not be preserved. Misconfigured load balancer isn’t maintaining session affinity.


🔧 Q18. Packets are dropped after firewall rules are changed. Which OSI layers are involved?

Answer:
Layer 3 (IP filtering) and Layer 4 (TCP/UDP ports)
Check firewall logs/rulesets.


🔧 Q19. Packet capture shows TCP handshake (SYN, SYN-ACK, ACK), but application request times out.

Answer:
Layer 7 – Application
Transport layer is working. App might not be bound to port or is overloaded.


🔧 Q20. Wi-Fi connects, IP assigned via DHCP, but browsing doesn't work.

Answer:
Check:

  • Layer 3 – IP: Check gateway config.

  • Layer 7 – DNS: If IP ping works but not names.

  • Layer 4 – TCP timeout: Could be ISP firewall/drop.


🔁 Cheat Sheet: OSI Troubleshooting Hints

Symptom Layer
No electrical signal Layer 1
ARP issues / MAC problems Layer 2
No route, IP unreachable Layer 3
Packet loss, retransmissions Layer 4
Session timeout / login fails Layer 5
SSL, encoding errors Layer 6
App doesn’t respond Layer 7



Distributed by Gooyaabi Templates | Designed by OddThemes