IPv4 Addresses and Prefixes
What an IPv4 address means
An IPv4 address is a 32-bit number used by the Internet Protocol to identify a source or destination. In ordinary unicast communication, an address is assigned to an interface, not permanently to a person or device. A laptop can have separate wired and wireless addresses. Dotted decimal writes four eight-bit octets, each from 0 to 255. For example, 192.0.2.34 is valid notation; 192.0.2.256 is not. All examples here are fictional and must not be configured on public networks.
The prefix defines the network
The /24 in 192.0.2.34/24 means the first 24 bits identify the network prefix. The remaining eight bits vary within that block. The equivalent mask is 255.255.255.0. Apply bitwise AND to the address and mask to obtain 192.0.2.0, the network address. The host portion has value 34. A bare address does not tell you its subnet size.
Address 192.0.2.34Mask 255.255.255.0AND 192.0.2.0Prefix 192.0.2.0/24Change the prefix, change the block
With 192.0.2.130/25 the mask is 255.255.255.128. The last octet is 10000010 in binary. AND with 10000000 gives 128, leaving host offset 2. Thus the network is 192.0.2.128/25, not 192.0.2.0/25. A /25 contains 128 addresses; a /24 contains 256. In an ordinary /24 broadcast LAN, the first address identifies the subnet and the last is its directed broadcast; neither is an ordinary host assignment. The next chapter handles special /31 and /32 rules.
130 = 10000010128 = 10000000AND = 10000000 = 128Why classes are historical
Older classful addressing associated conventional A, B and C network sizes with /8, /16 and /24. Modern CIDR carries a prefix explicitly instead of inferring it from an address’s first octet. For example, 10.1.2.3/24 is a /24 within the private 10/8 allocation. The allocation size does not dictate the configured subnet size.
Practice and common mistakes
A larger prefix number leaves fewer variable bits, not more. Do not equate the number of addresses with the number assignable to ordinary hosts. For 198.51.100.77/26, find the mask and starting address. Check by applying AND to the last octet; the next lesson uses prefixes to choose a delivery path.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
IPv4 addresses and prefixes — knowledge check
Apply IPv4 concepts to fictional offline scenarios.
Which is valid dotted-decimal IPv4 notation?
What does /24 specify?
What network contains 192.0.2.130/25?
How many total addresses are in a /25?
What determines the subnet size in 10.1.2.3/24?