This article explains how a Juniper MX router processes DHCP Discover messages from new clients based on whether the BOOTP flag is set to unicast or broadcast**. The treatment of the DHCP Discover message varies, and it is essential to understand how each flag affects the process to ensure a smooth DHCP assignment for new clients.
DHCP Discovery message with the Bootp as Unicast
DHCP Offer message with Bootp set to Unicast:
DHCP on MX router as DHCP relay agent:
- BOOTP flag: This flag in the DHCP Discover message indicates whether the client is requesting a unicast or broadcast reply from the DHCP server.
- DHCP Discover: A message sent by a client to discover DHCP servers and request an IP address.
1. BOOTP Flag Set to Unicast:
When a DHCP Discover message has the BOOTP flag set to unicast, it means the client is requesting the DHCP server to send the reply directly to the client using a unicast address. However, for a new client, this behavior may cause issues.
Understanding:
- Client Requesting Unicast: The client, which does not have an IP address yet, sends a DHCP Discover message. If the BOOTP flag is set to unicast, the client is indicating that it wants the DHCP server to respond directly to its IP address. However, as the client doesn't have a valid IP address, it cannot receive a unicast response from the server.
- Router's Role: The Juniper MX router forwards the DHCP Discover message with the unicast flag to the DHCP server. The server may attempt to respond to the unicast address in the flag, but if the client doesn't yet have an IP address, the unicast response will be dropped on the client.
Issues:
- The client may fail to receive the DHCP Offer message if it doesn’t have an IP address to communicate via unicast.
- The communication between the DHCP server and client can be disrupted due to the lack of an IP address on the client.
Example:
A new client sends a DHCP Discover message with the BOOTP flag set to unicast, asking the DHCP server to reply to its unicast IP address. Since the client does not have an IP address yet, it cannot receive the unicast response, causing the IP address assignment to fail. Unicast flag is problematic for new clients since they cannot yet receive a unicast reply. This setup should be avoided for new clients requesting IP addresses.
2. BOOTP Flag Set to Broadcast:
When the BOOTP flag is set to broadcast in a DHCP Discover message, the client is asking for the DHCP server to reply to all DHCP servers in the network, typically because it does not yet have an IP address.
- Client Requesting Broadcast: The new client, which doesn't have an IP address, sends a DHCP Discover message with the BOOTP flag set to broadcast. This means the client is open to receiving responses from any DHCP server, even though it does not yet have an IP address to communicate over unicast.
- Router's Role: The Juniper MX router forwards the DHCP Discover message as a broadcast to all DHCP servers on the local network. This ensures that the client can receive responses from any server offering an IP address.
Correct Behavior for New Clients:
- Broadcast flag is the standard and preferred behavior for a new client. It allows the client to receive DHCP Offers from all DHCP servers, regardless of its current lack of an IP address.
- This method ensures that the client can get an IP address from a DHCP server, as the broadcast reply is sent to the entire local network and not to a specific IP address.
A new client sends a DHCP Discover message with the BOOTP flag set to broadcast, asking all available DHCP servers on the network for an IP address. The DHCP servers respond with DHCP Offer messages, and the client can select one to receive its IP address.
Summary:
- Broadcast flag is the correct behavior for new clients, as it allows them to receive offers from multiple DHCP servers, ensuring a smooth IP address assignment process.