The Open Systems Interconnections Model
The OSI model is a critical building block in the understanding of networking. In this chapter, we shall discuss the OSI model and specifically look at how it helps devices in the same network communicate.
We will start by discussing the reasons for using the OSI model. Then, we shall focus on the layers of the OSI models and explain how traffic flows between hosts in a network concerning the OSI model.
The primary factor behind the creation of the OSI model is to enhance communication across devices from various vendors. The OSI model also helps promote communication between hosts using different operating systems such as Windows, Linux, and OSX. Worth noting is that you will rarely encounter systems that natively utilize protocols that conform to the OSI reference model.
That notwithstanding, you need to understand the OSI model since other networking models such as the conventional TCP/IP build on the OSI reference model.
Like other networking models such as the Internet model, the OSI model operates by dividing the functions, the network protocols, and the devices in the network into various layers. Each of the Layers in the network model is responsible for certain network functions, and only the devices capable of performing this function reside in that layer.
Benefits of Dividing a Network Into Various Layers
Dividing the network into various layers has various benefits such as:
- It makes troubleshooting easy: Communication in a layered network model further divides into small and simple components, which thus makes developing, deploying, and troubleshooting the network very easy.
- Because the network is layered, the vendors of various applications and devices only focus on writing the output and input specifications for the targeted layer. For example, a developer writing a web application does not need to know the specifications of an RJ 45 connector at Layer 1 of the OSI model. In such a case, this developer would focus on the layer related to the web application.
- Each layer functions independently; thus, changes in one layer do not affect the other layers in the network model. For example, a new wireless network does not affect how old applications run. An old version of Internet Explorer does not fail to run because the user is running a modern network connection.
- It makes standardization of functions divided into small independent sections easier.
- Layered networks let several categories of hardware and software, both new and old, to interconnect with each other flawlessly.
The OSI reference model has seven layers that further fall into two groups. The upper layers, which are Layers 7, 6, and 5, define how applications interact with the host interface, with each other, and the user. The lower four layers, which are Layers 4, 3, 2, and 1, define the transmission of data between hosts in a network.
The figure below shows the seven layers, with a summary of the functions of each layer.
Figure: Seven Layers of OSI Reference Model
The sub-sections below discuss each layer of the OSI model in detail:
1: Layer 7: Application Layer
The application layer is the topmost layer of the OSI model. It provides an interface between software applications on a specific host and the network.
On its own, the application layer does not include the software application; instead, it provides the underlying service required by the software. The best example is a browser such as Chrome or Mozilla Firefox and how it works.
When connecting to a website using such a browser, it utilizes the HTTP protocol that resides under the application layer of the OSI model to send and receive the contents of a requested webpage.
The HTTP protocol is available for use by various applications such as Opera, Internet Explorer, etc. However, the application —browser in this case— is not in the application layer.
On the other side of the webserver, applications such as NGINX, APACHE, or Microsoft IIS uses the same HTTP protocol to send and receive the HTTP requests from the browsers.
NOTE: The software application is not part of the OSI model.
2: Layer 6: Presentation Layer
As the name proposes, the presentation layer, which is the second topmost layer in the OSI model, is responsible for data presentation to the Application Layer.
The Presentation layers perform operations such as data encoding and translation. It takes data from the application layer and translates it into various generic formats that are then transported across the network. Once the presentation Layer receives the data, it reformats the data into formats recognized by the Application Layer.
A popular example of this data translation and encoding is the EBCDIC to ASCII translation technique. The OSI model provides standardized protocols used to define how the formatting of the data.
It is good to note that the Presentation Layer is also responsible for data compression, decompression, encryption and also decryption.
3: Layer 5: Session Layer
The session layer is responsible for separating sessions of an application from others. For instance, different applications in a host, or, in some cases, different instances of the same application in a host might request and send data to and from the network. If this happens, the Session Layer is responsible for keeping the data from each requested session separate. It performs this by setting up, managing and terminating sessions.
It also helps establish and control dialogue between hosts as well as coordinate communications between systems in a network
4: Layer 4: Transport Layer
Unlike the layers above it, the transport layer, which deals with the applications and the data within the host connected to a network, mainly focuses on the definite end-to-end data transfer across the network.
The transport layer is responsible for the establishment of a logical connection between two interconnected hosts. It also provides a reliable and unreliable data delivery medium. The transport layer also provides easy and clean data flow as well as error recovery in the network.
Examples of Layer 4 are the User Datagram Protocol and the Transmission Control Protocol. It is, however, good to note that transport layers are not developed and do not conform to the OSI reference model.
5: Layer 3: Network Layer
To explain clearly what the Network layer of the OSI model does, we shall use an analogy.
Consider a scenario of someone mailing a letter via the postal service. After writing the letter, the first step is to place it in the envelope. The second step is to make sure you write down the destination address as well as the origin address so that the letter can return to you if undelivered.
In networking, this address is what we call a logical address, which is unique in that network.
Just as a street cannot have two similar addresses, in a network, each connected host has its own logical address. Once you hand over the letter to the postal service, it is the work of the postal service to determine the best path the letter should take to reach the specified destination. The same case applies in a network. However, in a network, the router needs to determine the best path it should use to reach the specified logical address. We call this process path determination.
In the final process, the postal service mails the letter using the path determined. Similarly, data moves across the network from point to point, mainly by routers until it reaches the correct destination.
The Network Layer of the OSI model completes functions performed by the postal service such as logical addressing, path determination and data forwarding to the correct address.
Routed protocols, used for logical addressing, and data forwarding and routing protocols used for correct path determination, are the two main protocols used in Layer 3 of the OSI model.
It is good to note that devices such as routers reside at the Network Layer. They, however, do not concern themselves with the destination host; they concern themselves with the destination network only. Tasks for host delivery are under the purview of the next layer of the OSI model, the Data Link Layer.
6: Layer 2: Data Link Layer
The Network layer is responsible for the movement of data across networks through logical addresses. On the other hand, the Data Link layer is responsible for the movement of data in a local network via physical addresses.
Every host connected to a network has a logical and physical address. The physical address is significant on a local network and unusable beyond the boundaries of the network. The data link layer also handles the protocol definitions used to send and receive data across a network media.
Earlier, we talked about how only a single host in the same network could send data packets at a time to avoid the data packets from colliding in a single domain collision. The Data Link layer helps determine when the transfer media is ready for the host to send the data packets. It is also responsible for detecting collisions in a network as well as the errors in received data. Devices that reside under the Data Link Layer include switches.
7: Layer 1: Physical Layer
The Physical layer, as the name suggests, deals with the transmission of data across a physical medium. Its functions include activating, maintaining and deactivating the physical medium between the connected systems. A router and a laptop are an example.
Critical elements of physical mediums such as ethernet cables are defined here. These elements include the voltage, connectors, the pin-outs, etc. The physical layer converts the received data to and from bit to electrical current for transportation across devices in the network. Hubs are popular devices that reside under this layer
Conclusion
Quick guide to the OSI model. If you wish to become a networking engineer, it will be critical to master and understand the OSI model. Check out more networking tutorials.