Understanding the OSI Model with a Real HTTP Request Example

 Networking is everywhere — from browsing Google to streaming Netflix — but behind the scenes, a lot is happening to make sure data travels safely and reliably. To explain this, engineers often use the OSI Model (Open Systems Interconnection Model): a framework that splits network communication into seven layers.

In this post, we’ll break down the OSI layers, see what software or hardware handles them, and then walk through a real-life example of an HTTP request to Google.





๐Ÿ”น The 7 Layers of the OSI Model

  1. Physical Layer → Transmits raw bits as electrical signals, radio waves, or light pulses.

    • Devices: Cables, Wi-Fi, NICs, hubs.

  2. Data Link Layer → Moves frames between devices on the same network. Uses MAC addresses.

    • Devices: Switches, NIC drivers.

  3. Network Layer → Routes packets between different networks. Uses IP addresses.

    • Devices: Routers, firewalls.

  4. Transport Layer → Ensures reliable end-to-end delivery. Breaks data into segments.

    • Handled by: TCP/UDP stack in OS.

  5. Session Layer → Manages sessions between apps (start, maintain, terminate).

    • Examples: VPN software, RPC frameworks.

  6. Presentation Layer → Formats, encrypts, or compresses data.

    • Examples: SSL/TLS, JPEG, JSON.

  7. Application Layer → The actual apps users interact with.

    • Examples: Chrome, Outlook, Zoom, DNS clients.


๐Ÿ”น Mapping OSI Layers to Software and Devices

LayerProtocols / FunctionsHandled by
7. ApplicationHTTP, FTP, SMTP, DNSApps (Chrome, Outlook, Zoom)
6. PresentationTLS/SSL, JPEG, PNG, JSON, gRPCLibraries (OpenSSL, codecs)
5. SessionNetBIOS, RPC, PPTP, session tokensOS & APIs, VPN software
4. TransportTCP, UDP, QUICOS kernel networking stack
3. NetworkIP, ICMP, OSPF, BGPRouters, firewalls, OS IP stack
2. Data LinkEthernet, ARP, VLANSwitches, NIC drivers
1. PhysicalCables, Wi-Fi, Fiber, BluetoothNICs, hubs, repeaters

๐Ÿ”น Example: An HTTP Request to Google

Let’s see how an actual request flows through these seven layers.

๐Ÿ‘‰ You open Chrome and type https://www.google.com.

Step-by-step Journey

  1. Application Layer

    • Chrome creates an HTTP GET / request.

  2. Presentation Layer

    • HTTPS means TLS encrypts the HTTP request.

  3. Session Layer

    • TLS session is established to keep communication secure.

  4. Transport Layer

    • OS kernel wraps the encrypted request in TCP segments.

    • Destination port = 443.

  5. Network Layer

    • TCP segment is wrapped in an IP packet.

    • Source IP = your device, Destination IP = Google’s server.

  6. Data Link Layer

    • IP packet is wrapped in a frame with MAC addresses.

    • NIC driver handles Ethernet/Wi-Fi.

  7. Physical Layer

    • Frame becomes signals (Wi-Fi radio waves, light pulses in fiber).

    • Travels through your router, ISP, Internet backbone → Google.


๐Ÿ”น Visual Diagram

Here’s how the HTTP request is wrapped at each OSI layer:

Application → GET / HTTP/1.1 Presentation → [Encrypted with TLS] Session → [TLS Session Established] Transport → TCP Segment [Port 443] Network → IP Packet [Src IP → Dst IP] Data Link → Ethernet/Wi-Fi Frame [Src MAC → Dst MAC] Physical → 0s and 1s → Signals over cable or Wi-Fi

And when the data reaches Google, the layers are unwrapped in reverse order until the server reads the original HTTP request.


๐Ÿ”น Final Thoughts

The OSI model may seem abstract, but it’s a great way to understand who does what in networking:

  • Apps and libraries handle the top layers.

  • Operating systems handle transport and network logic.

  • Hardware handles data link and physical layers.

So next time you open a website, remember: your tiny GET request goes through 7 layers of work before it even reaches the server.

Comments

Popular posts from this blog

REST vs RPC vs GraphQL: Choosing the Right API Style

Fibonacci Agile Estimation

How to Add LICENSE.txt to Your .NET Project Using Azure Pipelines