Chapters List
- A Mental Model for Networking
- How Data Travels Across the Internet
- Why Networking Uses Layers
- The OSI Model
- The TCP/IP Model
- IP Addresses
- Understanding DNS (Domain Name System)
- TCP vs UDP: Reliable vs Fast Communication
- Ports and Sockets: Connecting Network Traffic to Applications
- How the Web Works (HTTP/HTTPS)
- Routers and NAT: Connecting Local Networks to the Internet
- Modern Networking Systems
computer networking
The OSI Model
Learn about the OSI model, a conceptual framework that divides networking into seven layers to make communication systems easier to understand and design.
In the previous chapter we learned that networking systems are organized into layers to manage complexity.
Each layer handles a specific part of the communication process and works together with the layers above and below it.
To help engineers understand and design these systems, several models have been developed that describe how networking layers interact.
One of the most well-known of these is the OSI Model.
What Is the OSI Model?
The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe how data moves across a network.
It divides networking communication into seven layers, each responsible for a specific function.
These layers range from physical hardware communication at the lowest level to application-level communication at the highest level.
graph TD
A[Application]
B[Presentation]
C[Session]
D[Transport]
E[Network]
F[Data Link]
G[Physical]
A --> B --> C --> D --> E --> F --> G
Each layer communicates with the layer directly above and below it.
When data is sent across a network, it travels down through the layers on the sending device, then up through the layers on the receiving device.
Why the OSI Model Exists
The OSI model helps engineers and developers by providing a structured way to understand networking systems.
Instead of thinking about networking as one massive system, the model breaks it into manageable parts.
This makes it easier to:
- design networking technologies
- troubleshoot network problems
- explain how communication works
- develop protocols that operate at specific layers
Even though the OSI model is primarily a teaching and reference model, its layered approach is widely used when discussing networking.
The Seven Layers of the OSI Model
Let’s briefly explore what each layer is responsible for.
Layer 1 — Physical Layer
The physical layer is responsible for transmitting raw signals between devices.
This includes:
- electrical signals
- fiber optic light signals
- radio signals for wireless communication
Examples of technologies at this layer include:
- Ethernet cables
- fiber optic cables
- WiFi radio transmission
This layer deals with hardware-level communication.
Layer 2 — Data Link Layer
The data link layer manages communication between devices on the same local network.
Its responsibilities include:
- organizing bits into frames
- detecting transmission errors
- controlling access to the network medium
Devices such as network switches operate primarily at this layer.
Each network interface also has a unique identifier called a MAC address, which is used for communication within a local network.
Layer 3 — Network Layer
The network layer handles addressing and routing between different networks.
Its main responsibilities include:
- assigning logical addresses
- determining where packets should be sent
- routing packets across multiple networks
The most important protocol at this layer is the Internet Protocol (IP).
Routers operate primarily at this layer, forwarding packets toward their destination.
Layer 4 — Transport Layer
The transport layer manages communication between applications on different computers.
It ensures that data is delivered correctly and in the proper order.
Responsibilities include:
- splitting data into segments
- ensuring reliable delivery
- managing retransmissions if data is lost
- controlling data flow between systems
Two common transport protocols are:
- TCP (Transmission Control Protocol) – reliable communication
- UDP (User Datagram Protocol) – faster but less reliable communication
Layer 5 — Session Layer
The session layer manages communication sessions between applications.
This layer is responsible for:
- establishing communication sessions
- maintaining sessions
- closing sessions when communication ends
In practice, many of these responsibilities are often handled by protocols in other layers, especially in modern networking systems.
Layer 6 — Presentation Layer
The presentation layer focuses on how data is formatted and represented.
Its responsibilities include:
- translating data formats
- encrypting and decrypting information
- compressing data
For example, this layer ensures that data sent from one system can be understood by another system, even if their internal representations differ.
Layer 7 — Application Layer
The application layer is the layer closest to the user.
It provides networking services that applications use to communicate across networks.
Examples include:
- web browsing
- email communication
- file transfers
Common protocols at this layer include:
- HTTP for websites
- SMTP for email
- FTP for file transfers
- DNS for domain name resolution
This layer allows software applications to interact with the network.
Data Moving Through the OSI Layers
When an application sends data across a network, the data moves down through the layers on the sending computer.
Each layer adds its own information before passing the data to the next layer.
graph TD
A[Application Data]
B[Transport Segment]
C[Network Packet]
D[Data Link Frame]
E[Physical Signals]
A --> B --> C --> D --> E
Once the data reaches the destination device, the process happens in reverse.
Each layer removes the information added by its counterpart until the original data reaches the receiving application.
The OSI Model vs Real-World Networking
While the OSI model is useful for understanding networking concepts, real-world internet communication is usually described using a different framework called the TCP/IP model.
The TCP/IP model groups some OSI layers together and more closely reflects how the internet actually operates.
However, the OSI model remains extremely useful because it clearly explains the different responsibilities involved in network communication.
Key Ideas to Remember
The OSI model helps explain how complex networking systems are organized.
Important ideas from this chapter include:
- The OSI model divides networking into seven layers.
- Each layer handles a specific responsibility.
- Data moves down the layers when being sent and up the layers when received.
- The model helps engineers understand, design, and troubleshoot networking systems.
Understanding the OSI model makes it easier to learn how real-world networking technologies operate.
What Comes Next
Now that we understand the conceptual layers of networking, we can explore the model that powers the modern internet.
In the next chapter we will examine the TCP/IP Model, which describes how networking actually works on today’s internet.