A network mask (subnet mask) helps divide an IP address into two parts:
- Network portion – Identifies the network.
- Host portion – Identifies a specific device within the network.
A subnet mask is a 32-bit number (like an IPv4 address) written in dotted decimal notation (e.g., 255.255.255.0).
It consists of:
- 1s (network part) – Defines the network.
- 0s (host part) – Defines individual devices within the network.
- IP Address:
192.168.1.10 - Subnet Mask:
255.255.255.0
IP Address: 11000000.10101000.00000001.00001010 (192.168.1.10)
Subnet Mask: 11111111.11111111.11111111.00000000 (255.255.255.0)
- Network Portion:
192.168.1.(First 3 octets) - Host Portion:
10(Last octet)
👉 Devices in the 192.168.1.0/24 network will have IPs like: 192.168.1.1, 192.168.1.2, ... 192.168.1.254 (Total 254 devices).
| Subnet Mask | CIDR Notation | No. of Hosts | Example Network |
|---|---|---|---|
255.0.0.0 |
/8 |
16,777,214 | 10.0.0.0/8 |
255.255.0.0 |
/16 |
65,534 | 172.16.0.0/16 |
255.255.255.0 |
/24 |
254 | 192.168.1.0/24 |
- Defines the network size – Determines how many devices can exist within the network.
- Helps routers understand IP routing – Routers use subnet masks to direct traffic.
- Enhances security – Supports network segmentation, reducing unnecessary communication.
Understanding subnet masks is essential for effective network management. Proper subnetting enhances resource allocation, security, and performance.