On /32
/32 (255.255.255.255
) does not have room for any bits for the subnet portion of the IP address, so it can be considered a special or even degenerate subnet consisting of only 1 IP address, namely the IP address like 128.42.5.4
, and no network address, no broadcast address. But it can be useful to refer to a solitary IP address.
On /30
In normal subnets (but see an exception below), there would be a network address (subnet portion of the IP address consisting of all zeros) and a broadcast address (subnet portion of the IP address consisting of all ones). So if there are n bits in the subnet portion of the IP address, then there are 2^n-2 possible regular IP addresses that can be allocated in this subnet (minus 2 for the network and broadcast addresses).
So /30 (255.255.255.252) is the smallest subnet in this sense, that it has 2 regular IP addresses that can be used besides the network and broadcast addresses (but see the description of /31 below).
In your example, if it is /30, we would have:
- network address:
128.42.5.4
(00 in last two bits)
- broadcast address:
128.42.5.7
(11 in last two bits)
- 2 regular IP addresses
128.42.5.5
and 128.42.5.6
There's also /31
You may wonder, for small subnets, do we really need to waste two IP addresses for broadcast and network? Especially for point-to-point subnets with just one interface on each end, RFC 3021 allows /31 (255.255.255.254) that consists of only two IP addresses, no network address and no broadcast address.
In your example, if it is /31, we would have:
- 1st regular IP address:
128.42.5.4
(0 in last bit)
- 2nd regular IP address:
128.42.5.5
(1 in last bit)
Would there be any problems with routers interpreting these as network address or broadcast address? Not if they follow RFC3021 (which most routers do), and make exceptions for /31 networks.
Hence, it is popular for a point-to-point link which can use an IP address at each end. It saves 2 IP addresses for each time /31 is used rather than /30.