OSI (Open Systems Interconnection) and TCP/IP are two standardized models that are widely referenced in today’s world. The concepts are similar, the only difference between the two is in the number of layers itself.

In OSI There are 7 Layers, they are listed below along with some protocols that are used on these layers:

1. Application Layer (HTTP/HTTPs, FTP)

2. Presentation Layer (SSL, FTP)

3. Session Layer (ACK, SYN, API)

4. Transport Layer (TCP/UDP)

5. Network Layer (IP, Routers)

6. Data Link Layer (Switches, MAC)

7. Physical Layer (Ethernet, WiFi)

The best way to remember the 7 layers in order is through mnemonics, there are multiple mnemonics that people have associated with these 7 layers. One can also come up with their own version in order to remember it more easily as beginners have a difficult time remembering the 7 layers in their proper order.

The TCP/IP model is relatively the newer version of the OSI model with only 5 layers (Some may even say 4 layers but it’s still the same thing.)

1. Application

2. Transport Layer

3. Internet Layer

4. Data Link Layer

5. Physical Layer

For the OSI model, lets discuss from Layer 7 to Layer 1. This is also known as encapsulation. Whereas Layer 1 to Layer 7 is known as de encapsulation.

Layer 7 (Application): The GUI interface that users see, in simple words making services available to the user. Most common example is your Web Browser.

Layer 6 (Presentation): This layer is responsible for formatting the data, encryption of data is also done at this layer.

Layer 5 (Session): This layer establishes and terminates connections between devices. It also determines which packets belong to which files.

Layer 4 (Transport): This layer is responsible for data transfer between hosts. Also decides if data is supposed to be sent through reliable (When acknowledgement is required from the host to whom data was sent — TCP Packet) or unreliable (When acknowledgement is not required — UDP Packet) path.

Layer 3 (Network): This layer determines how data is to be routed, Logical address and host address of the packet are also added at this layer.

Layer 2 (Data Link): This layer is responsible to move data into or from the physical link in a network.

Layer 1 (Physical): This is the final layer through which data is actually transmitted or received.

One thing to note is that Layer 7 to Layer 2 are all logical layers, actual movement of data takes place only at the Physical layer.

The TCP/IP model is then a compressed version of the OSI layer. The overall data transmission path is same; TCP/IP is only compressed into 5 layers.

Layer 1 (Application): Top three layers of the OSI model i.e. Application, Presentation and Session layer are called Application Layer in TCP/IP Model.

Layer 2 (Transport): Similar to the Transport Layer of the OSI Model.

Layer 3 (Internet): Similar to the Internet Layer of the OSI Model.

Layer 4 (Data Link): Similar to the Data Link Layer of the OSI Model.

Layer 5 (Physical): Similar to the Physical Later of the OSI Model.

You may also see that TCP/IP is 4 layers in books or over the internet, it is the same model, they have only further compressed the Data Link Layer and Physical Layer into one and call it the Network Interface Layer.