Following one web request down the stack
Suppose you open https://example.com in a browser. At layer 7 the browser builds an HTTP request, and DNS is used to turn the name into an IP address. TLS wraps the request in encryption, which is the part loosely assigned to layers 5 and 6. At layer 4 TCP splits the data into segments, adds the destination port 443 and a source port chosen by your computer. At layer 3 each segment is placed in a packet with your IP address and the server's. At layer 2 the packet is put into a frame addressed to the MAC address of your router, since the server is not on your local network. At layer 1 the frame becomes electrical, optical or radio signals. Each router along the way strips off and rebuilds the layer 2 frame but leaves the layer 3 packet largely intact, while the server reverses the whole process. Seeing the path once makes the terms 'encapsulation' and 'hop' far less abstract.
Why the model still matters for troubleshooting
Thinking in OSI layers gives you a systematic way to isolate a problem. Start at the bottom: is the cable plugged in and the link light on (Layer 1)? Is the device on the right VLAN and is its MAC address visible on the switch (Layer 2)? Can it reach the default gateway and get a reply to ping (Layer 3)? Is the right port open on the firewall and is the service listening (Layer 4)? Is the application itself returning errors, such as an expired certificate or an HTTP 500 response (Layers 5 to 7)? Some engineers work from the top down instead, starting with the symptom the user sees. Either way, ruling out one layer at a time stops you from changing settings at random.
Frequently Asked Questions
Is the OSI model actually used in real networks?
Not as a literal seven-layer protocol stack. Real-world networking runs on the TCP/IP model. OSI survives as the standard teaching and troubleshooting framework because it breaks concepts down more precisely, even though a few of its layers, 5 and 6 especially, do not map cleanly onto anything actually implemented today.
What is the easiest way to remember the seven layers in order?
A common mnemonic is 'Please Do Not Throw Sausage Pizza Away' for Physical, Data Link, Network, Transport, Session, Presentation, Application, from layer 1 to layer 7. For the top-down order, 'All People Seem To Need Data Processing' is often used.
At which layer does a router, a switch, or a firewall work?
A switch normally works at layer 2 using MAC addresses, and a router at layer 3 using IP addresses. A firewall can work at layer 3 and 4 if it filters by address and port, or up to layer 7 if it inspects application content, so the answer depends on the type of firewall.
Where do HTTPS and TLS fit in the OSI model?
HTTP is a layer 7 protocol. TLS encrypts the connection and is commonly assigned to layers 5 and 6 in the OSI model, although in the TCP/IP model it simply sits between the transport and application layers. Different textbooks place it differently, which is a good sign that the OSI layers are a teaching tool.
If ping works but a website does not load, which layer should I suspect?
A successful ping shows that layers 1 to 3 are working between the two hosts. The fault is then likely higher up: a blocked or closed port at layer 4, a DNS problem or a misbehaving web server at layer 7, or a firewall that allows ICMP but not HTTP.