nuttxs opened a new pull request, #3152:
URL: https://github.com/apache/nuttx-apps/pull/3152

   ## Summary
   
   - netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and 
rebinding (T2) time from DHCP packet
   - According to RFC 2131, T1 and T2 times play a critical role in lease 
management in DHCP clients.
   
   ### T1 Time (Renewal Time)
   - **Definition**: The time at which the client enters the RENEWING state.
   - **Default Value**: 50% of the lease time (0.5 × lease_time).
   - **Actions**: When the T1 time is reached, the client will:
     - Enter the RENEWING state.
     - Send a unicast DHCPREQUEST message to the original DHCP server to renew 
the lease.
     - Attempt to extend the current IP address lease.
   ### T2 Time (Rebinding Time)
   - **Definition**: The time at which the client enters the REBINDING state.
   - **Default Value**: 87.5% of the lease time (0.875 × lease_time).
   - **Actions**: When the T2 time is reached (and T1 renewal has failed), the 
client will:
     - Enter the REBINDING state.
     - Send a broadcast DHCPREQUEST message to all DHCP servers.
     - Attempt to obtain a lease extension from any available DHCP server.
   
   ## Impact
   New Feature/Change: Correctly receive and store T1 and T2 time provided by 
the server
   User Impact: Provide a foundation for the implementation of intelligent 
renewal mechanism in the future
   Build Impact:No new Kconfig options or build system changes.
   Hardware Impact: No
   Security: No
   Compatibility: Backward-compatible; no breaking changes.
   
   ## Testing
   #Use tcpdump to capture DHCP traffic
   #View options 58 and 59 in DHCP ACK packets
   #Option 58: T1 Time
   #Option 59: T2 Time
   #Compare the time(t1/t2) with the interface dhcp_denew()
   <img width="1381" height="349" alt="图片" 
src="https://github.com/user-attachments/assets/4bf39495-f7b2-41dd-9ed9-77da2c8260a6";
 />
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to