What is the OSI model and encapsulation vs TCP/IP

A quick overview of the Open Systems Interconnections Model (OSI).

What is the 7-layer OSI model?

The 7-layer Open Systems Interconnection (OSI) model describes and standardizes how devices interact on a network and how data is packaged (encapsulated) so that different interfaces forward it to the proper destination.

How the OSI model was developed

In the 1960s and 1970s, computers were large and could only manually transfer data that had been written to or read from physical disks. Universities wanted to connect their computers to share research faster and more securely, leading to the creation of networks.

However, each network needed to function in the same way. As a result, the International Standards Organization (ISO) established the OSI model to describe how the different pieces of a network work together based on earlier telecommunications, such as telephone, television, and radio.

The layers of the OSI model

The OSI model consists of 7 layers. Data flows from either the application layer to the physical layer or from the physical layer to the application layer. Each layer represents a physical or logical point that data reaches along its path.

1. Physical layer

The physical layer deals with network hardware, such as ethernet cables, voltage, coaxial cables, and fiber optics. At layer 1, data is represented as binary bits (ones and zeroes) that signify electrical charges flowing through physical networking equipment.

2. Data link layer

The data link layer handles data transfer across physical connections. It organizes bits into frames, adds error detection and correction, and manages access to the physical parts of the network. This layer is sometimes described as having two sublayers:

  • The Logical Link Control (LLC) sublayer translates physical processes to layer-3 network processes.
  • The Media Access Control (MAC) sublayer describes the physical location of devices using MAC addresses, sometimes called physical addresses. These are 48-bit addresses written directly to the network interface card of any device.

At layer 2, data is encapsulated into ethernet frames, which switches can read.

3. Network layer

The network layer deals with processes that make and transport data packets, as well as those that route packets to their destinations. It handles Internet Protocol (IP) forwarding and uses IP addressing to determine where data should go.

At layer 3, data is encapsulated into an IP Packet, which routers read. Packet headers can provide further instructions to layer-3 devices about where and how to send data.

4. Transport layer

The transport layer handles data delivery between devices. Transport protocols, like ransmission Control Protocol (TCP) and User Datagram Protocol (UDP), operate at this layer. It also provides support services like flow control and error recovery.

Layer 4 devices and processes are encapsulated into data segments and use port numbers to determine how data is sent. For example, firewalls can accept only encrypted transmissions to improve security, such as blocking Hypertext Transfer Protocol (HTTP) traffic (which is unencrypted) while accepting HTTPS traffic (which is encrypted).

5. Session layer

The session layer starts, manages, and ends communication sessions between applications. It enables synchronization and checkpointing, which allows two endpoints to establish a session and resume communication if interrupted.

6. Presentation layer

The presentation layer makes data presentable to computers. It encrypts and decrypts data, translates different coding languages into bits, and processes data.

7. Application layer

The application layer covers all the processes that a user interacts with, such as when they click a link or send an email. This layer doesn’t cover applications but rather the processes that allow applications to function in a network environment.

This layer includes protocols like HTTP, Simple Mail Transfer Protocol (SMTP), and Real-Time Streaming Protocol (RTSP). Your email application isn’t considered part of the application layer, but the rules it uses to send and receive emails (SMTP) are.

OSI model vs the TCP/IP model

The OSI model was developed before the internet was even invented. Instead of the OSI model, most network professionals today use something called the TCP/IP model. Luckily, these models are very similar. In practice, many networking professionals use the TCP/IP model because it is similar to the OSI model but has 4 layers. Still, the OSI model provides a suitable framework for developing network infrastructure and provides the groundwork for the TCP/IP model.

The main difference between the two is that the TCP/IP model is condensed. Layers 5-7 are combined into a single application layer, which can include the same processes as the OSI model. This is because modern internet protocols cover functionality on more than one of those 3 layers, and not all protocols use all 3 layers in every situation.

Here is a comparison of the OSI and TCP/IP models, as well as common protocols and services at each layer:

What is the OSI model and encapsulation vs TCP/IP Figure 1: The OSI model vs TCP/IP.

OSI model encapsulation PDUs vs TCP/IP

One of the main things that the OSI model defines is encapsulation. To send data between devices, the data is broken down into parts that different physical devices and processes can understand and handle.

For encapsulation, the TCP/IP model uses terms like segment, packet, and frame depending on the layer, but the OSI model uses the term protocol data unit (PDU) for every layer. A PDU includes the encapsulated data, headers, and trailers for the layer. PDUs are numbered from 1 (the physical layer) to 7 (the application layer). For example, a layer 2 PDU refers to the data encapsulated at the data link layer of the OSI model.

Here is a graphical representation of all the PDUs in the OSI model:

OSI Model Encapsulation PDUs Figure 2: OSI Model Encapsulation PDUs

Conclusion

The OSI model is a helpful framework to describe how different devices on a network communicate. It’s useful for troubleshooting and describing networks. Even though the TCP/IP model mostly replaced it, the OSI model was an important step in developing the modern internet, and you’ll still see it referenced from time to time.

The OSI model specification is available for purchase on the ISO website. You can also read some of the specifications for free. You can also find a simplified explanation, along with use cases.

Did you find this article helpful?

0 out of 0 Bunnies found this article helpful

Glossary

TCP

Transmission Control Protocol.

OSI

Open Systems Interconnection Model. A seven-layer model that describes how different parts of networks function.

Prove your Knowledge.
Earn a bunny diploma.

Test your knowledge in our Junior and Master Quizes to see where you stand. Prove your mastery by getting A+ and recieving a diploma.

Start the QuizBunny with a diploma.