UDP broadcast relay for DHCP

Effects of UDP broadcasts

The DHCP relay agent function can be used to relay DHCP UDP broadcast requests.

 When a router receives a DHCP request (broadcast), it unicasts the DHCP request to a DHCP server on another network.

 However, be aware that forwarding UDP broadcasts from one subnet to another can inject a lot of traffic.

To forward DHCP broadcast requests from clients, configure the DHCP relay agent function on the router.

 Broadcasts forwarded by devices vary, but on Cisco routers, the following UDP broadcasts are forwarded by using the “ip helper-address interface” command.

serviceUDP port number
TFTP69
DNS53
Time (time service)37
NetBIOS name server137
NetBIOS datagram server138
Boot Protocol (DHCP/BootP)port 67,68
TACACS49
EN-116 Name Server42

It can also be configured to forward arbitrary UDP broadcasts.

You can also configure multiple IP helper addresses for one interface.

If you have clients on the same subnet as the DHCP server

The network configuration is as shown below, the client belongs to the same subnet as the DHCP server.

At this time, the communication between the client and the DHCP server is performed as shown in the figure below.

The source and destination addresses of exchanged packets are as follows.

packetsource
MAC address
Destination
MAC address
source
IP address
Destination
IP address
DHCP DISCOVERAAAA.AAAA.AAAA
(Client’s MAC address)
FFFF.FFFF.FFFF
(Broadcast)
0.0.0.0255.255.255.255
(broadcast)
DHCP OFFERBBBB.BBBB.BBBB
(MAC address of DHCP server)
FFFF.FFFF.FFFF
(Broadcast)
192.168.1.1
(DHCP server)
255.255.255.255
(broadcast)
DHCP REQUESTAAAA.AAAA.AAAA
(Client’s MAC address)
FFFF.FFFF.FFFF
(Broadcast)
0.0.0.0255.255.255.255
(broadcast)
DHCPACKBBBB.BBBB.BBBB
(MAC address of DHCP server)
FFFF.FFFF.FFFF
(Broadcast)
192.168.1.1
(DHCP server)
255.255.255.255
(broadcast)

1. DHCP Discover

 The client sets its own MAC address as the source MAC address and “0.0.0.0” as the IP address as the source address. For the destination address, set “FFFF.FFFF.FFFF” for the destination MAC address and “255.255.255.255” for the destination IP address as the broadcast address, and request that the IP address be assigned.

2. DHCP offers

 The DHCP server receives this request and sends a “What about this IP address?” offer (DHCPOFFER) to the sender. At this time, the destination address is sent by broadcast, not by unicast. The destination MAC address is “FFFF.FFFF.FFFF” and the destination IP address is “255.255.255.255”.

3. DHCP Request

 If the client is satisfied with the offer received in DHCPOFFER, it broadcasts a request (DHCP REQUEST), “Please allow me to use that information.”

 As the source address, set your own MAC address as the source MAC address and “0.0.0.0” as the IP address. For the destination address, set “FFFF.FFFF.FFFF” for the destination MAC address and “255.255.255.255” for the destination IP address as the broadcast address.

4. DHCP ACKs

The DHCP server sends an acknowledgment (DHCP ACK) message to the client.

 At this time, the destination address is sent by broadcast, not by unicast. The destination MAC address is “FFFF.FFFF.FFFF” and the destination IP address is “255.255.255.255”.