Question
What are the two parts of an IPv4 address and how does the subnet mask determine them?
Answer
An IPv4 address has a network portion and a host portion; the subnet mask marks which bits are which — 1s mark network bits, 0s mark host bits.
* The mask's 1-bits mark the network portion, its 0-bits the host portion. *
IPv4 Address Structure:
| Part | Description |
|---|---|
| Network portion | Identifies the network; same for all devices on that network |
| Host portion | Identifies the specific device on that network |
The subnet mask determines which bits belong to which portion:
- Subnet mask bits set to 1 = Network portion
- Subnet mask bits set to 0 = Host portion
Example:
- IP: 192.168.10.10
- Subnet mask: 255.255.255.0
- Network portion: 192.168.10 (first 24 bits)
- Host portion: .10 (last 8 bits)
Key insight: The subnet mask is essential - without it, you cannot determine which portion is network vs host.
Go deeper:
Subnet (Wikipedia) — the network/host boundary and subnet masks with binary examples.
Subnetting Mastery (PracticalNetworking) — a 7-part series that builds the network/host split from first principles.
Note saved — thanks!
Question
What is the prefix length notation and how does it relate to the subnet mask?
Answer
Prefix length is the count of 1-bits in the subnet mask, written as a slash (e.g. /24 = 255.255.255.0); it is just a compact way to write the mask.
* Each longer prefix adds one network bit, lengthening the mask. *
Prefix Length (Slash Notation): A shorthand way to express the subnet mask by indicating the number of bits set to 1.
| Prefix | Subnet Mask | Network Bits |
|---|---|---|
| /8 | 255.0.0.0 | 8 bits |
| /16 | 255.255.0.0 | 16 bits |
| /24 | 255.255.255.0 | 24 bits |
| /25 | 255.255.255.128 | 25 bits |
| /26 | 255.255.255.192 | 26 bits |
| /27 | 255.255.255.224 | 27 bits |
| /28 | 255.255.255.240 | 28 bits |
Example:
- 192.168.10.10/24 means:
- IP address: 192.168.10.10
- Subnet mask: 255.255.255.0
- First 24 bits are network, last 8 bits are host
Context: Prefix notation is more concise and commonly used in network documentation and router configurations.
Go deeper:
Classless Inter-Domain Routing — CIDR notation (Wikipedia) — where the slash notation comes from and how the prefix counts leading 1-bits.
ipcalc (jodies.de) — type a prefix and watch it expand to the binary mask, network, and host range.
Note saved — thanks!