ποΈ The OSI Model
π€ What is the OSI Model?
The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes the functions of a network into seven logical layers. Itβs not a protocol itself, but a model used to understand and design network architectures, helping to visualize how data moves from an application on one computer to an application on another. Itβs invaluable for troubleshooting network problems by isolating issues to a specific layer.
Analogy: Think of it like sending a package internationally. Each layer has a specific job (writing the letter, putting it in an envelope, adding postage, local delivery, air freight, customs, destination delivery), and they must all work in order.
β The Seven Layers of the OSI Model
Here are the seven layers, explained from the top down (from the userβs perspective).
Layer 7: The Application Layer
This is the layer closest to the end-user. It provides network services directly to software applications.
- Main Responsibility: User-facing services and network-aware applications.
- Protocols: HTTP/HTTPS (web Browse), FTP (file transfer), SMTP (email), DNS.
- Data Unit: Data
Layer 6: The Presentation Layer
This layer acts as a translator for the network, ensuring data is in a usable format for the application layer.
- Main Responsibility: Data translation, encryption, and compression.
- Examples: SSL/TLS for encryption, data formatting like ASCII, JPEG, PNG.
- Data Unit: Data
Layer 5: The Session Layer
This layer is responsible for opening, managing, and closing the communication sessions between two devices.
- Main Responsibility: Dialogue control, session management, and synchronization.
- Examples: APIs that establish and terminate connections, NetBIOS.
- Data Unit: Data
Layer 4: The Transport Layer
This layer provides end-to-end communication services, breaking data into smaller chunks and ensuring it arrives correctly.
- Main Responsibility: Segmentation, flow control, and error checking.
- Protocols: TCP (Transmission Control Protocol), a reliable, a connection-oriented protocol; and UDP (User Datagram Protocol), a fast, connectionless protocol.
- Data Unit: Segment (TCP), Datagram (UDP)
Layer 3: The Network Layer
This layer is responsible for moving data packets across different networks.
- Main Responsibility: Logical addressing (IP addresses), path determination, and routing.
- Devices: Routers operate at this layer.
- Protocols: IP (Internet Protocol - IPv4/IPv6), ICMP.
- Data Unit: Packet
Layer 2: The Data Link Layer
This layer manages how data is moved across a single physical link in a local network.
- Main Responsibility: Physical addressing (MAC addresses), error detection, and framing.
- Devices: Switches and bridges operate at this layer.
- Protocols: Ethernet, Wi-Fi.
- Data Unit: Frame
Layer 1: The Physical Layer
This layer comprises the physical hardware that transmits raw bits over the network medium.
- Main Responsibility: Transmitting bits over a physical medium. Defines cables, connectors, voltages.
- Devices: Hubs, repeaters, cables, and network interface cards (NICs).
- Data Unit: Bits
π¦ How Data Moves (Encapsulation)
As data moves down from Layer 7 to Layer 1 on the sending device, each layer adds its own header (and sometimes a trailer). This process is called encapsulation. The receiving device reverses the process (decapsulation), removing headers as the data moves up the layers.
β¨ Remembering the Layers
A popular mnemonic to remember the layers from top (7) to bottom (1) is: All People Seem To Need Data Processing.