A computer network connects multiple devices to share resources and communicate. Networking is fundamental to the internet, cloud computing, and modern digital infrastructure.
Network Types by Scale
| Type | Scale | Example |
| PAN | Personal Area Network (~10 m) | Bluetooth headset, smartwatch |
| LAN | Local Area Network (building/campus) | Office network, home Wi-Fi |
| MAN | Metropolitan Area Network (city) | City cable network |
| WAN | Wide Area Network (country/globe) | Internet, MPLS networks |
OSI Model — 7 Layers
| Layer | Name | Function | Protocols/Examples |
| 7 | Application | User interface; network services | HTTP, FTP, SMTP, DNS |
| 6 | Presentation | Data format, encryption, compression | SSL/TLS, JPEG, MPEG |
| 5 | Session | Session management; checkpointing | NetBIOS, RPC |
| 4 | Transport | End-to-end reliable delivery; ports | TCP, UDP |
| 3 | Network | Routing; logical addressing (IP) | IP, ICMP, OSPF, BGP |
| 2 | Data Link | MAC addressing; error detection; frames | Ethernet, Wi-Fi (802.11), PPP |
| 1 | Physical | Bit transmission over medium | Cables, hubs, repeaters |
Mnemonic: "Please Do Not Throw Sausage Pizza Away" (Physical, Data Link, Network, Transport, Session, Presentation, Application)
TCP vs UDP
| Feature | TCP | UDP |
| Connection | Connection-oriented (3-way handshake) | Connectionless |
| Reliability | Guaranteed delivery, ordering, error-checking | Best effort; no guarantee |
| Speed | Slower (overhead) | Faster |
| Use cases | HTTP, FTP, email, file transfer | Video streaming, DNS, VoIP, gaming |
IP Addressing
- IPv4: 32-bit address (4 octets); ~4.3 billion addresses; e.g. 192.168.1.1
- IPv6: 128-bit address; ~3.4×10³⁸ addresses; e.g. 2001:0db8::1
- Subnet mask: Distinguishes network and host portions; e.g. 255.255.255.0 = /24
- Private IP ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
- NAT: Network Address Translation — maps private IPs to public IP
- DHCP: Dynamic Host Configuration Protocol — auto-assigns IP addresses
- DNS: Domain Name System — translates domain names to IP addresses
Network Devices
| Device | OSI Layer | Function |
| Hub | Layer 1 | Broadcasts to all ports; no intelligence |
| Switch | Layer 2 | Forwards frames based on MAC address; creates collision domains |
| Router | Layer 3 | Routes packets between networks using IP addresses |
| Gateway | Layer 4–7 | Protocol translation between different networks |
| Firewall | Layer 3–7 | Filters traffic based on security rules |
| Access Point (AP) | Layer 2 | Wireless connection to LAN |
Wireless Standards
| Standard | Name | Max Speed | Frequency |
| 802.11b | Wi-Fi 1 | 11 Mbps | 2.4 GHz |
| 802.11g | Wi-Fi 3 | 54 Mbps | 2.4 GHz |
| 802.11n | Wi-Fi 4 | 600 Mbps | 2.4/5 GHz |
| 802.11ac | Wi-Fi 5 | 3.5 Gbps | 5 GHz |
| 802.11ax | Wi-Fi 6 | 9.6 Gbps | 2.4/5/6 GHz |
| Bluetooth 5.0 | PAN | 2 Mbps | 2.4 GHz |