Embedded Software: The Works

From his experience in technical support, Dan Schiro did a piece on DHCP in NewBits in early 2004, which was the basis for this article. (CW)
DHCP (Dynamic Host Configuration Protocol) has become a common means of network administration. DHCP is to networking what plug and play is to PCI devices. It allows network administrators to control configuration options remotely and allows end users to move their network devices around subnets without needing to know the intricacies of the network topology. Developers of network devices wishing to utilize a DHCP client need to be aware of a few key features of DHCP to avoid possible troubles in the field.
Before discussing possible issues, an understanding of how DHCP works is needed. DHCP works using a small caveat in RFC 1122: the TCP/IP software should accept and forward to the IP layer any IP packets delivered to the client's hardware address before the IP address is configured. This means that as long as the packet has the right MAC address, it will be passed up the stack, regardless of the destination IP, as long as an IP address has not been attached to the stack. For the purposes of the following discussion, only the procedure for obtaining an IP lease for the first time will be discussed. It will also be assumed that the DHCP server is on the same subnet as the client.
DHCP relies on UDP for data exchange. The DHCP client normally...