From e6bca3305bbc333cc71e5bf1ee483bbacfa84736 Mon Sep 17 00:00:00 2001 From: Sean Edmond Date: Wed, 8 May 2024 19:39:02 -0700 Subject: net: bootp: BOOTP/DHCPv4 retransmission improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch introduces 3 improvements to align with RFC 951: - retransmission backoff interval maximum is configurable - initial retranmission backoff interval is configurable - transaction ID is kept the same for each BOOTP/DHCPv4 request In applications where thousands of nodes are serviced by a single DHCP server, maximizing the retransmission backoff interval at 2 seconds (the current u-boot default) exerts high pressure on the DHCP server and network layer. RFC 951 “7.2. Client Retransmission Strategy” states that the retransmission backoff interval should be limited to 60 seconds. This patch allows the interval to be configurable using the environment variable "bootpretransmitperiodmax" The initial retranmission backoff period defaults to 250ms, which is also too small for these scenarios with many clients. This patch makes the initial retransmission interval to be configurable using the environment variable "bootpretransmitperiodinit". Also, on a retransmission it is not expected for the transaction ID to change (only the 'secs' field should be updated). Let's save the transaction ID and use the same transaction ID for each BOOTP/DHCPv4 exchange. Signed-off-by: Sean Edmond --- lib/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Kconfig b/lib/Kconfig index 189e6eb31aa..9b62b3bbea7 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -265,7 +265,8 @@ config REGEX choice prompt "Pseudo-random library support type" depends on NET_RANDOM_ETHADDR || RANDOM_UUID || CMD_UUID || \ - RNG_SANDBOX || UT_LIB && AES || FAT_WRITE + RNG_SANDBOX || UT_LIB && AES || FAT_WRITE || CMD_BOOTP || \ + CMD_DHCP || CMD_DHCP6 default LIB_RAND help Select the library to provide pseudo-random number generator -- cgit v1.2.3