OS X Server Essentials 10.10: Describing How DHCP Works
Reference 19.1 Describing How DHCP Works
The process followed by a DHCP server granting an address to a client is well documented. The interaction occurs in this order:
- A computer or device (host) on the network is configured to obtain network configuration information via DHCP. It broadcasts a request over its local network to see whether a valid DHCP service is available.
- A DHCP server receives the request from the host and responds with the appropriate information. In this example, the DHCP server proposes that the host use an IPv4 address of 172.16.16.5, along with some other network settings, including a valid subnet mask, router, DNS servers, and default search domain.
- The host replies to the first DHCP offer it sees on the network; it sends a request for the IPv4 address of 172.16.16.5, the setting that the DHCP server just offered it.
- The DHCP server formally acknowledges that the host can use the settings it requested. At this time, the host has a valid IPv4 address and can start using the network.
A key benefit provided by the DHCP server in this example is the assignment of configuration information to each host on the network. This negates the need to manually configure the information on each computer or device. When the DHCP server provides this configuration information, you are guaranteed that users will not enter incorrect information when configuring their network settings. If a network has been engineered properly, a new user can take a new Mac out of the box, connect to either a wired or wireless network, and automatically configure the computer with appropriate networking information. The user can then access network services without any manual intervention. This capability provides a simple way to set up and administer computers.
Using DHCP Networks
You can use OS X Server to offer DHCP service on multiple network interfaces. It is likely that each network interface will have different network settings and that you will want to offer a different set of information to DHCP clients depending on what network they are on.
OS X Server uses the term “network” to describe a set of DHCP settings; a network includes the network interface on which you offer DHCP service, the range of IPv4 addresses you offer on that interface, and the network information to offer, including lease time, subnet mask, router, DNS server, and search domain. For clarity, this guide refers to this kind of network as a DHCP network. The DHCP network is the foundation of the DHCP service in OS X Server.
If you need to offer multiple ranges of IPv4 addresses per network interface, you can create multiple DHCP networks per network interface.
As part of your planning process, you should decide whether you need multiple DHCP networks or whether a single DHCP network will suffice.
A DHCP server leases an IPv4 address to a client for a temporary period, the lease time. The DHCP service guarantees that the DHCP client can use its leased IPv4 address for the duration of the lease. Halfway through the lease time, the host requests to renew its lease. The host relinquishes the address when the network interface is no longer in use, such as when the computer or device is shut down, and the DHCP service can assign that IPv4 address to another host if necessary. In the Server app, you specify a lease time of 1 hour, 1 day, 7 days, or 30 days.
If mobile computers and devices use your network, it’s likely that they don’t all need to be on your network at the same time. Leasing allows an organization to support a larger number of network devices than there are available IPv4 addresses by reusing IPv4 addresses over time. If this is the case for you, the lease time is one of the key options to consider when implementing a DHCP service; if network devices come and go often, consider a short lease time so that once a network device leaves the network, its IPv4 address becomes available for a different network device more quickly.
Even if you have more available IPv4 addresses than devices, the fact that hosts need to periodically renew their DHCP leases means that you can make a change to the DHCP information you hand out, and hosts will eventually receive updated information when they renew their lease. If it is a big change, like an entirely different set of network settings, you can force a lease update by rebooting clients or by briefly disconnecting and then reconnecting their network connections.
Comparing Static and Dynamic Address Assignments
You can use the DHCP service to dynamically or statically assign an IPv4 address to individual computers and devices. Each computer or device’s network interface has a unique Media Access Control (MAC) address, which is a physical attribute that cannot be easily changed; it uniquely identifies the network interface. The DHCP service associates a lease with a MAC address. The MAC address is also known as a physical or network address; an example of a MAC address is c8:2a:14:34:92:10. Understand the difference between a dynamic and a static address:
- Dynamic address—An IPv4 address is automatically assigned to a computer or device on a network. The address is typically “leased” to the computer or device for a specific period of time, after which the DHCP server either renews the lease of the address to that computer or device or makes the address available to other computers and devices on the network.
- Static address—You assign an IPv4 address to a specific computer or device on the network and rarely change it. Static addresses can be applied to a computer or device manually. Nonchanging addresses can be assigned by configuring the DHCP server to provide to a MAC address the same IPv4 address every time the computer or device with that MAC address connects to the network. This is called a reservation, and although technically it is a dynamic address, the result is the same as a static one.
It is possible that you will have a combination of statically and dynamically assigned addresses on your network. One of the determining factors as to which address type is most appropriate is the use of the computer or device. For example, if the computer or device is a server, network appliance, or printer, you should consider a static address, whereas mobile computers and devices that come and go on your network would likely be assigned dynamic IPv4 addresses.
Serving Multiple Subnets
The location of the DHCP server has a direct impact on the viability of a DHCP implementation. When a network client asks for DHCP service, it uses the Bootstrap Protocol (BootP) network protocol. By default, most routers do not forward BootP traffic beyond network borders, whether physically separate subnets or programmatically separated virtual local area networks (VLANs). For network clients to receive DHCP service, the DHCP server must be providing DHCP service on the subnet via a network interface on that subnet, or the router must be configured to relay BootP traffic between subnets; this is sometimes referred to as configuring a helper address or a DHCP relay agent.