Ch11.10.1: Network Basics
The OSI Model (Open Systems Interconnection)
The OSI model is a conceptual framework that standardizes the functions of a communication system into seven abstraction layers:
| Layer | Name | Description | Examples |
|---|---|---|---|
| 7 | Application | High-level protocols for user applications | HTTP, FTP, SMTP, DNS, SSH |
| 6 | Presentation | Data representation, encryption, compression | SSL/TLS, JPEG, MPEG |
| 5 | Session | Managing sessions between applications | NetBIOS, RPC |
| 4 | Transport | Reliable data transfer between hosts | TCP, UDP |
| 3 | Network | Routing and forwarding of packets | IP, ICMP, ARP |
| 2 | Data Link | Node-to-node data transfer | Ethernet, Wi-Fi, PPP |
| 1 | Physical | Physical transmission of raw bits | Ethernet cables, fiber optics, radio waves |
In practice, the TCP/IP model (a simpler 4-layer model) is more commonly used:
- Application Layer (combines OSI layers 5–7): HTTP, FTP, DNS, SMTP
- Transport Layer: TCP, UDP
- Internet Layer: IP, ICMP
- Network Access Layer (combines OSI layers 1–2): Ethernet, Wi-Fi
IP Addresses: IPv4 and IPv6
An IP address uniquely identifies a device on a network. There are two versions:
IPv4
- 32-bit address, written as four decimal numbers separated by dots
- Example:
192.168.1.1,8.8.8.8 - Address space: ~4.3 billion addresses (232)
- Running out of addresses due to Internet growth
- Special ranges:
127.0.0.1— localhost (loopback)10.0.0.0/8,172.16.0.0/12,192.168.0.0/16— private networks0.0.0.0— any address255.255.255.255— broadcast
IPv6
- 128-bit address, written as eight groups of four hexadecimal digits separated by colons
- Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334 - Can omit leading zeros and consecutive zero groups:
2001:db8:85a3::8a2e:370:7334 - Address space: ~3.4×1038 addresses (enough for every atom on Earth)
- Special addresses:
::1— localhost (loopback)::— any addressfe80::/10— link-local addresses
Common Ports
A port is a 16-bit number (0–65535) that identifies a specific service on a host. Well-known ports (0–1023) are assigned by IANA:
| Port | Protocol | Service |
|---|---|---|
| 20–21 | TCP | FTP (File Transfer Protocol) |
| 22 | TCP | SSH (Secure Shell) |
| 23 | TCP | Telnet (unencrypted, avoid) |
| 25 | TCP | SMTP (Simple Mail Transfer Protocol) |
| 53 | TCP/UDP | DNS (Domain Name System) |
| 67–68 | UDP | DHCP (Dynamic Host Configuration Protocol) |
| 80 | TCP | HTTP (Hypertext Transfer Protocol) |
| 110 | TCP | POP3 (Post Office Protocol v3) |
| 143 | TCP | IMAP (Internet Message Access Protocol) |
| 443 | TCP | HTTPS (HTTP Secure) |
| 465 | TCP | SMTPS (SMTP over SSL) |
| 587 | TCP | SMTP (submission, with STARTTLS) |
| 993 | TCP | IMAPS (IMAP over SSL) |
| 995 | TCP | POP3S (POP3 over SSL) |
| 3306 | TCP | MySQL |
| 3389 | TCP | RDP (Remote Desktop Protocol) |
| 5432 | TCP | PostgreSQL |
| 5900 | TCP | VNC (Virtual Network Computing) |
| 6379 | TCP | Redis |
| 8080 | TCP | HTTP alternate (often used for proxies) |
| 8443 | TCP | HTTPS alternate |
| 27017 | TCP | MongoDB |
Note: Ports 0–1023 are well-known ports (require root/admin to bind). Ports 1024–49151 are registered ports. Ports 49152–65535 are dynamic/ephemeral ports (used for client-side connections).