Understanding the 7 Layers of Network Communication
CompTIA Network+ N10-009 Objective 1.1
The Open Systems Interconnection (OSI) model is a conceptual framework that describes how data travels across a network.
Created by the International Organization for Standardization (ISO) in 1984, it divides network communication into 7 distinct layers.
Think of the OSI model like sending a letter through the postal system. Each step (writing, envelope, address, sorting, delivery) is handled by a different department, but they all work together to deliver your message.
"All People Seem To Need Data Processing"
"Please Do Not Throw Sausage Pizza Away"
Choose the one that sticks with you best!
The Application layer is the interface between network services and the user. It's where humans interact with the network.
| Protocol | Port | Purpose |
|---|---|---|
| HTTP/HTTPS | 80/443 | Web browsing |
| FTP | 20/21 | File transfer |
| SMTP | 25 | Sending email |
| POP3/IMAP | 110/143 | Receiving email |
| DNS | 53 | Name resolution |
| SSH | 22 | Secure remote access |
| Telnet | 23 | Remote access (insecure) |
Layer 7 is like writing the letter - it's the actual content of your message, written in a language (protocol) that the recipient understands.
The Presentation layer is the "translator" of the network. It handles:
The Session layer manages conversations between applications. It:
Layer 5 is like a phone call manager. It dials the number (establish), keeps the line open while you talk (maintain), and hangs up when done (terminate). It also handles checkpoints - if a large file transfer fails at 50%, you can resume from there instead of starting over!
NetBIOS - Windows networking sessions | RPC - Remote Procedure Call | SQL Sessions - Database connections
The Transport layer provides end-to-end delivery of data. Think of it as the delivery guarantee service!
| TCP | UDP |
|---|---|
| Connection-oriented | Connectionless |
| Reliable delivery | Best-effort delivery |
| Error checking | No error recovery |
| Slower (overhead) | Faster (lightweight) |
| Web, Email, FTP | DNS, Streaming, VoIP |
At Layer 4, data is called a Segment. Each segment contains a header with source/destination port numbers (e.g., port 80 for HTTP, port 443 for HTTPS).
The Network layer handles logical addressing and routing - finding the best path for data to travel across networks.
At Layer 3, data is called a Packet. The packet header contains source and destination IP addresses - the logical addresses that allow data to travel across the Internet.
Protocols: IP (IPv4/IPv6), ICMP (ping), OSPF, EIGRP, BGP
The Data Link layer provides node-to-node delivery on the same network segment (LAN). It handles:
At Layer 2, data is called a Frame. Contains source and destination MAC addresses - the 48-bit physical addresses burned into network cards (e.g., 00:1A:2B:3C:4D:5E).
The Physical layer deals with the actual transmission of raw bits over a physical medium. It's all about:
At Layer 1, data is just Bits - 1s and 0s represented as electrical voltages, light pulses, or radio frequencies. Layer 1 doesn't understand addresses, protocols, or data - just raw binary!
Standards: Ethernet (IEEE 802.3), WiFi (IEEE 802.11), RS-232, DSL, SONET
When you send data, each layer adds its own header (and sometimes trailer) to the data. This process is called encapsulation.
Layer 4 adds TCP/UDP header
Layer 3 adds IP header
Layer 2 adds MAC header & trailer
Layer 1 converts to bits
Encapsulation is like preparing a package:
Write the letter (Application data) -- Put it in an envelope, add recipient name (Transport - port numbers)
Add street address (Network - IP addresses) -- Put in mailbox for local carrier (Data Link - MAC addresses)
Carrier physically delivers it (Physical - the actual transport)
When data arrives at its destination, each layer removes its header (and trailer) before passing data up. This is de-encapsulation.
Layer 1 receives bits, passes to Layer 2
Layer 2 checks MAC, removes header/trailer
Layer 3 checks IP, removes header
Layer 4 checks port, removes header
Each layer has a specific name for the data unit it handles:
Different network devices operate at different layers of the OSI model:
Higher-layer devices can understand all layers below them. A router (L3) can read MAC addresses (L2) and bits (L1), but a hub (L1) has no concept of IP or MAC addresses!
The TCP/IP model is the practical implementation used on the Internet. It has only 4 layers:
The TCP/IP model is also called the DOD Model because it was developed by the U.S. Department of Defense for ARPANET (the Internet's predecessor).
| TCP/IP | DOD Name | OSI Equiv. |
|---|---|---|
| Application | Process/Application | L5-L7 |
| Transport | Host-to-Host | L4 |
| Internet | Internet | L3 |
| Network Access | Network Interface | L1-L2 |
The OSI model is incredibly useful for systematic troubleshooting. Start at Layer 1 and work up!
When someone says "the network is down," don't panic! Start at Layer 1: "Is the cable plugged in?" You'd be surprised how often that's the answer!
Each layer on the sending device communicates with the same layer on the receiving device. This is called peer-to-peer communication.
Sender
Receiver
Layer 3 on your computer "talks" to Layer 3 on the destination. The conversation appears horizontal (peer-to-peer), even though data physically travels down and then up the stack!
Let's trace what happens when you type www.google.com in your browser:
Q: What is the PDU at Layer 2?
A: Frame
Q: Which layer uses IP addresses?
A: Layer 3 (Network)
Q: At which layer does a switch operate?
A: Layer 2 (Data Link)
Q: What happens during encapsulation?
A: Headers are added as data moves down the layers
Q: How does TCP/IP model differ from OSI?
A: TCP/IP has 4 layers; combines OSI L5-7 into Application and L1-2 into Network Access
Q: Which layer handles error recovery?
A: Layer 4 (Transport) - TCP provides reliable delivery
Q: What addresses are used at Layer 2?
A: MAC addresses (48-bit physical addresses)