Networking Fundamentals: OSI vs TCP/IP Explained
If you’ve ever wondered how data travels across the Internet, the answer lies in two networking models: OSI and TCP/IP.
Understanding the OSI and TCP/IP models is fundamental for anyone working with networks. While the OSI model provides a conceptual framework for learning and troubleshooting, the TCP/IP model represents the protocol stack that powers the modern Internet.
When you access a webpage, write a message to your friend or read an e-mail, data is being sent over the network to access the resources that you requested. This data is transmitted in a standardized and structured way, enabling compatible and interoperable systems to communicate seamlessly. The best way to understand how this standardized communication works is the OSI reference model, which breaks the networking stack into seven distinguishable layers.
All seven OSI layers (bottom up):
- Physical (Bits)
The raw bits that are sent via the physical medium.
e.g. radio waves, electrical signals - Data link (Frames)
Bits are organized into frames, enabling communication within the same local network.
e.g. Ethernet - Network (Packets)
Enables communication between different networks by routing packets using logical addressing.
e.g. IP addresses - Transport (Segments/Datagrams)
Responsible for end-to-end communication, segmentation, reliability, and flow control between hosts.
e.g. TCP, UDP - Session
Establish and terminate a session between end-devices. - Presentation
Responsible for data representation, encryption, compression, and translation between different data formats.
e.g. TLS, SSH - Application (Data)
Provides network services directly to applications.
e.g. HTTP
When data is sent, it moves down the OSI stack where each layer encapsulates the data with its own metadata (headers).
When data is received, the process is reversed and the layers de-capsulate the data from bottom to top.
Get Kilian J’s stories in your inbox
Join Medium for free to get updates from this writer.
Each layer adds its own meta-information to the data so that the receiving end knows how to process it. By separating networking into layers, technologies at one layer can change without affecting the others, as each layer itself is independent and does a specific task for the other layers.
A common mnemonic for remembering the OSI layers from bottom to top is:
Please Do Not Throw Salami Pizza Away!
While the OSI model provides a conceptual understanding of networking, real-world internet communication is based on the TCP/IP model.
The TCP/IP Model
The concept is the same, split up the networking stack into several layers, that allow you to easily replace technologies, watch data flow and debug each layer individually instead of having to analyze the entire system as a whole. However, TCP/IP has only four layers, that combine some OSI layers. Here are the TCP/IP layers (bottom up):
- Network Access
Combines OSI Physical and Data Link - Internet
Equivalent to OSI Network - Transport
- Application
Combines OSI Session, Presentation and Application
The name TCP/IP comes from Transmission Control Protocol/Internet Protocol and therefore refers to both of the most widely used protocols in the internet today: TCP for connection-oriented communications and IP for addressing hosts on the internet and routing packets.
To further deepen your understanding, here is a practical walk-through of the process of data being sent via TCP/IP:
Example: User wants to open a website (top to bottom)
- Application Layer: Browser sends HTTP request
[Data] - Transport Layer: TCP initiates connection and segments data
[TCP Header | Data] - Internet Layer: IP determines where the packet should be routed
[IP Header | TCP Header | Data] - Network Access Layer: The packet is encapsulated into a frame and transmitted over the physical network (e.g. Ethernet or Wi-Fi)
[Frame Header | IP | TCP | Data] → translated to binary for sending
As you can see, each layer adds meta-information on top. At the receiving end the order of operations is exactly reversed:
- Network Access Layer: physical bits are received
[Frame Header | IP | TCP | Data] - Internet Layer: The IP header is processed to verify the destination address
[IP | TCP | Data] - Transport Layer: TCP reassembles the segments and ensures reliable delivery
[TCP | Data] - Application Layer: The web server receives the HTTP request and returns the webpage
[Data]
Understanding the OSI and TCP/IP models is essential for anyone learning networking. While the OSI model provides a conceptual framework for understanding and troubleshooting networks, the TCP/IP model represents the real protocol stack used by the Internet.
I hope this article has helped you understand why we use layered models in networking to visualize data-flow and what the difference between OSI and TCP/IP is. If it has, feel free to share it!
Thank you for reading, I am looking forward to reading your comments!








