What is the OSI model?
The Open Systems Interconnection (OSI) model is a model used to standardize the way different computer systems communicate with each other over networks. It divides the communication system into seven abstract layers, stacked upon each other, wherein each layer has a specific set of responsibilities and communicates with the layers above and below it.
The reason the model exists is to allow effective troubleshooting of networking issues and problems. Ironically enough, the Internet itself does not follow the OSI model (it follows the TCP/IP protocol which is simpler), but it does however still come in useful for troubleshooting as it is pretty much a networking standard.
The 7 Layers of the OSI model
As mentioned previously, the OSI model is made up of 7 layers stacked on top of each other. Typically, it is listed in descending order as follows:
- Layer 7: Application layer
- Layer 6: Presentation layer
- Layer 5: Session layer
- Layer 4: Transport layer
- Layer 3: Network layer
- Layer 2: Data Link layer
- Layer 1: Physical layer
I will try to give a short summary of each layer below.
Layer 7: Application Layer
The application layer serves as the interface between the network and the user. It is the only layer that directly interacts with data from the user itself. This however does not mean client software applications form part of the application layer, rather it is the protocols and services that are utilized by the application to communicate over the network that form part of it. Examples of this include HTTP, SMTP, DNS and FTP. These allow client applications to effectively communicate with one another over networks.
Layer 6: Presentation Layer
The presentation layer is also known as the syntax layer, and is responsible for preparing the data so that it can be used by the application layer. It ensures that data received from the application layer of one system can be translated and understood by the application layer of another system. It is responsible for translation, encryption, compression of data, and enabling interoperability between different systems.
This is the layer wherein encryption/decryption occurs, as well as translation between different encoding methods, so that the communicating systems’ application layers can understand one another. Compression is also completed on this layer, before data is sent to layer 5, mainly for speed and data transport efficiency.
Layer 5: Session Layer
The session layer … manages the communication session between the two systems/devices (pretty verbose, I know). It manages and controls the overall connections, by managing the opening and closing stages, which results in the “session”. It manages the communication session by ensuring that the connection stays open long enough to transfer the data being exchanged, and then closing it to avoid resource wastage. It also manages checkpointing and recovery, allowing it to synchronize data transfer with checkpoints - which becomes useful in large data transfer cases - such as large file transfers/uploads etc. This is the layer where/how downloads and uploads can be resumed, since this layers track such information through the use of the session checkpointing.
Examples of protocols that operate at this layer include Remote Procedure Call (RPC), Point-to-Point Tunneling Protocol (PPTP), Session Initiation Protocol and NetBios.
Layer 4: Transport Layer
The transport layer manages the end-to-end communication services between the two systems/devices. On a transmitting device, it takes data from the session layer and chunks it into segments before it is sent to layer 3, and on a receiving device, it reassembles those segments into data that layer 4 (the session layer) can consume.
This layer is also responsible for flow and error control. Flow control manages the speed of transmission so that the two devices can communicate optimally without overwhelming one another. The error control then performs error checking on the receiving end to ensure no data-loss occurs, and requests a re-transmission if it does occur.
Examples of protocols that operate at this layer include the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP).
Layer 3: Network Layer
The network layer is responsible for managing data transfer between two networks. It manages the data routing, forwaring and addressing between the two networks. This layer becomes unnecessary if two devices are on the same network.
At this layer, data is broken into packets from the sending device, and reassembled on the receiving device. It also determines the most efficient/best physical path for the data to travel across the network to reach its destination (in other words - it’s the GPS layer of the OSI model).
Protocols that operate at this layer include the Internet Protocol (IP), the Internet Control Message Protocol (ICMP) and the Routing Information Protocol (RIP).
Layer 2: Data Link Layer
The data link layer is very similar to the network layer, however it manages the data transfer between devices on the same network. It is also responsible for the flow control and error control for communication within the same network (as compared to the transport layer - which manages the flow and error control over different networks).
The data link layer takes the packets from the network layer and breaks them down into smaller frames to be transported.
Media Access Control (MAC) addresses are also managed at this layer.
Protocols that operate at this layer include Ethernet and the Point-to-Point Protocol (PPP).
Layer 1: Physical Layer
The physical layer effectively is the layer where the physical network devices come into play, such as cables and switches. This is the layer where data gets converted into binary streams (the magic 1s and 0s that makes hacking look cool). (PSA: a bit is just short form for binary digit if you didn’t know).
For the physical devices to effectively transfer the bits, they must agree on a signal convention so that the 1s can be differentiated from the 0s on both sides.
Fiber optical cables and Wi-Fi operate at this layer (as well as other network cables).
How data is transferred throught the OSI model
The OSI model essentially works in a loop when data is transferred between two devices. From the sending device, data gets transferred down from layer 7 to layer 1, and then when it is received by the receiving device it gets transported back up from layer 1 to layer 7 again.
This makes sense, as when a user does an action to intitiate some form of data transfer (for example, clicking a button to send an email), the data first needs to be translated and broken up into a standardized format and packets that the receiving device can understand, before it can be physically transferred across. This can only be done by going down from layer 7 to layer 1. Once it’s gone through all the layers, it is then in a format that can be transferred physically over the network between the two devices. Then it goes through from layers 1 to 7 again on the receiving device to reconstruct the data back into a readable format (i.e. the person receives the email and can now read it on his laptop).
Concluding Remarks
This was an interesting exercise in understanding how general networking systems are standardized and operate. It provides a good formal model of how data transfer occurs between two devices in a network, without overcomplicating it or going into extreme technical detail - which is perfect for a model that is effectively a networking standard.
I hope this set of notes was useful, and as always, feedback and corrections are always appreciated!