This is for my own personal information. A cliff notes to myself where I’ve grabbed various pieces of information about DHCP.
Client sends a DHCPDISCOVER message. Sent via broadcast packet.
DHCPOFFER message is a response to a DHCPDISCOVER and is sent by one or numerous DHCP servers.
DHCPREQUEST message is then sent by the client to the DHCP server which responded to its request. The message indicates the client is requesting that particular IP address for lease.
DHCPACK message is sent by the server, the DHCP server then assigns the IP address lease to that client.
So the pattern/order is (restating a lot of what I just mentioned above):
- 1 = DHCP Discover message (DHCPDiscover).
- 2 = DHCP Offer message (DHCPOffer).
- 3 = DHCP Request message (DHCPRequest).
- 4 = DHCP Decline message (DHCPDecline).
- 5 = DHCP Acknowledgment message (DHCPAck).
- 6 = DHCP Negative/No Acknowledgment message (DHCPNak).
- 7 = DHCP Release message (DHCPRelease).
- 8 = DHCP Informational message (DHCPInform).
Because the DHCPDISCOVER message is a broadcast message, and broadcasts only cross other segments when they are explicitly routed, you might have to configure a DHCP Relay Agent on the router interface so that all DHCPDISCOVER messages can be forwarded to your DHCP server. Alternatively, you can configure the router to forward DHCP messages and BOOTP message. In a routed network, you would need DHCP Relay Agents if you plan to implement only one DHCP server.
If your network has multiple segments, you have to perform either of the following:
- Place a DHCP server on each segment.
- Place a DHCP Relay Agent on each segment.
- Configure your routers to forward broadcast messages.
DHCP Relay Agent (aka ip helper-address)
All Cisco routers that run Cisco software include a DHCP server and the relay agent software. A DHCP relay agent is any host or IP router that forwards DHCP packets between clients and servers. This module describes the concepts and tasks needed to configure the Cisco IOS DHCP relay agent.
- The Cisco IOS DHCP server and relay agent are enabled by default. You can verify whether they have been disabled by checking your configuration file. If they have been disabled, the “no service dhcp” command will appear in the configuration file. Use the “service dhcp” command to reenable the functionality if necessary.
- The Cisco IOS DHCP relay agent will be enabled on an interface only when the ip helper-address command is configured. This command enables the DHCP broadcast to be forwarded to the configured DHCP server.
…relay agents receive DHCP messages and then generate a new DHCP message to send out on another interface
The relay agent sets the gateway IP address (giaddr field of the DHCP packet) and, if configured, adds the relay agent information option (option 82) in the packet and forwards it to the DHCP server. The reply from the server is forwarded back to the client after removing option 82.
The Cisco IOS XE DHCP relay agent supports the use of unnumbered interfaces. An unnumbered interface can “borrow” the IP address of another interface already configured on the router, which conserves network and address space. For DHCP clients connected though the unnumbered interfaces, the DHCP relay agent automatically adds a static host route once the DHCP client obtains an address, specifying the unnumbered interface as the outbound interface. The route is automatically removed once the lease time expires or when the client releases the address.
- The address argument can be a specific DHCP server address, or it can be the network address if other DHCP servers are on the destination network segment. Using the network address enables other servers to respond to DHCP requests (such as DHCP failover).
The DHCP Relay Agent (dhcrelay) allows for the relay of DHCP and BOOTP requests from a subnet with no DHCP server on it to one or more DHCP servers on other subnets.
When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. When a DHCP server returns a reply, the reply is broadcast or unicast on the network that sent the original request.
The failover peer section that identifies the primary and secondary servers can be any string (such as “dhcp-failover”). The example identifies the two DHCP servers by address, but you can use DNS names as well.
Ports – In the past couple years, TCP ports 647 (primary) and 847 (peer) have emerged as the standard bindings for DHCP failover. It’s worth noting that as recently as 2005, the dhcpd.conf(5) man page used ports 519 and 520 in its failover example, but 647 and 847 look like good choices as of 2008 and beyond.
Unicast Unicast is the term used to describe communication where a piece of information is sent from one point to another point. In this case there is just one sender, and one receiver. Unicast transmission, in which a packet is sent from a single source to a specified destination, is still the predominant form of transmission on LANs and within the Internet.
Broadcast Broadcast is the term used to describe communication where a piece of information is sent from one point to all other points. In this case there is just one sender, but the information is sent to all connected receivers. Network layer protocols (such as IPv4) also support a form of broadcast that allows the same packet to be sent to every system in a logical network (in IPv4 this consists of the IP network ID and an all 1’s host number).
Multicast Multicast is the term used to describe communication where a piece of information is sent from one or more points to a set of other points. In this case there may be one or more senders, and the information is distributed to a set of receivers (there may be no receivers, or any other number of receivers).