OSI Model
Open Systems Interconnection Model
- In Turkish
- OSI Modeli
In short
The OSI model is a conceptual framework that splits network communication into seven layers, from physical cables up to the applications people use.
What is the OSI model?
The OSI (Open Systems Interconnection) model is a reference framework, published by the International Organization for Standardization (ISO) in 1984, that describes network communication as seven stacked layers. Each layer has one job and relies only on the layer directly below it. From bottom to top, the layers are Physical (1), Data Link (2), Network (3), Transport (4), Session (5), Presentation (6), and Application (7).
When you send data, it travels down the layers on your machine, and each layer wraps it with its own header, a process called encapsulation. The Transport layer (for example, TCP or UDP) adds port numbers, the Network layer (IP) adds IP addresses, and the Data Link layer (for example, Ethernet or Wi-Fi) adds hardware MAC addresses before the Physical layer turns everything into electrical, light, or radio signals. On the receiving machine, the process runs in reverse: each layer removes its own header and passes the rest up.
A helpful analogy is sending a letter through a company mailroom: you write the message, an assistant puts it in an envelope and addresses it, and the postal service moves it without caring what the letter says. Developers mostly use the OSI model as a shared vocabulary, for example calling a load balancer that routes by URL a layer 7 load balancer, one that routes only by IP address and port a layer 4 load balancer, and a network switch a layer 2 device. It is also a practical troubleshooting checklist, working up from whether the cable is connected to whether the application responds.
The OSI model is often confused with the TCP/IP model, which is what the internet actually runs on. The TCP/IP model uses four layers and folds the OSI Session, Presentation, and Application layers into a single Application layer, so real protocols such as HTTP and TLS don't map neatly onto OSI layers 5 and 6. Think of OSI as a teaching and naming tool rather than a precise description of how today's protocols are built.
At a glance
Key takeaways
- The OSI model divides networking into seven layers, from Physical (1) to Application (7).
- Each layer adds its own header as data moves down the stack, a process called encapsulation.
- Layer 3 handles IP addresses and routing; layer 4 handles ports and protocols such as TCP and UDP.
- Terms like layer 4 and layer 7 load balancer come from the OSI model.
- The internet actually runs on the simpler four-layer TCP/IP model.
Example
# Layers 1-2: is the network interface up and connected? (Linux)
ip link show
# Layer 3: can we reach the router by its IP address?
ping -c 3 192.168.1.1
# Layer 4: is TCP port 443 open on the server?
nc -zv example.com 443
# Layer 7: does the web server answer HTTP requests?
curl -I https://example.comReaders ask
What are the 7 layers of the OSI model?
From bottom to top, they are Physical, Data Link, Network, Transport, Session, Presentation, and Application. A common way to remember them from the bottom up is the phrase Please Do Not Throw Sausage Pizza Away.
What is the difference between the OSI model and the TCP/IP model?
The OSI model is a seven-layer conceptual framework, while the TCP/IP model is a four-layer model that describes the protocols the internet actually uses. TCP/IP combines the top three OSI layers into one Application layer and merges the Physical and Data Link layers into one Link layer.
What is the difference between a layer 4 and a layer 7 load balancer?
A layer 4 load balancer routes traffic based only on IP addresses and ports, without looking inside the data. A layer 7 load balancer understands application protocols such as HTTP, so it can route by URL path, headers, or cookies.
See also
- TCPNetworking, p. 30TCP is a core internet protocol that delivers data between two programs reliably and in order, by opening a connection and resending anything that gets lost.
- IP AddressNetworking, p. 10An IP address is a numeric label assigned to each device on a network so that data can be routed to it, much like a postal address for a house.
- PacketNetworking, p. 20A packet is a small, formatted unit of data sent across a network, made of a header with addressing information and a payload that carries the actual data.
- HTTPWeb Development, p. 19HTTP is the protocol that browsers, apps, and servers use to exchange web pages and data through a simple cycle of requests and responses.
- Load BalancerDevOps & Cloud, p. 34A load balancer is a server or service that spreads incoming traffic across several backend servers so no single one is overloaded and the app stays available.
- PortNetworking, p. 22A port is a number from 0 to 65535 that identifies a specific program or service on a device, so traffic reaching an IP address gets to the right application.
Sources
Spotted a mistake or something missing on this page?Suggest an edit