GNOME Bugzilla – Bug 733801
NetworkManager takes 5 seconds minimum to connect using DHCP (waiting ARP request)
Last modified: 2014-09-19 18:57:15 UTC
Created attachment 281795 [details] Network dump When connecting to my network, the connection time is 5 seconds minimum. Which could be reduced I believe. It seems that dhcpcd is waiting for an ARP request, and the ARP request times out. Here is the system log: juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): carrier now ON (device state 20) juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40] juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Auto-activating connection 'DHCP'. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) starting connection 'DHCP' juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: disconnected -> prepare (reason 'none') [30 40 0] juil. 26 23:38:08 moiraine NetworkManager[428]: <info> NetworkManager state is now CONNECTING juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 1 of 5 (Device Prepare) scheduled... juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 1 of 5 (Device Prepare) started... juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 2 of 5 (Device Configure) scheduled... juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 1 of 5 (Device Prepare) complete. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 2 of 5 (Device Configure) starting... juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: prepare -> config (reason 'none') [40 50 0] juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 2 of 5 (Device Configure) successful. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 3 of 5 (IP Configure Start) scheduled. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 2 of 5 (Device Configure) complete. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 3 of 5 (IP Configure Start) started... juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: config -> ip-config (reason 'none') [50 70 0] juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Beginning DHCPv4 transaction (timeout in 45 seconds) juil. 26 23:38:08 moiraine NetworkManager[428]: <info> dhcpcd started with pid 20306 juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Beginning IP6 addrconf. juil. 26 23:38:08 moiraine avahi-daemon[432]: Withdrawing address record for fe80::290:f5ff:feea:5546 on enp4s0f2. juil. 26 23:38:08 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 3 of 5 (IP Configure Start) complete. juil. 26 23:38:08 moiraine dhcpcd[20306]: version 6.4.0 starting juil. 26 23:38:08 moiraine dhcpcd[20306]: DUID 00:01:00:01:1a:c6:fa:c0:0c:d2:92:89:08:64 juil. 26 23:38:08 moiraine NetworkManager[428]: <info> (enp4s0f2): DHCPv4 state changed nbi -> preinit juil. 26 23:38:08 moiraine dhcpcd[20306]: enp4s0f2: IAID f5:ea:55:46 juil. 26 23:38:08 moiraine dhcpcd[20306]: enp4s0f2: soliciting an IPv6 router juil. 26 23:38:08 moiraine kernel: r8169 0000:04:00.2 enp4s0f2: link up juil. 26 23:38:08 moiraine dhcpcd[20306]: enp4s0f2: rebinding lease of 192.168.15.102 juil. 26 23:38:10 moiraine avahi-daemon[432]: Registering new address record for fe80::290:f5ff:feea:5546 on enp4s0f2.*. juil. 26 23:38:13 moiraine dhcpcd[20306]: enp4s0f2: leased 192.168.15.102 for 86400 seconds juil. 26 23:38:13 moiraine avahi-daemon[432]: Joining mDNS multicast group on interface enp4s0f2.IPv4 with address 192.168.15.102. juil. 26 23:38:13 moiraine avahi-daemon[432]: New relevant interface enp4s0f2.IPv4 for mDNS. juil. 26 23:38:13 moiraine dhcpcd[20306]: enp4s0f2: adding route to 192.168.15.0/24 juil. 26 23:38:13 moiraine avahi-daemon[432]: Registering new address record for 192.168.15.102 on enp4s0f2.IPv4. juil. 26 23:38:13 moiraine NetworkManager[428]: <info> (enp4s0f2): DHCPv4 state changed preinit -> reboot juil. 26 23:38:13 moiraine NetworkManager[428]: <info> address 192.168.15.102 juil. 26 23:38:13 moiraine NetworkManager[428]: <info> prefix 24 (255.255.255.0) juil. 26 23:38:13 moiraine NetworkManager[428]: <info> gateway 192.168.15.1 juil. 26 23:38:13 moiraine NetworkManager[428]: <info> nameserver '192.168.15.1' juil. 26 23:38:13 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 5 of 5 (IPv4 Configure Commit) scheduled... juil. 26 23:38:13 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 5 of 5 (IPv4 Commit) started... juil. 26 23:38:14 moiraine dhcpcd[20306]: enp4s0f2: removing route to 192.168.15.0/24 juil. 26 23:38:14 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: ip-config -> secondaries (reason 'none') [70 90 0] juil. 26 23:38:14 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) Stage 5 of 5 (IPv4 Commit) complete. juil. 26 23:38:14 moiraine NetworkManager[428]: <info> (enp4s0f2): device state change: secondaries -> activated (reason 'none') [90 100 0] juil. 26 23:38:15 moiraine NetworkManager[428]: <info> NetworkManager state is now CONNECTED_GLOBAL juil. 26 23:38:15 moiraine NetworkManager[428]: <info> Policy set 'DHCP' (enp4s0f2) as default for IPv4 routing and DNS. juil. 26 23:38:15 moiraine NetworkManager[428]: <info> Writing DNS information to /usr/bin/resolvconf juil. 26 23:38:15 moiraine geoclue[30272]: (geoclue:30272): Geoclue-WARNING **: Failed to query location: Error resolving 'location.services.mozilla.com': Name or service not known juil. 26 23:38:15 moiraine NetworkManager[428]: <info> Activation (enp4s0f2) successful, device activated. Attached, the network dump (up to the first mdns packet, signaling the interface is up)
Looks like NM should pass --noarp to dhcpcd. [ http://www.daemon-systems.org/man/dhcpcd.8.html ] -A, --noarp Don't request or claim the address by ARP. This also disables IPv4LL. NetworkManager does not pass an explicit --config option, so dhcpcd should honor /etc/dhcpcd.conf . I cannot test this, but does it fix the problem if you configure "noarp" there?
(In reply to comment #1) > Looks like NM should pass --noarp to dhcpcd. What's the purpose of using ARP in this case and why it doesn't work in some networks? > This also disables IPv4LL. Sounds ok, as NetworkManager handles IPv4LL separately.
I tested on the same network with noarp, and it solves the issue. Thank you for the tip. I think nevertheless that it should be included by default by NetworkManager.
I think --noarp is the right way to go here.
Created attachment 282101 [details] [review] dhcpcd: pass noarp option to dhcpcd https://bugzilla.gnome.org/show_bug.cgi?id=733801 Signed-off-by: Thomas Haller <thaller@redhat.com>
Comment on attachment 282101 [details] [review] dhcpcd: pass noarp option to dhcpcd looks good but note that the existing code used tabs to indent the comments, so yours doesn't quite line up
Works for me and looks good so I pushed it to master, 0.9.10, and 0.9.8 after fixing up the comment.