Managing NFS and NIS, 2nd Edition - Mike Eisler [172]
Throughout this chapter we assume that your system is capable of using both IPv4 and IPv6, and uses the ipnodes database to obtain IP address mappings. If your system does not support IPv6 yet, then replace references to the ipnodes database with the hosts database. To reiterate, an unsuccessful lookup of an IPv4 address in the ipnodes database implies a subsequent lookup of the same address in the hosts database.
Broadcast addresses
Many network problems stem from confusion or inconsistency in the way hosts form their IP broadcast addresses. Broadcast addresses are used when a packet must be sent to all machines on the local area network. For example, if your host needs to send a packet to another machine, it must know the remote machine's IP address and Ethernet address. It can determine the remote IP address by looking up the remote hostname in the NIS ipnodes map, but it may not have the corresponding Ethernet address. If this is the first time your machine is talking to this particular remote host, it won't have had an opportunity to locate or save the remote Ethernet address. The way to determine the remote machine's Ethernet address is to ask all of the hosts on the network if they have the information, using the Address Resolution Protocol (ARP). To broadcast this request to all hosts on the network, your host uses a special kind of destination address called a broadcast address. A normal (or unicast) address identifies only one host; a broadcast address identifies all hosts on the network.
To be an effective broadcast, the packet must reach all nodes on the local area network and be recognized as a broadcast packet by them. An improperly formed broadcast address, or one that other systems do not recognize as such, can be responsible for failures ranging from NIS clients that cannot find servers to storms of broadcast packets initiated by a single packet sent with the wrong broadcast address.
Like host addresses, broadcast addresses exist in both the MAC and IPv4 layers of the protocol stack. There are no broadcast addresses in IPv6; their function is superseded by multicast addresses.[4] An IPv4 broadcast address is converted into a MAC broadcast address, just as a host-specific IP address is converted into a 48-bit Ethernet address. At the MAC layer, there is exactly one broadcast address; for Ethernet it is:
ff:ff:ff:ff:ff:ff
Every node on the local network receives a packet having this destination MAC address. A host may ignore a broadcast if the request is for a service that it does not provide. A host processes every broadcast packet, at the very least deciding to discard it. Therefore, a high level of broadcast traffic hurts the performance of each host on the network.
While the MAC layer broadcast address is very clearly defined, there is some variation in the form of IPv4 broadcast addresses. There are two distinct popular forms, mostly due to evolution of the networking code in Berkeley-based Unix systems.[5] Examples of broadcast addresses of each form are shown for each IPv4 address class in Table 13-2. IPv4 address classes are described in Section 1.3.3.
Table 13-2. Broadcast address forms
Address Class
Example
Ones Form
Zeros Form
Class A
89.
89.255.255.255
89.0.0.0
Class B
129.7.
129.7.255.255
129.7.0.0
Class C
192.6.4.
192.6.4.255
192.6.4.0
Classless
192.1.2. /23
192.1.3.255
192.1.3.0
The ones form is the most widely accepted and is used in all examples in this book. Octets of the IPv4 address that specify the host number are filled in with 1-valued bits. A variation on the ones form is the zeros form, in which the host number is expressed as zero-valued octets. The all-ones form:
255.255.255.255
is a variation of the proper ones form address where the 255-valued octets occupy only the host number portion of the address.
Confusion regarding the "proper" broadcast address stems from the interpretation of octet values 0 and 255 in IPv4 addresses. Zero-valued