What Is The OSI Model? [All 7 Layers Explained]

published
June 19, 2024
TABLE OF CONTENTS

The OSI (Open Systems Interconnection) model describes the different layers that computers use to communicate over a network. Split into 7 layers that have unique functions, the OSI model is like a blueprint that helps us understand how different network protocols interact and communicate.

Integrating the 7 OSI layers in a corporate network ensures seamless, efficient, and secure communication. Together, they build a robust network infrastructure.

Physical layer (1)

  • This is the foundation of the OSI model that deals with the hardware that transmits raw data bits over a physical medium. It encompasses cables, switches, and all the other physical devices that connect everything together. 

When you plug an Ethernet cable into your computer, you are interacting with the Physical Layer. This layer is not concerned with the meaning of the data being sent—it just moves the bits from one place to another. 

Switches and hubs play a crucial role in the physical layer. These devices establish the pathways that the data travels through. When you connect multiple computers in an office using a switch, you are essentially creating a network of pathways for data to flow.

Wireless communication is another key part of the physical layer. When you connect to Wi-Fi, your device uses radio waves to transmit data to and from a router. Just like with cables, the physical layer does not seek to establish what the data means. It simply uses the radio frequencies to get the bits to their next destination.

Data link layer (2)

The data layer is where raw bitstreams are transformed into frames, and where error detection happens. It is the layer that ensures messages are error-free, controlling who can access the network and when. The layer is essential for local delivery of frames within the same LAN.

One of the crucial tasks of the data link layer is encapsulation - taking data packets and wrapping them with a frame header and trailer. These frames help in error detection and in managing how data traverses the network. When a frame is corrupted, its checksum doesn’t match, and the frame is either discarded or corrected.

In corporate networks, you’ll typically find switches operating at this layer. They help ensure that data reaches the right destination within a network by using MAC addresses. 

Speaking of MAC addresses, the Media Access Control (MAC) sublayer controls how devices on the network gain access to the data and permission to transmit it.

Frame collisions, which happen when two devices try to send data simultaneously can be an issue, especially in busy networks. The data link Layer handles these collisions efficiently. Layer 2 protocols like Ethernet have mechanisms to detect and recover from these collisions, and some even work to prevent them.

VLANs  (Virtual Local Area Networks) are also set up at the data link layer, where they segment network traffic. This helps in managing large networks by creating smaller, more manageable broadcast domains. It’s like having multiple smaller networks within a larger physical network.

Examples of protocols at the data layer include Ethernet—probably the most common one you’ll encounter. It’s used for LANs and is key to almost every network setup. Others include PPP (Point-to-Point Protocol) for direct connections between two nodes, and HDLC (High-Level Data Link Control) which also helps in point-to-point communication. In the wireless domain, IEEE 802.11 protocols fit here, defining how data should be transmitted over the air.

You might have heard of ARP (Address Resolution Protocol). This protocol works to map IP addresses to MAC addresses, ensuring that data packets reach the right devices. ADCCP (Advanced Data Communication Control Procedures) and Frame Relay also play roles in data-link communications.

LAN switching is a big function here, particularly with the use of switches that forward data based on MAC addresses. This is where VLANs and Quality of Service (QoS) come into play, optimizing network performance and managing traffic efficiently.

Switches, bridges, and some types of routers are the primary hardware you'll find at this layer. They work tirelessly to ensure data gets where it needs to go and that the network runs smoothly.

Network layer (3)

The network layer in the OSI model is where packet forwarding and routing happens. It ensures that data packets move from the source host to the destination host, navigating through the interconnected networks along the way.

One of the key functions here is connectionless communication. For example, Internet Protocol (IP) uses a connectionless approach. This means data packets can travel from the sender to the receiver without needing an acknowledgment from the recipient.

Addressing is crucial at this layer too. Each host must have a unique address, much like how every house on a street has a unique postal address. On the Internet, these addresses are known as IP addresses. These addresses uniquely identify a devices on the network.

Then there's message forwarding. In many networks, you'll find subnetworks and gateways, or routers, which act like traffic cops. They direct data packets between different networks, ensuring they find their way to the right place. Without routers playing this role, your data wouldn't know how to navigate the complex web of interconnected networks.

Another key responsibility of the network layer is fragmentation and reassembly, especially for IPv4 packets. When a data packet is larger than the smallest Maximum Transmission Unit (MTU) on its path, routers chop it into smaller pieces. The receiving host then reassembles these fragments, much like piecing together a puzzle.

However, IPv6 handles things a bit differently. Instead of fragmenting packets during transit, it requires the Path MTU discovery technique to figure out the smallest MTU along the path. This prevents packets from being too large to handle without having to chop them up mid-journey.

At the network layer, several protocols come into play. Internet Protocol (IP), both IPv4 and IPv6, is the most prominent. Others include the Internet Control Message Protocol (ICMP) for sending error messages and operational information, and the Internet Group Management Protocol (IGMP) for managing multicast group memberships.

Transport Layer (4)

Layer 4 in the OSI model ensures that data gets from one place to another accurately and reliably. This layer takes the heavy lifting off your hands when it comes to data transfer.

Think of the transport layer as the courier service for your data. It uses protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) to do this.

TCP is like a meticulous planner. It sets up a connection before data gets sent, ensures that all packets arrive safely, and reassembles them in the correct order. This makes it perfect for tasks where accuracy matters, like browsing the web or sending emails. 

On the other hand, we have UDP, which is more of a spontaneous type. It doesn’t bother with all that connection setup and checking. This makes it faster but less reliable. It’s perfect for applications where speed is more important than accuracy, like streaming video. Even if a few packets get lost along the way, you might not even notice.

This layer also handles port numbers, which are like doors leading to specific applications on a device. When you browse a website, your browser might go through port 80 or 443. When you send an email, it might use port 25. Think of these ports as specific lanes on a highway, directing traffic to the right destination.

Session Layer (5)

The session layer manages sessions between applications on either end of a network. It establishes, manages, and terminates connections between applications. If your session remains inactive for too long, the session layer will automatically terminate it, asking you to log back in. This is a crucial security feature.

Imagine you're downloading a hefty report from the company server. If the transfer gets interrupted—say your internet connection blips—the session layer can help resume this transfer from where it left off, rather than starting over. This process is often managed by protocols like SIP (Session Initiation Protocol) or PPTP (Point-to-Point Tunneling Protocol).

In video conferencing applications like Zoom or Microsoft Teams, the session layer plays a significant role. It establishes the session, manages real-time data exchange, and ensures that both ends can maintain this interactive flow of information. If you switch from a voice call to a video call, the session layer negotiates this new parameter without dropping the call.

When thinking about database queries, the session layer ensures that each query is part of a separate session. This makes it possible to maintain state and context between the client and server. For instance, if you're running complex analytics on your corporate databases, maintaining the session helps in tracking and processing your requests efficiently.

Presentation layer (6)

The presentation layer of the OSI model is often called the "translator" for the network because it ensures that the data being sent from the application layer of one system can be read and understood by the application layer of another system, even if they use different encoding schemes.

For example, if we have a system using ASCII and another using EBCDIC, the presentation layer translates these encodings so that both systems can understand the data. This is essential in corporate networks where different systems and applications, all potentially using different data formats, need to communicate seamlessly.

Another critical function is data encryption and decryption. Let's say we're sending sensitive financial data between branches of a company. Encrypting this data secures it during transmission over potentially insecure networks. When it reaches the destination, the presentation layer decrypts it back into its original form. SSL/TLS protocols operate at this layer, ensuring that your web transactions are secure.

Data compression is also managed in this layer. In a corporate setting, bandwidth is often at a premium. Compressing files before transmission makes the process quicker and more efficient. For instance, when sending large reports or multimedia files, the presentation layer can compress this data, helping to save both time and network resources.

Character code translation is another cool feature of the presentation layer. If you've ever worked with different computer systems, you might have encountered issues where special characters aren’t displaying correctly. The presentation layer can handle these differences in character encoding, ensuring that text appears as it should, regardless of the platform.

Application Layer (7)

The application layer interacts directly with our applications and the user. It’s the interface between the network and the applications we use every day. For example, when we're browsing the internet using a web browser, the application layer is handling that connection. HTTP and HTTPS, the protocols used to fetch and display web pages, operate at this layer.

Email is another great example. When we send an email using SMTP or read one using IMAP or POP3, it’s all happening at the application layer. This layer doesn't worry about the details of how the data gets to its destination. Instead, it focuses on providing network services to applications and ensuring communication happens smoothly from the app we’re using to the receiving end.

File transfer protocols like FTP also function here. If you've ever used an FTP client to upload files to a server, you've been working with Layer 7. The application layer takes care of the specifics involved in transferring files over the network. 

Even when we're chatting over messaging apps or making VoIP calls, it's the application layer that's managing the connection and the data exchange. It’s the layer that ensures all these different applications can communicate over the network, no matter the underlying technology.

More posts

GET STARTED

A WireGuard® VPN that connects machines securely, wherever they are.
Star us on GitHub
By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.