Reza Farashahi — NZSE
| Class | Network Bits | Host Bits | Address Range |
|---|---|---|---|
| A | 8 | 24 | 1.0.0.0 – 126.255.255.255 |
| B | 16 | 16 | 128.0.0.0 – 191.255.255.255 |
| C | 24 | 8 | 192.0.0.0 – 223.255.255.255 |
Every IPv4 address has 32 bits, divided into a network portion and a host portion:
Class A:
Class B:
Class C:
| Class | Leading Bits | Net Bits | Host Bits | # Networks | Hosts/Network | Default Mask |
|---|---|---|---|---|---|---|
| A | 0 (1–126) | 8 | 24 | 128 (27) | 16,777,216 (224) | 255.0.0.0 |
| B | 10 (128–191) | 16 | 16 | 16,384 (214) | 65,536 (216) | 255.255.0.0 |
| C | 110 (192–223) | 24 | 8 | 2,097,152 (221) | 256 (28) | 255.255.255.0 |
| D | 1110 (224–239) | Multicast — not used for host addressing | ||||
| E | 1111 (240–255) | Reserved / Experimental | ||||
| Class | Default Subnet Mask | Binary |
|---|---|---|
| A | 255.0.0.0 | 11111111.00000000.00000000.00000000 |
| B | 255.255.0.0 | 11111111.11111111.00000000.00000000 |
| C | 255.255.255.0 | 11111111.11111111.11111111.00000000 |
1. IP: 9.10.40.15 / Mask: 255.0.0.0
2. IP: 135.240.110.100 / Mask: 255.255.0.0
3. IP: 196.200.10.5 / Mask: 255.255.255.0
| CIDR | Binary Mask | Decimal Mask |
|---|---|---|
| /8 | 11111111.00000000.00000000.00000000 | 255.0.0.0 |
| /16 | 11111111.11111111.00000000.00000000 | 255.255.0.0 |
| /24 | 11111111.11111111.11111111.00000000 | 255.255.255.0 |
| /25 | 11111111.11111111.11111111.10000000 | 255.255.255.128 |
192.168.1.0/24 = mask 255.255.255.010.1.0.0/16 = mask 255.255.0.0196.10.10.0/25 = mask 255.255.255.128Q1: How many unique combinations can you make with 2 bits?
Hint: Think about all the possible values — 00, 01, 10, 11…
Q2: How many unique combinations can you make with 3 bits?
Hint: Each extra bit doubles the possibilities.
| Power | Value | Power | Value |
|---|---|---|---|
| 21 | 2 | 27 | 128 |
| 22 | 4 | 28 | 256 |
| 23 | 8 | 29 | 512 |
| 24 | 16 | 210 | 1,024 |
| 25 | 32 | 211 | 2,048 |
| 26 | 64 | 212 | 4,096 |
| Class | Host Bits (h) | Formula | Usable Hosts |
|---|---|---|---|
| A | 24 | 224 − 2 | 16,777,214 |
| B | 16 | 216 − 2 | 65,534 |
| C | 8 | 28 − 2 | 254 |
| Class | IP Address Range | CIDR | Addresses/Network |
|---|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| B | 172.16.0.0 – 172.31.255.255 | 172.16-31.0.0/16 | 65,534 |
| C | 192.168.0.0 – 192.168.255.255 | 192.168.0-255.0/24 | 254 |
🏠 Private Network
Router Internal: 192.168.100.1
☁️ Public Internet
Router External: 140.100.100.150 (Public IP)
ping 127.0.0.1ping localhostping loopbackQ1: What is the default subnet mask for a Class B network?
Q2: Which IP address range is private Class A?
Q3: What does /24 in CIDR notation mean?
🏢 Analogy — The Office Building
Imagine a large open-plan office with 1,000 employees all in one room. Every time someone talks, everyone hears it — chaos! Now divide the building into floors and departments: HR on floor 1, Engineering on floor 2, Sales on floor 3. Each floor has its own reception desk (router), its own internal phone system (subnet), and only inter-floor calls go through the main switchboard. That's subnetting — smaller groups, less noise, better security, and easier management.
FLSM: Every subnet gets the same number of host addresses — simple and predictable
You're the network admin for a university's Computer Science department:
Class C example (24 network bits + 8 host bits):
After borrowing 2 bits:
192.168.1.0/24
22 = 4 subnets · 26 − 2 = 62 hosts each · Block size = 64
23 = 8 subnets · 25 − 2 = 30 hosts each · Block size = 32
To create a subnet, answer these two questions:
🔢
This determines how many bits to borrow
👥
This determines how many host bits must remain
| Bits Borrowed (x) | Subnet Mask | CIDR | # Subnets (2x) | Block Size (2y) | Hosts (2y−2) |
|---|---|---|---|---|---|
| 1 | 255.255.255.128 | /25 | 2 | 128 | 126 |
| 2 | 255.255.255.192 | /26 | 4 | 64 | 62 |
| 3 | 255.255.255.224 | /27 | 8 | 32 | 30 |
| 4 | 255.255.255.240 | /28 | 16 | 16 | 14 |
| 5 | 255.255.255.248 | /29 | 32 | 8 | 6 |
| 6 | 255.255.255.252 | /30 | 64 | 4 | 2 |
| Bits Borrowed (x) | Subnet Mask | CIDR | # Subnets (2x) | Block Size (2y) | Hosts (2y−2) |
|---|---|---|---|---|---|
| 1 | 255.255.128.0 | /17 | 2 | 32,768 | 32,766 |
| 2 | 255.255.192.0 | /18 | 4 | 16,384 | 16,382 |
| 3 | 255.255.224.0 | /19 | 8 | 8,192 | 8,190 |
| 4 | 255.255.240.0 | /20 | 16 | 4,096 | 4,094 |
| 5 | 255.255.248.0 | /21 | 32 | 2,048 | 2,046 |
| 6 | 255.255.252.0 | /22 | 64 | 1,024 | 1,022 |
| 7 | 255.255.254.0 | /23 | 128 | 512 | 510 |
| 8 | 255.255.255.0 | /24 | 256 | 256 | 254 |
| Bits Borrowed (x) | Subnet Mask | CIDR | # Subnets (2x) | Block Size (2y) | Hosts (2y−2) |
|---|---|---|---|---|---|
| 1 | 255.128.0.0 | /9 | 2 | 8,388,608 | 8,388,606 |
| 2 | 255.192.0.0 | /10 | 4 | 4,194,304 | 4,194,302 |
| 4 | 255.240.0.0 | /12 | 16 | 1,048,576 | 1,048,574 |
| 8 | 255.255.0.0 | /16 | 256 | 65,536 | 65,534 |
| 12 | 255.255.240.0 | /20 | 4,096 | 4,096 | 4,094 |
| 16 | 255.255.255.0 | /24 | 65,536 | 256 | 254 |
Where x = number of host bits borrowed:
| Bits Borrowed (x) | 2x | Subnets Created |
|---|---|---|
| 1 | 21 | 2 |
| 2 | 22 | 4 |
| 3 | 23 | 8 |
| 4 | 24 | 16 |
| 5 | 25 | 32 |
| 6 | 26 | 64 |
| 7 | 27 | 128 |
| 8 | 28 | 256 |
Where y = host bits remaining:
| Host Bits (y) | Addresses (2y) | Usable Hosts (2y−2) |
|---|---|---|
| 2 | 4 | 2 |
| 3 | 8 | 6 |
| 4 | 16 | 14 |
| 5 | 32 | 30 |
| 6 | 64 | 62 |
| 7 | 128 | 126 |
| 8 | 256 | 254 |
| 10 | 1,024 | 1,022 |
| 12 | 4,096 | 4,094 |
Q1: You need 4 subnets from a Class C network. How many bits must you borrow?
Q2: A /26 subnet mask gives you how many usable hosts per subnet?
Q3: What is the subnet mask for a /27 network?
192.168.1.0255.255.255.0Questions to answer:
192.168.1.0255.255.255.0Questions to answer: