What is the OSI model, and why should you learn it?

Elijah Raji
6 min readMay 21, 2022

--

Photo by Taylor Vick on Unsplash

What is The OSI Model

The OSI(Open Systems Interconnection) model is a conceptual framework that describes the functionality of a networking system. The OSI model breaks down computer networking functions into a universal set of protocols/rules in order to support interoperability between different devices and software.

The layers help network managers visualize what is going on within their networks and can help them narrow down(troubleshoot) problems with the network, as well as computer programmers (when developing an application, which other layers does it need to work with?). Tech vendors selling new products will often refer to the OSI model to help customers understand which layer their products work with or whether it works “across the stack”.

It was published in 1984 by the International Organization for Standardization (ISO). The OSI model is not the model the world accepted: the TCP/IP model is what is widely used now. However, it is still used as a reference model to get a deeper understanding of the inner workings of a network system. The TCP/IP model is kind of the OSI model compressed into 4 layers instead of 7.

The 7 Layers of the OSI Model

1. Physical layer

The physical layer is the first/lowest layer of the OSI model. It is concerned with electrically, optically or wirelessly transmitting raw unstructured data as bits across the network from the physical layer of the sending device to the physical layer of the receiving device. The way data will be transmitted will depend on the network adapter used for example Ethernet cable, coaxial cable, USB cable etc uses electrical signals to transmit data while fibre optic cables used light pulses bouncing through a transparent body like glass or plastic. wireless uses electromagnetic waves like radio waves or electromagnetic radiation like Bluetooth to transmit bits

The physical layer can include specifications such as voltages, pin layout, cabling, and radio frequencies. At the physical layer, you might find “physical” resources such as cabling, repeaters, network adapters or modems.

2. Data Link layer

The data link layer does what it sounds like. It links the physical world of things to the logical world of data. It handles the movement of data into and out of the physical world. this is where the physical on and off of electricity is converted to 1s and 0s the crest and trough of the waves are converted to 1s and 0s the light pulses etc. depending on the medium you are using. All this magic happens in the specific network adapter you are using NIC(Network Interface Card)

The main function of the data link layer is:

  • It ensures data flows at a pace that doesn’t overwhelm sending and receiving devices. This is done through a concept called “window size” which opens or deduces the window for data to flow in or out based on the amount of data the device can receive. or the amount of data that is lost during transmission
  • It permits the transmission of data to Layer 3, the network layer, where it is addressed and routed. This is done by binding IP addresses to MAC addresses
  • It handles problems that occur as a result of transmission errors. it does this by resending any data/frame that is lost during transmission. And it knows if data is lost when the sending device did not receive an acknowledgement of receipt from the receiving device.

The data link layer has two sublayers:

  1. logical link control (LLC) sublayer

2. media access control (MAC) sublayer

As described by the IEEE 802 LAN specification, the role of the LLC sublayer is to control data flow among various applications and services, as well as provide acknowledgement and error notification mechanisms. The LLC sublayer can then talk to a number of IEEE 802 MAC sublayers, which control access to the physical media for transport. It is also responsible for the physical addressing of frames.

The two common MAC layer implementations include Ethernet and 802.11 wireless specifications.

switches and network interface cards exist in this layer

3. Network layer

The network layer is what makes it possible to communicate with remote devices. in this layer reside the IP address: which is the logical address assigned to any host on the network. The two major versions of IP are:

  1. IPv4 which looks similar to this: 192.168.0.1. IPv4 is more popular but it is becoming faced out because it has a limited number of addresses and can’t keep up with the rapid expansion of the internet
  2. IPv6 which looks like this: 2001:0db8:85a3:0000:0000:8a2e:0370:7334. IPv6 addresses are more than enough for us to use in a thousand years and it is becoming more popular every day

Data in the network layer is called packets

Routers and layer 3 switches exist in this layer

The network layer and its communication with the adjacent layer are going to be your main concern if you are a network engineer.

4. Transport layer

At this point, the address of the sender and receiver are known. the transport layer defines how that data is transmitted. There are two common protocols here in the transport layer which are: TCP and UDP

  1. TCP is used when the connection needs to be reliable, every data loss must be resent and every data sent must be acknowledged
  2. UDP is used when the connection when you don’t need to resend lost data or acknowledge every data sent. examples of real-world applications using UDP are: real-time traffic like voice or video calls, online gaming and live streaming, and other protocols like DHCP(used for assigning IP Adress to a host)

5. Session layer

The session layer opens a session when a connection needs to happen and closes the session when the communication has been done or leaves it open if it is expecting more communication basically its job is establishing, maintaining, synchronizing, and terminating sessions between end-user applications. for example, real-time communication will require the session to remain open.

6. Presentation layer

The presentation layer deals with how data is presented. data can take many forms and formats: it can be an HTML file, an image file, a media file etc. it can also present the file as either clear or encrypted. the important thing to remember is that it deals with how the data is represented.

7. Application layer

The application layer is concerned with all the applications that use the network. Web browsers, online games and every other application that enable us to use the network exist on this layer. thus is where your focus will be if you are an application developer. the common protocols that are used here are HTTP, SMTP, SSH etc. This layer and the physical layer are the layers the average network user face in their day to day activities.

How to easily remember the layers of the OSI model according to their order

I know it’s not easy to remember all layers in the OSI reference model according to their order. and you need to remember them in their order. it’s not helpful to remember the layers randomly. Remembering them in their other helps you to easily troubleshoot a faulty network, as you will see shortly.

Please Do Not Throw Sausage Pizza Away.

you can also start from layer 7:

All People Seem To Need Data Processing.

why you should learn it

troubleshooting

(is it a physical issue or something about the application?)

Photo by Sammyayot254 on Unsplash

Summary

  1. The physical layer everything physical about the network-cables, waves, light etc. basically the physics of the network
  2. Datalink layer links the physical and the logical basically turning Physics into Maths
  3. The network layer makes it possible to find any host in a network
  4. The transport layer uses TCP or UDP depending on whether the connection should be reliable or not
  5. The session layer opens, closes or maintains the session
  6. The presentation layer deals with how the data is presented
  7. Application layer If you like this post give it some claps and follow me to stay updated

--

--

Elijah Raji

A guy who loves chess, movies, video games, music, coding, writing, and others I haven't mentioned or discovered yet. I will share some of my thoughts here.