If different IP implementations are to be compatible, there must be
convention distinguished number to denote "all hosts" and "all
subnets".
Since the local network layer can always map an IP address into data
link layer address, the choice of an IP "broadcast host number" is
somewhat arbitrary. For simplicity, it should be one not likely to
be assigned to a real host. The number whose bits are all ones has
this property; this assignment was first proposed in [6]. In the few
cases where a host has been assigned an address with a host-number
part of all ones, it does not seem onerous to require renumbering.
The "all subnets" number is also all ones; this means that a host
wishing to broadcast to all hosts on a remote IP network need not
know how the destination address is divided up into subnet and host
fields, or if it is even divided at all. For example, 36.255.255.255
may denote all the hosts on a single hardware network, or all the
hosts on a subnetted IP network with 1 byte of subnet field and 2
bytes of host field, or any other possible division.
The address 255.255.255.255 denotes a broadcast on a local hardware
network that must not be forwarded. This address may be used, for
example, by hosts that do not know their network number and are
asking some server for it.
Thus, a host on net 36, for example, may:
broadcast to all of its immediate neighbors by using
255.255.255.255
broadcast to all of net 36 by using 36.255.255.255
without knowing if the net is subnetted; if it is not, then both
addresses have the same effect. A robust application might try the
former address, and if no response is received, then try the latter.
See [1] for a discussion of such "expanding ring search" techniques.
If the use of "all ones" in a field of an IP address means
"broadcast", using "all zeros" could be viewed as meaning
"unspecified". There is probably no reason for such addresses to
appear anywhere but as the source address of an ICMP Information
Request datagram. However, as a notational convention, we refer to
networks (as opposed to hosts) by using addresses with zero fields.
For example, 36.0.0.0 means "network number 36" while 36.255.255.255
means "all hosts on network number 36".