1
$\begingroup$

For some reason—at least when classes are involved (which I don't know the reason for yet)—in IPv4 the number of host addresses available per network is given by $2^\textrm{host bits} - 2$. Why don't we have $2^\textrm{host bits}$ host addresses available?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

The addresses x.x.x.255 are reserved: they are the "broadcast address" (for /8 networks, i.e., where the "host bits" = 8).

The addresses x.x.x.0 are actually fine. However, they used to be reserved, so older sources might consider them unavailable. See https://stackoverflow.com/q/14915188/781723 and https://serverfault.com/q/135267/111679 and https://serverfault.com/q/10985/111679.

Thus, older sources might list it as "minus two"; a more modern view is that it is "minus one".

$\endgroup$
3
  • $\begingroup$ What about for, say, /24 networks? If all x.x.x.255 are reserved then the number of available host addresses is $2^8 \times 2^8 \times (2^8 - 1)$ which is not equal to $2^{24} - 1$ $\endgroup$
    – user147634
    Jan 29, 2022 at 16:37
  • 1
    $\begingroup$ @JosephGriffith I think you mean a /8 network. For a /8 network, the first 8 bits are for the network, and the last 24 bits are for the host. (See en.wikipedia.org/wiki/…) I believe only all-ones and all-zeros in the host portion have any special meaning, but I am not 100% certain. $\endgroup$
    – D.W.
    Jan 29, 2022 at 21:56
  • $\begingroup$ Considering that there is no such thing as "classes" and hasn't been for over 20 years, one can assume that any source that still mentions them belongs to the category of "older sources". $\endgroup$ Jan 29, 2022 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.