Understanding the OSI Model

What it is, and how to use it to understand computer networks

Vickie Li
The Startup
6 min readJan 30, 2020

--

Why would you throw sausage pizza away? Photo by Wesual Click on Unsplash

What is the OSI model?

The OSI model is an important topic in the programming world and also a must-learn concept for any computer science major. But what does it stand for? And how does it help us understand networking problems? Today, let’s dive into answering these questions!

The OSI model stands for the “Open Systems Interconnection model”. It is a conceptual model that is used to understand computer networks.

Why the OSI model?

So why is this conceptual model used? Why bother using it when we can simply discuss the infrastructure of each networking system?

Because networks are complex. The model uses layers to help give a high-level description of what is going on within a particular networking system. It describes what goes on in a communication system without going into the nitty-gritty details of its underlying technology. The structure of the OSI model allows people to discuss problems going on in a networking system and discuss the relationships between the components of a system more easily.

For example, when a network is broken, the OSI provides a way to quickly focus in on the issue: Is it a problem with the application or a physical issue?

The Internet (or any network) is a complicated system comprised of numerous hosts, routers, data links, applications, protocols, hardware, and software. We need a way to understand it all from a high level, or we’d get confused pretty fast! And this is where the OSI model comes in.

The OSI model

The OSI partitions a communication system into seven abstraction layers. The layers are:

  • Application layer,
  • Presentation layer,
  • Session layer,
  • Transport layer,
  • Network layer,
  • Data Link layer,
  • Physical layer.

You can remember the layer names with one simple phrase:

Please do not throw sausage pizza away (PDNTSPA)

Physical, Datalink, Network, Transport, Session, Presentation, Application. (PDNTSPA)

I suggest committing the layers to memory because this is a favourite among interviewers when you are applying for an IT or security-related job. Now, let’s dive into what the layers are;

The layers

Let’s start understanding the OSI model from the top layer to the bottom layer, starting from the application layer.

Application layer

The application layer is the layer that is closest to the end-user. I like to call it the “interface layer” because functionalities implemented at this level are the ones that users interact with directly. For example, Firefox, Skype and your local email client are all application-level software.

This layer takes user input, and input from other applications to produce the data to be transferred over the network. And when data is coming in from the network, it works on displaying or storing this data to the end-user.

Presentation layer

The presentation layer is also called the “translation layer”. It “translates” data going to and from the application layer. Because data going to and from the application layer is often not in the format required to be transported over the network, it needs to be translated and “presented properly” to the next layer.

The presentation layer translates data from the network format to the application format or vice versa. An example of this would be how secure communication is implemented in HTTPS: data is encrypted before transmission and decrypted upon arrival.

Session layer

The session layer manages “sessions” between machines. For two devices on the network to communicate with each other, a “session” needs to be created to ensure authentication and security. This layer sets up, maintains and terminates these sessions.

Transport layer

The transport layer is the “traffic control” of networks. Some examples of protocols in this layer include TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).

This layer controls host-to-host data transfer and dictates how much data to send at once, how fast to send it and who to send it to. It takes care of the data segmentation and reassembly, as well as flow and error control.

Data segmentation means dividing up the data into smaller chunks prior to transmission. It is needed when the data being sent is larger than the maximum transmission unit supported by the network, or anytime when sending smaller amounts of data at a time is beneficial. Upon receiving segmented data, the transport layer protocols will also take care of reassembling the data back to its original state.

Flow and error control is also an important part of ensuring the proper functioning of a network. When too much data is being sent at a time, network congestions may happen. Then, it is up to the transport layer protocols to decide which data to send first and in what order to send them in to achieve maximum overall efficiency. Still, sometimes, data packets arrive corrupted or out of order. How to recover the original data if that happens is also the task of this layer.

Network layer

The network layer is the “post office” of networks. It takes care of the routing of data from its source to its destination. Important protocols of this layer are the Internet Protocol (IP) and various routing protocols.

In order to get from spot A to spot B on any complex network, data needs to be transmitted across the network. But where is spot B? How does the data get there? These are all tasks that the network layer is responsible for.

For example, where is the server that stores the homepage of medium.com? Where on the network is it located? The IP protocol uniquely identifies devices on the network so that the destination of each transmission can be located.

And in order for your browser to connect to a server across the country, there are a million paths that the data can take. Routing protocols help data travel on an efficient path to the destination.

Data Link layer

Once the network layer identifies where to send the data, the data link layer takes care of the data transfer between neighbouring network elements. It ensures that the data transfer is error-free over the physical layer.

The functionality implemented in this layer includes physical addressing, framing, and error and flow control.

Physical addressing refers to the addressing after a packet has arrived at the local network. To the Internet at large, machines on the same local network may have the same IP address. If that is the case, MAC addresses must be used to locate the right recipient of the message.

Framing is a way to make sure that sets of bits that are transmitted are understandable to the receiver. This is accomplished by attaching special bit patterns to the beginning and end of the frame.

This layer is responsible for making sure that all frames arrive at its correct destination when a communication channel is shared by multiple connections. It also ensures that frames arrive error-free by detecting and retransmitting damaged and lost frames.

Physical layer

And at last, we have the physical layer. The physical layer is the lowest layer of the OSI model and refers to the part of the network that is responsible for the actual transfer of bits “on the wire”. You can think of this layer as the “hardware layer”. Implementation questions in this layer include the choice of cable type, network layout, and radio frequencies.

--

--

Vickie Li
The Startup

Professional investigator of nerdy stuff. Hacks and secures. Creates god awful infographics. https://twitter.com/vickieli7