3. BOOTP Client Behavior
This section clarifies various issues regarding BOOTP client behavior.
3.1. Client use of the 'flags' field
3.1.1. The BROADCAST flag
Normally, BOOTP servers and relay agents attempt to deliver BOOTREPLY messages directly to a client using unicast delivery. The IP destination address (in the IP header) is set to the BOOTP 'yiaddr' address and the link-layer destination address is set to the BOOTP 'chaddr' address. Unfortunately, some client implementations are unable to receive such unicast IP datagrams until they know their own IP address (thus we have a "chicken and egg" issue). Often, however, they can receive broadcast IP datagrams (those with a valid IP broadcast address as the IP destination and the link-layer broadcast address as the link-layer destination).
If a client falls into this category, it SHOULD set (to 1) the newly-defined BROADCAST flag in the 'flags' field of BOOTREPLY messages it generates. This will provide a hint to BOOTP servers and relay agents that they should attempt to broadcast their BOOTREPLY messages to the client.
If a client does not have this limitation (i.e., it is perfectly able to receive unicast BOOTREPLY messages), it SHOULD NOT set the BROADCAST flag (i.e., it SHOULD clear the BROADCAST flag to 0).
DISCUSSION:
This addition to the protocol is a workaround for old host implementations. Such implementations SHOULD be modified so that they may receive unicast BOOTREPLY messages, thus making use of this workaround unnecessary. In general, the use of this mechanism is discouraged.
3.1.2. The remainder of the 'flags' field
The remaining bits of the 'flags' field are reserved for future use. A client MUST set these bits to zero in all BOOTREQUEST messages it generates. A client MUST ignore these bits in all BOOTREPLY messages it receives.
3.2. Definition of the 'secs' field
The 'secs' field of a BOOTREQUEST message SHOULD represent the elapsed time, in seconds, since the client sent its first BOOTREQUEST message. Note that this implies that the 'secs' field of the first BOOTREQUEST message SHOULD be set to zero.
Clients SHOULD NOT set the 'secs' field to a value which is constant for all BOOTREQUEST messages.
DISCUSSION:
The original definition of the 'secs' field was vague. It was not clear whether it represented the time since the first BOOTREQUEST message was sent or some other time period such as the time since the client machine was powered-up. This has limited its usefulness as a policy control mechanism for BOOTP servers and relay agents. Furthermore, certain client implementations have been known to simply set this field to a constant value or use incorrect byte-ordering. Incorrect byte-ordering usually makes it appear as if a client has been waiting much longer than it really has, so a relay agent will relay the BOOTREQUEST sooner than desired (usually immediately). These implementation errors have further undermined the usefulness of the 'secs' field. These incorrect implementations SHOULD be corrected.
3.3. Use of the 'ciaddr' and 'yiaddr' fields
If a BOOTP client does not know what IP address it should be using, the client SHOULD set the 'ciaddr' field to 0.0.0.0. If the client has the ability to remember the last IP address it was assigned, or it has been preconfigured with an IP address via some alternate mechanism, the client MAY fill the 'ciaddr' field with that IP address. If the client does place a non-zero IP address in the 'ciaddr' field, the client MUST be prepared to accept incoming unicast datagrams addressed to that IP address and also answer ARP requests for that IP address (if ARP is used on that network).
The BOOTP server is free to assign a different IP address (in the 'yiaddr' field) than the client expressed in 'ciaddr'. The client SHOULD adopt the IP address specified in 'yiaddr' and begin using it as soon as possible. DISCUSSION:
There are various interpretations about the purpose of the 'ciaddr' field and, unfortunately, no agreement on a single correct interpretation. One interpretation is that if a client is willing to accept whatever IP address the BOOTP server assigns to it, the client should always place 0.0.0.0 in the 'ciaddr' field, regardless of whether it knows its previously-assigned address. Conversely, if the client wishes to assert that it must have a particular IP address (e.g., the IP address was hand-configured by the host administrator and BOOTP is only being used to obtain a boot file and/or information from the 'vend' field), the client will then fill the 'ciaddr' field with the desired IP address and ignore the IP address assigned by the BOOTP server as indicated in the 'yiaddr' field. An alternate interpretation holds that the client always fills the 'ciaddr' field with its most recently-assigned IP address (if known) even if that address may be incorrect. Such a client will still accept and use the address assigned by the BOOTP server as indicated in the 'yiaddr' field. The motivation for this interpretation is to aid the server in identifying the client and/or in delivering the BOOTREPLY to the client. Yet a third (mis)interpretation allows the client to use 'ciaddr' to express the client's desired IP address, even if the client has never used that address before or is not currently using that address.
The last interpretation is incorrect as it may prevent the BOOTREPLY from reaching the client. The server will usually unicast the reply to the address given in 'ciaddr' but the client may not be listening on that address yet, or the client may be connected to an incorrect subnet such that normal IP routing (correctly) routes the reply to a different subnet.
The second interpretation also suffers from the "incorrect subnet" problem.
The first interpretation seems to be the safest and most likely to promote interoperability.
3.4. Interpretation of the 'giaddr' field
The 'giaddr' field is rather poorly named. It exists to facilitate the transfer of BOOTREQUEST messages from a client, through BOOTP relay agents, to servers on different networks than the client. Similarly, it facilitates the delivery of BOOTREPLY messages from the servers, through BOOTP relay agents, back to the client. In no case does it represent a general IP router to be used by the client. A BOOTP client MUST set the 'giaddr' field to zero (0.0.0.0) in all BOOTREQUEST messages it generates.
A BOOTP client MUST NOT interpret the 'giaddr' field of a BOOTREPLY message to be the IP address of an IP router. A BOOTP client SHOULD completely ignore the contents of the 'giaddr' field in BOOTREPLY messages.
DISCUSSION:
The semantics of the 'giaddr' field were poorly defined. Section 7.5 of [1] states:
"If 'giaddr' (gateway address) is nonzero, then the packets should be forwarded there first, in order to get to the server."
In that sentence, "get to" refers to communication from the client to the server subsequent to the BOOTP exchange, such as a TFTP session. Unfortunately, the 'giaddr' field may contain the address of a BOOTP relay agent that is not itself an IP router (according to [1], Section 8, fifth paragraph), in which case, it will be useless as a first-hop for TFTP packets sent to the server (since, by definition, non-routers don't forward datagrams at the IP layer).
Although now prohibited by Section 4.1.1 of this memo, the 'giaddr' field might contain a broadcast address according to Section 8, sixth paragraph of [1]. Not only would such an address be useless as a router address, it might also cause the client to ARP for the broadcast address (since, if the client didn't receive a subnet mask in the BOOTREPLY message, it would be unable to recognize a subnet broadcast address). This is clearly undesirable.
To reach a non-local server, clients can obtain a first-hop router address from the "Gateway" subfield of the "Vendor Information Extensions" [2] (if present), or via the ICMP router discovery protocol [5] or other similar mechanism.
3.5. Vendor information "magic cookie"
It is RECOMMENDED that a BOOTP client always fill the first four octets of the 'vend' (vendor information) field of a BOOTREQUEST with a four-octet identifier called a "magic cookie." A BOOTP client SHOULD do this even if it has no special information to communicate to the BOOTP server using the 'vend' field. This aids the BOOTP server in determining what vendor information format it should use in its BOOTREPLY messages. If a special vendor-specific magic cookie is not being used, a BOOTP client SHOULD use the dotted decimal value 99.130.83.99 as specified in [2]. In this case, if the client has no information to communicate to the server, the octet immediately following the magic cookie SHOULD be set to the "End" tag (255) and the remaining octets of the 'vend' field SHOULD be set to zero.
DISCUSSION:
Sometimes different operating systems or networking packages are run on the same machine at different times (or even at the same time!). Since the hardware address placed in the 'chaddr' field will likely be the same, BOOTREQUESTs from completely different BOOTP clients on the same machine will likely be difficult for a BOOTP server to differentiate. If the client includes a magic cookie in its BOOTREQUESTs, the server will at least know what format the client expects and can understand in corresponding BOOTREPLY messages.