TCP/IP Fundamentals & the OSI Model
Key Takeaways
- The OSI model has 7 layers (Physical, Data Link, Network, Transport, Session, Presentation, Application) and is used as a conceptual framework for troubleshooting network issues.
- TCP is connection-oriented and guarantees delivery through three-way handshakes and acknowledgments; UDP is connectionless and faster but does not guarantee delivery.
- IPv4 addresses are 32-bit (4 octets, e.g., 192.168.1.1) while IPv6 addresses are 128-bit (8 hexadecimal groups, e.g., 2001:0db8::1).
- Private IP address ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are not routable on the internet and require NAT to access external resources.
- APIPA (Automatic Private IP Addressing) assigns a 169.254.x.x address when a device cannot reach a DHCP server — this indicates a network configuration problem.
TCP/IP Fundamentals & the OSI Model
The OSI Model
The OSI (Open Systems Interconnection) model is a seven-layer conceptual framework that standardizes how network communication occurs. While real networks use the TCP/IP model (4 layers), the OSI model is essential for troubleshooting because it helps isolate which layer a problem exists at.
| Layer | Name | Function | Protocols/Devices | Data Unit |
|---|---|---|---|---|
| 7 | Application | User-facing network services | HTTP, FTP, SMTP, DNS, DHCP | Data |
| 6 | Presentation | Data formatting, encryption, compression | SSL/TLS, JPEG, ASCII, MPEG | Data |
| 5 | Session | Manages sessions between applications | NetBIOS, RPC, SMB | Data |
| 4 | Transport | End-to-end delivery, flow control | TCP, UDP | Segments (TCP) / Datagrams (UDP) |
| 3 | Network | Logical addressing and routing | IP, ICMP, ARP | Packets |
| 2 | Data Link | Physical addressing, error detection | Ethernet, Wi-Fi (802.11), MAC addresses | Frames |
| 1 | Physical | Electrical/optical signals over media | Cables, hubs, repeaters | Bits |
Memory Aid: "Please Do Not Throw Sausage Pizza Away" (Layers 1–7) or "All People Seem To Need Data Processing" (Layers 7–1).
Troubleshooting with the OSI Model
When troubleshooting network issues, start at Layer 1 (Physical) and work up:
- Layer 1 (Physical): Is the cable plugged in? Is the NIC light on? Is Wi-Fi enabled?
- Layer 2 (Data Link): Can you reach the local switch? Are MAC addresses resolving?
- Layer 3 (Network): Do you have an IP address? Can you ping the gateway?
- Layer 4 (Transport): Can you connect to specific ports? Is the firewall blocking TCP/UDP?
- Layers 5-7 (Upper): Is DNS resolving? Can you reach the application/website?
TCP vs. UDP
| Feature | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) |
|---|---|---|
| Connection | Connection-oriented (three-way handshake) | Connectionless |
| Reliability | Guaranteed delivery with acknowledgments | No guarantee — "best effort" |
| Ordering | Packets arrive in order | Packets may arrive out of order |
| Error Checking | Yes (checksums + retransmission) | Minimal (checksum only) |
| Speed | Slower (overhead from handshake/ACKs) | Faster (no overhead) |
| Use Cases | Web (HTTP/HTTPS), email (SMTP), file transfer (FTP) | Streaming, VoIP, DNS queries, gaming |
| Header Size | 20 bytes minimum | 8 bytes |
TCP Three-Way Handshake
- SYN — Client sends synchronization request to server
- SYN-ACK — Server acknowledges and sends its own synchronization
- ACK — Client acknowledges server's response → connection established
IPv4 Addressing
An IPv4 address is a 32-bit number written as four octets in dotted decimal notation (e.g., 192.168.1.100).
IP Address Classes
| Class | First Octet Range | Default Subnet Mask | Network/Host | Purpose |
|---|---|---|---|---|
| A | 1–126 | 255.0.0.0 (/8) | 8 network, 24 host bits | Large organizations |
| B | 128–191 | 255.255.0.0 (/16) | 16 network, 16 host bits | Medium organizations |
| C | 192–223 | 255.255.255.0 (/24) | 24 network, 8 host bits | Small organizations |
| D | 224–239 | N/A | N/A | Multicast |
| E | 240–255 | N/A | N/A | Experimental/Reserved |
Note: 127.0.0.0/8 is reserved for loopback (localhost). 127.0.0.1 is the most common loopback address.
Private IP Address Ranges (RFC 1918)
These addresses are not routable on the public internet and require NAT (Network Address Translation) to access internet resources:
| Class | Private Range | CIDR | Addresses Available |
|---|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | ~16.7 million |
| B | 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | ~1 million |
| C | 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | ~65,000 |
Special IPv4 Addresses
| Address | Purpose |
|---|---|
| 127.0.0.1 | Loopback (localhost) — tests local TCP/IP stack |
| 169.254.x.x | APIPA — assigned when DHCP is unavailable |
| 0.0.0.0 | Default route / "any address" |
| 255.255.255.255 | Broadcast to all devices on local network |
IPv6 Addressing
IPv6 uses 128-bit addresses to solve IPv4 address exhaustion:
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Size | 32 bits | 128 bits |
| Notation | Dotted decimal (192.168.1.1) | Hexadecimal colon (2001:0db8::1) |
| Total Addresses | ~4.3 billion | ~3.4 × 10³⁸ |
| Header | Variable length | Fixed 40-byte header |
| IPsec | Optional | Built-in |
| Broadcast | Supported | Replaced by multicast/anycast |
IPv6 Address Types
| Type | Prefix | Description |
|---|---|---|
| Global Unicast | 2000::/3 | Publicly routable (like public IPv4) |
| Link-Local | fe80::/10 | Auto-configured, local network only (like APIPA) |
| Unique Local | fc00::/7 | Private networks (like RFC 1918 IPv4) |
| Loopback | ::1 | Equivalent to 127.0.0.1 |
| Multicast | ff00::/8 | One-to-many communication |
IPv6 Shortening Rules
- Remove leading zeros in each group: 2001:0db8:0000:0042 → 2001:db8:0:42
- Replace consecutive groups of zeros with :: (once per address): 2001:db8:0:0:0:0:0:1 → 2001:db8::1
At which OSI layer do routers primarily operate?
Which transport protocol would be BEST for real-time video streaming?
A computer has been assigned the IP address 169.254.45.201. What does this indicate?
Which of the following are valid private (RFC 1918) IPv4 address ranges? (Select THREE)
Select all that apply