What is a Network?
A network is a group of connected computers or devices that communicate with each other. In IP addressing, a network is a range of IP addresses that belong to the same group and can communicate directly without the need for routing.
What is a Subnetwork (Subnet)?
A subnet is a logical subdivision of a network. It divides a larger network into smaller segments to improve management, increase security, and optimize routing.
Types of Networks
- Classful Networks:
- Class A: 1.0.0.0 to 126.255.255.255 (mask 255.0.0.0)
- Class B: 128.0.0.0 to 191.255.255.255 (mask 255.255.0.0)
- Class C: 192.0.0.0 to 223.255.255.255 (mask 255.255.255.0)
- Class D: 224.0.0.0 to 239.255.255.255 (multicast)
- Class E: 240.0.0.0 to 255.255.255.255 (experimental)
- CIDR (Classless Inter-Domain Routing): A modern, flexible subnetting method.
What is a Subnet Mask?
A subnet mask is a 32-bit number that separates the IP address into the network and host parts. The bits where the mask has a 1 correspond to the network portion; bits with 0 correspond to the host portion.
How Does a Subnet Mask Work?
The network address is calculated by performing a bitwise AND between the IP address and the subnet mask. For example:
- IP Address: 192.168.1.10
- Subnet Mask: 255.255.255.0
- Network Address: 192.168.1.0
- Host Addresses: from 192.168.1.1 to 192.168.1.254
Complete Subnet Mask Table
| Subnet Mask | CIDR | Number of Hosts | Description |
|---|---|---|---|
| 255.0.0.0 | /8 | 16,777,214 | Class A (largest network) |
| 255.128.0.0 | /9 | 8,388,574 | |
| 255.192.0.0 | /10 | 4,194,302 | |
| 255.224.0.0 | /11 | 2,097,150 | |
| 255.240.0.0 | /12 | 1,048,574 | |
| 255.248.0.0 | /13 | 524,286 | |
| 255.252.0.0 | /14 | 262,142 | |
| 255.254.0.0 | /15 | 131,070 | |
| 255.255.0.0 | /16 | 65,534 | Class B (medium network) |
| 255.255.128.0 | /17 | 32,766 | |
| 255.255.192.0 | /18 | 16,382 | |
| 255.255.224.0 | /19 | 8,190 | |
| 255.255.240.0 | /20 | 4,094 | |
| 255.255.248.0 | /21 | 2,046 | |
| 255.255.252.0 | /22 | 1,022 | |
| 255.255.254.0 | /23 | 510 | |
| 255.255.255.0 | /24 | 254 | Class C (smallest network) |
| 255.255.255.128 | /25 | 126 | |
| 255.255.255.192 | /26 | 62 | |
| 255.255.255.224 | /27 | 30 | |
| 255.255.255.240 | /28 | 14 | |
| 255.255.255.248 | /29 | 6 | |
| 255.255.255.252 | /30 | 2 | Point-to-Point links |
| 255.255.255.254 | /31 | 2 | Point-to-point (RFC 3021) |
| 255.255.255.255 | /32 | 1 | Single host address |
[amazon_auto_links id=”8218″]
Subnetting Example
Suppose you have a network with a /24 mask (255.255.255.0) and want to create 4 subnets. You borrow 2 bits from the host part:
- New mask: /26 (255.255.255.192)
- Number of subnets: 4 (2^2)
- Number of hosts per subnet: 62
Conclusion
Subnet masks are essential for managing IP addressing, dividing networks into smaller parts, improving data routing and security. Understanding subnet masks and network types is key for designing efficient and secure modern networks.




