Incorrect DHCP Server Behavior

Incorrect DHCP Server Behavior

Incorrect DHCP Server Behavior
Incorrect DHCP Server Behavior
2025-07-01 21:08:12 - last edited 2025-07-02 05:43:17
Model: TL-SX3008F  
Hardware Version: V20
Firmware Version: 1.20.0 Build 20231011 Rel.42220

1. DHCP client broadcasts a DHCP Discover message. The message contains a Requested-IP (50) field which contains an IP which apparently has been previously offered by the server and accepted by the client.

 

2. The DHCP server broadcasts a NACK message with the client's MAC address as Client-ID (61), with the message "Lease expired for request message".

 

At this point the DHCP protocol already seems to be broken by the server as a NACK message only seems to be appropriate following a DHCP Request message. The server's NACK message is apparently being sent as a response to the client's Discover message, but this doesn't seem to follow the DHCP protocol as specified in RFC2131. The client is only sending Discover and no other DHCP message types. 

 

The client, which justifiably disregards the inappropriate NACK message, again broadcasts a Discover message containing the same Requested-IP as in step 1. Server responds as in step 2. Repeats ad infinitum. Client never receives an offer and hence never completes the DHCP protocol execution.

 

This seems to be a server bug. RFC2131 shows Discover - Offer - Request - ACK|NACK, as a valid protocol execution path. The DHCP server on this TP-Link switch seems to believe Discover - NACK is a valid protocol execution path, which RFC2131 doesn't seem to support. 

 

The correct behavior would be that the server makes an Offer, which may or may not contain the Requested-IP in the client's Discover message, that's up to the server. From then on the client could continue with a Request to which the server can ACK or NACK. Basically, the server shouldn't change protocol behavior because a client sent a Requested-IP along in its Discover message. 

 

Discover != Request

  0      
  0      
#1
Options
2 Accepted Solutions
Re:Incorrect DHCP Server Behavior-Solution
2025-07-02 01:02:33 - last edited 2025-07-02 05:43:18

  @carrier_pigeon 

No. I don't think so.

Is this a new device that has not been connected before or listed in the switch ARP table or has been assigned an IP address before?

Request - NACK would happen to a device that has been connected to the DHCP server before, and it has a record of it.

Without any details on this, I don't think this statement would be true. 

 

I know a regular DHCP path would be that, but if you read the whole RFC about DHCP, that is only a part of how the new DHCP discovery works. 

How Does DHCP Work? Common Questions and Solutions

Recommended Solution
  1  
  1  
#2
Options
Re:Incorrect DHCP Server Behavior-Solution
2025-07-02 03:51:51 - last edited 2025-07-02 05:43:17

  @Clive_A 

Thanks for the feedback.

 

It has connected, at least once before. In the meantime I found out the TP Link switch is not to blame as it's not sending that NACK. It's coming from a different switch which is not supposed to have its DHCP server running. Single digit difference but it's clearly a different switch. Still not sure why that switch would then violate the protocol but this is otherwise undefined behavior territory. I've disabled  DHCP service on that switch so I'm guessing this will now resolve itself.

 

Thanks again.

Recommended Solution
  1  
  1  
#3
Options
2 Reply
Re:Incorrect DHCP Server Behavior-Solution
2025-07-02 01:02:33 - last edited 2025-07-02 05:43:18

  @carrier_pigeon 

No. I don't think so.

Is this a new device that has not been connected before or listed in the switch ARP table or has been assigned an IP address before?

Request - NACK would happen to a device that has been connected to the DHCP server before, and it has a record of it.

Without any details on this, I don't think this statement would be true. 

 

I know a regular DHCP path would be that, but if you read the whole RFC about DHCP, that is only a part of how the new DHCP discovery works. 

How Does DHCP Work? Common Questions and Solutions

Recommended Solution
  1  
  1  
#2
Options
Re:Incorrect DHCP Server Behavior-Solution
2025-07-02 03:51:51 - last edited 2025-07-02 05:43:17

  @Clive_A 

Thanks for the feedback.

 

It has connected, at least once before. In the meantime I found out the TP Link switch is not to blame as it's not sending that NACK. It's coming from a different switch which is not supposed to have its DHCP server running. Single digit difference but it's clearly a different switch. Still not sure why that switch would then violate the protocol but this is otherwise undefined behavior territory. I've disabled  DHCP service on that switch so I'm guessing this will now resolve itself.

 

Thanks again.

Recommended Solution
  1  
  1  
#3
Options