Imagine for a moment, there were no standards for how devices communicate over a network. No error checking, no security measures, no flow control, or no standard data format. The results would be pure chaos. Networks would come to a grinding halt. Business would be unable to function.
The network stack or computer network layers prevent this problem by defining a framework for interoperability between devices and software on a network.
What is the Network Stack and why is it important?
The network stack is a set of communications standards that computer and network hardware should follow so that they can communicate with other equipment attached to the network. This communication standard – the Operating Systems Interconnection (OSI) model – splits communication into seven layers stacked upon each other:
- Physical layer
- Data link Layer
- Network layer
- Transport layer
- Session layer
- Presentation layer
- Application layer
Each layer of the network stack in the OSI stack plays a specific role in how data is transferred from one device to another. Data flows up and down the stack in a “pass it along” manner. Meaning, one level receives data, performs its duty, and then passes it along to the next level. The general process is:
An application on the sending device requests to send data to another node. The information starts at the application layer and flows down the stack until it reaches the physical layer, where it is then sent across the network.
On the receiving end, the data starts at level one of the OSI stack. This data is then passed up the stack until it reaches Level 7.
Although this is a simplified example, there is much more involved. The below information outlines exactly what happens at each layer of the OSI model.
1. Physical layer
The physical layer is as it sounds. Some common items or technology found at this level include switches, category 5,6, and 7 cabling, repeaters, network adapters, and other items that are physically positioned to create the network.
The role of the physical layer of the computer network is to send raw unstructured data across the physical connection. This unstructured data made of bits of 1s and 0s get assembled into packets. These packets are then sent across the cabling (or WiFi in a wireless network) to the receiving device. The receiving device disassembles the packets and sends them to the next level.
2. Data link layer
The data link network layer is responsible for routing data between devices on the same network. Packets received at this level are further subdivided into frames and then forwarded to the destination computer based on the MAC (media access control) address information stored in the packet. Each item that connects to the Internet has a predefined or assigned MAC address. Network hardware communicates by MAC address at the data link layer.
Error control also takes place at this level to detect any errors in transmission. Additionally, level 2 regulates flow control of data to not overwhelm the sender and receiver by sending too much data at once.
Network Interface Cards (NIC) and device drivers are standard technologies found at this later of the OSI.
3. Network layer
Similar to level 2, the network layer is responsible for routing data between two devices. However, the network layer transmits data between devices located on different networks. Whereas level 2 uses the MAC address to route the packets, level 3 uses the IP (Internet Protocol) address to route packets.
Routers and layer 3 switches operate at this level of the OSI model.
4. Transport layer
Packet delivery and error checking are the critical functions of the transport layer. At this level, the packets are subdivided into smaller sizes and sequenced together in the correct order. This level also handles flow control between the devices.
There is no physical device associated with the transport layer. Instead, it uses TCP, which is a protocol found in the operating system.
5. Session layer
The session layer is responsible for establishing a connection between devices, authenticating each device, and providing security during data transmission.
Protocols used at this network layer include PPTP, RPC, RTCP, and SOCKS.
6. Presentation layer
Level six of the OSI stack prepares data to be used by the application layer. Specifically, this level handles processes such as encryption, decryption, and decompression.
7. Application layer
Despite its name, user interface (UI) applications are not included at this level. Instead, this level provides protocols for presenting usable data to these UI applications (such as email or web browsers) to communicate.
HTTP, HTTPS, File Transfer Protocol (FTP), and Simple Mail Transfer Protocol (SMTP) are examples of protocols used at this level.
Why is the network stack and its layers important?
Network issues are a common occurrence. Sometimes the problem is minor. At other times, these problems can be complex. Having a place to start troubleshooting can help get to the bottom of things without wasting a lot of time. What better place to start than the OSI model?
Given that the OSI stack sets the standard for how devices communicate over a network, having a clear understanding of each level is critical to figuring out where to start.
Sometimes the first place to start with a network issue is the physical layer. Often physical components will fail and set off a string of undesirable events. Checking the cabling and hubs to ensure that everything is plugged in and working fine is a good first step. Routing issues are another common occurrence. Troubleshooting routing issues occur at the network level. At that level, checking each device’s IP address and the routing schemes is helpful.
The troubleshooting process would continue in this manner evaluating the devices and services at each stack level to locate the problem.
Overall, the OSI model is critical to ensuring seamless communication between all devices on a network. Not only that, it provides a solid framework to help locate problems when things go wrong.