the odhcpd DHCPv4 Client successfully negotiates an ‘192.168.1.101’ IP address with the DHCPv4 server
as part of the exchange, the DHCPv4 server sends a DHCP option 58 with T1 = 60 seconds
the odhcpd DHCPv4 respects this T1, and will initiate the DHCP request every 60 seconds (with some jitter)
Error condition
we simulate the DHCPv4 server becoming unresponsive by applying ‘/etc/init.d/dnsmasq stop’ on the CPE
the DHCP request send by odhcpd gets replied with an ‘ICMP Destination Unreachable’
expected behavior: odhcpd applies a retransmission policy like e.g. defined in chapter '4.1 Constructing and sending DHCP messages' in RFC 2131
observed behavior: after getting no reply on the DHCP request, odhcpd stops sending DHCP requests to the DHCPv4 server (i.e. no retransmissions). An overnight test showed that odhcpd will try to contact the DHCPv4 server after (lease/2)
Extra information
on the Extender, another chipset is present (using another type of DHCP Client). This chipset operates autonomously, obtains the ‘192.168.1.175’ IP address
for an overnight test, illustrating that odhcpd leaves Renew state after the failed connection to the DHCP server, and enters Renew state again after (lease time/2): please see the below ‘Appendix A’
the ‘ICMP Destination Unreachable’ is not the cause the observed behavior: adding an iptables rule on the CPE DROPPING DHCP interaction causing no ICMP to be replied, results in the same observed behavior
extra traces were enabled on the odhcpd daemon, please see below ‘Appendix B’ for the resulting Wireshark traces and logs
Appendix A
the ‘odhcpd’ TECH DHCP Client receives its T1 value via DHCP option 58
after the TECH DHCP Client does not get responses from the DHCP server, no retransmissions are applied, DHCP Renew state will be entered again after (lease time/2)
as per attached ‘DHCP_Renew_NOK_DHCP_Rebind_OK.pcapng’ capture:
...
( T1 renewal time is respected )
19 2021-06-28 18:24:35 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
20 2021-06-28 18:24:35 192.168.1.1 192.168.1.175 DHCP 387 DHCP ACK - Transaction ID 0x1d4caa47
21 2021-06-28 18:25:25 192.168.1.101 192.168.1.1 DHCP 403 DHCP Request - Transaction ID 0x26d428c1
22 2021-06-28 18:25:25 192.168.1.1 192.168.1.101 DHCP 400 DHCP ACK - Transaction ID 0x26d428c1
23 2021-06-28 18:25:29 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
24 2021-06-28 18:25:29 192.168.1.1 192.168.1.175 DHCP 387 DHCP ACK - Transaction ID 0x1d4caa47
25 2021-06-28 18:26:20 192.168.1.101 192.168.1.1 DHCP 403 DHCP Request - Transaction ID 0x26d428c1
26 2021-06-28 18:26:20 192.168.1.1 192.168.1.101 DHCP 400 DHCP ACK - Transaction ID 0x26d428c1
27 2021-06-28 18:26:24 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
28 2021-06-28 18:26:24 192.168.1.1 192.168.1.175 DHCP 387 DHCP ACK - Transaction ID 0x1d4caa47
( DHCP server is stopped )
29 2021-06-28 18:27:14 192.168.1.101 192.168.1.1 DHCP 403 DHCP Request - Transaction ID 0x26d428c1
30 2021-06-28 18:27:14 192.168.1.1 192.168.1.101 ICMP 431 Destination unreachable (Port unreachable)
31 2021-06-28 18:27:21 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
32 2021-06-28 18:27:21 192.168.1.1 192.168.1.175 ICMP 404 Destination unreachable (Port unreachable)
33 2021-06-28 18:27:25 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
34 2021-06-28 18:27:25 192.168.1.1 192.168.1.175 ICMP 404 Destination unreachable (Port unreachable)
35 2021-06-28 18:27:32 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
38 2021-06-28 18:27:44 192.168.1.1 192.168.1.175 ICMP 404 Destination unreachable (Port unreachable)
39 2021-06-28 18:28:01 192.168.1.175 192.168.1.1 DHCP 376 DHCP Request - Transaction ID 0x1d4caa47
40 2021-06-28 18:28:01 192.168.1.1 192.168.1.175 ICMP 404 Destination unreachable (Port unreachable)
...
( no DHCP packets with IP 192.168.1.101 anymore, the DHCP server on the CPE was started again in the mean time )
...
161 2021-06-28 19:19:13 192.168.1.101 192.168.1.1 DHCP 403 DHCP Request - Transaction ID 0x26d428c1
162 2021-06-28 19:19:13 192.168.1.1 192.168.1.101 DHCP 400 DHCP ACK - Transaction ID 0x26d428c1
...
The DHCPv4 server on the CPE has defined: 'option leasetime '2h'' and 'list dhcp_option_force 'option:T1,60''
On the extender:
7320 root 11824 S odhcpc -p /var/run/odhcpc-br-lan.pid -s /lib/netifd/dhcp.script -f -t 0 -i br-lan -r 192.168.1.1 --dhcp_b
traces: ‘Enhanced_loglevel.txt’
=> extra tracing was enabled on the odhcpd daemon, the resulting traces on the extender after the DHCP server has been stopped, are:
Tue Jun 29 11:54:14 2021 daemon.notice netifd: lan (4118): Switching to renewing
No retransmission attempts are applied after that.
odhcpd has no DHCPv4 client functionality; it only supports DHCPv4/DHCPv6 server functionality.
DHCPv4 client in OpenWrt is supported by the busybox udhcpc applet
Zip_info.zip
Setup
CPE (DHCPv4 server, dnsmasq) ==Ethernet== Extender (odhcpd DHCPv4 Client)
Initial DHCP exchange
Error condition
Extra information
Appendix A
The DHCPv4 server on the CPE has defined: 'option leasetime '2h'' and 'list dhcp_option_force 'option:T1,60''
On the extender: 7320 root 11824 S odhcpc -p /var/run/odhcpc-br-lan.pid -s /lib/netifd/dhcp.script -f -t 0 -i br-lan -r 192.168.1.1 --dhcp_b
Appendix B: extra odhcpd traces