The TCP/IP model is very similar to the OSI model in many aspects. It was developed a little earlier and is the basis for real network interactions. The TCP/IP model consists of four layers: application, transport, Internet, and network interface. These layers cover the same range of functions as the seven layers of the OSI model.
| Layers of the TCP/IP model |
|---|
| Application |
| Transport |
| Internet |
| Network Interface |
Note: Some modern sources divide the TCP/IP model into five layers, separating the Data Link and Physical layers, as is done in the OSI model. This is a well-known and widespread solution, but it is not officially defined (unlike the original four layers defined in RFC1122). Which version to use is your decision, both are generally considered acceptable.
You may ask: why do we even refer to the OSI model if it is not used in real networks? The answer is quite simple: the OSI model (because of its more structured approach compared to the TCP/IP model) is easier to use to learn network theory.
Comparison between TCP/IP and OSI models:
These two models can be compared as follows:
- The network interface combines the functions of the data link and physical layers of the OSI model.
- The TCP/IP application layer corresponds to the three layers of the OSI model: application, representative, and session.
- Thetransport layer in both models performs similar functions.
- The Internet layer corresponds to the OSI network layer.
| OSI | TCP/IP |
|---|---|
| Application | Application |
| Presentation | |
| Session | |
| Transport | Transport |
| Network | Internet |
| Data Link | Network Interface |
| Physical |
The encapsulation and decapsulation processes in the TCP/IP model work exactly the same as in the OSI model. At each layer of the TCP/IP model, a header is added during encapsulation and removed during decapsulation.
The practical side of the TCP/IP model
A layered model is great as a visual aid – it shows the general process of how data can be encapsulated and transmitted over a network, but how does it actually happen?
When we talk about TCP/IP, it’s not just a table with four layers, but a set of protocols – sets of rules that define how a particular action should be performed. The name TCP/IP comes from the two most important of these protocols: Transmission Control Protocol (TCP), which controls the flow of data between two endpoints, and Internet Protocol (IP), which controls the addressing and sending of packets.
TCP and three-way handshake
TCP is a connection-based protocol. In other words, before you can send any data over TCP, you must first establish a stable connection between two computers. The process of establishing this connection is called a three-way handshake.

When you try to establish a connection, your computer first sends a special request to the remote server, indicating that it wants to initialize the connection. This request contains a special SYN (Synchronize) bit that actually initiates the connection process. The server responds with a packet containing both a SYN and an ACK bit. Finally, your computer sends a packet containing only the ACK bit, confirming that the connection has been successfully established. After the three-way handshake is successfully completed, data can be transferred securely between the two computers. If data is lost or corrupted during transmission, it will be resent, making the connection virtually lossless.
History
It is important to understand why the TCP/IP and OSI models were originally created. Initially, there was no standard – different vendors followed their own methodologies, and as a result, systems developed by different vendors were completely incompatible in the context of network interactions. The TCP/IP model was introduced by the U.S. Department of Defense in 1982 to provide a standard – so that all the different vendors could follow the same scheme. This solved the problem of incompatibility. Later, the OSI model was introduced by the International Organization for Standardization (ISO); however, it is used primarily as a more comprehensive training aid, as the TCP/IP model remains the primary standard on which modern networking is based.




