Learn OSI layers, IP addressing, routing protocols, and subnetting — explained with everyday analogies, no jargon overload.
| Hub (Old) | Switch (Modern) | |
|---|---|---|
| Collisions | Yes | No |
| CSMA/CD | Needed | Not needed |
| Mode | Half-duplex | Full-duplex |
| Bandwidth | Shared | Dedicated |
The OSI model is a theoretical reference used to understand networking. TCP/IP is the real-world implementation the internet actually uses. TCP/IP collapses OSI's 7 layers into 4 practical ones:
| TCP/IP Layer | OSI Equivalent | What it does (simply) | Example protocols |
|---|---|---|---|
| Application | L7 + L6 + L5 | Everything the user/app needs | HTTP, DNS, SMTP, SSH |
| Transport | L4 | Gets data to the right app (ports) | TCP, UDP |
| Internet | L3 | Routes packets across networks | IPv4, IPv6, ICMP |
| Network Access | L2 + L1 | Physically sends bits on the wire | Ethernet, Wi-Fi |
An IPv4 address is 32 bits long, written as 4 numbers (called octets) separated by dots. Each number ranges from 0 to 255.
Example: 192.168.1.100 — this is made of 4 octets: 192 · 168 · 1 · 100
| Class | Range (1st number) | Default mask | Max hosts | Used for |
|---|---|---|---|---|
| Class A | 1 – 126 | /8 → 255.0.0.0 | ~16 million | Big companies (IBM got 9.x.x.x) |
| Class B | 128 – 191 | /16 → 255.255.0.0 | ~65,000 | Universities, medium orgs |
| Class C | 192 – 223 | /24 → 255.255.255.0 | 254 | Small offices, home networks |
| Class D | 224 – 239 | N/A | N/A | Multicast (video streaming, routing) |
| Class E | 240 – 255 | N/A | N/A | Reserved for future / research |
These are "home addresses" — free to use inside your network, but not routable on the internet. Your home router's NAT translates them to a public IP.
IPv4 is running out of addresses (~4 billion total). IPv6 has 128-bit addresses — enough for every grain of sand on Earth to have trillions of IPs.
The subnet mask tells you which part of an IP address is the network and which part is the host.
| Part | Meaning | Value |
|---|---|---|
| 192.168.1 | Network (fixed — identifies your subnet) | Network bits |
| .100 | Host (your specific device) | Host bits |
| /26 | 26 bits are network, 6 bits are host | 6 host bits → 2⁶ − 2 = 62 usable IPs |
| Mask | 255.255.255.192 | 11111111.11111111.11111111.11000000 |
| CIDR | Mask | Subnets (from /24) | Usable Hosts | Good for... |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 1 | 254 | Full office floor |
| /25 | 255.255.255.128 | 2 | 126 | Two departments |
| /26 | 255.255.255.192 | 4 | 62 | Medium team |
| /27 | 255.255.255.224 | 8 | 30 | Small team |
| /28 | 255.255.255.240 | 16 | 14 | Very small group |
| /29 | 255.255.255.248 | 32 | 6 | Server cluster |
| /30 | 255.255.255.252 | 64 | 2 | Router-to-router link |
You manually tell the router: "To reach network X, go via Y." Simple, predictable, but doesn't adapt to failures.
Routers talk to each other and automatically figure out the best paths. If a link fails, they re-route automatically.