Issues with DHCP (CM 12.1)

Post Reply
justice
Posts: 58
Joined: Thu Mar 07, 2013 5:58 am
languages_spoken: english
ODROIDs: Odroid U2, Odroid U3, Odroid XU Lite, ODroid C1
Has thanked: 0
Been thanked: 0
Contact:

Issues with DHCP (CM 12.1)

Post by justice »

Hello all,

I'm experiencing a fairly random DHCP problem running the latest CM 12.1 on the XU4 on some routers. It seems like when trying to renew the DHCP lease, sometimes the process seems to take too long and just times out and never attempts to renew it again.

It seems like whenever the issue occurs, the following lines print:
[ 03-31 16:40:38.795 3824: 3824 E/dhcpcd ]
timed out
[ 03-31 16:40:38.892 3233: 3823 D/NetUtils ]
dhcp_do_request failed : eth0 (new)
[ 03-31 16:40:38.892 3233: 3823 E/EthernetNetworkFactory ]
DHCP request error:Timed out waiting for DHCP to finish

After that, no additional logs regarding DHCP are ever printed. Any advice/suggestion on how to approach this or know if this is a known issue? Thanks.

User avatar
odroid
Site Admin
Posts: 42329
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3656 times
Been thanked: 2030 times
Contact:

Re: Issues with DHCP (CM 12.1)

Post by odroid »

Can you check the "ls /dev/eth*" & "lsusb" when you meet the issue?

justice
Posts: 58
Joined: Thu Mar 07, 2013 5:58 am
languages_spoken: english
ODROIDs: Odroid U2, Odroid U3, Odroid XU Lite, ODroid C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Issues with DHCP (CM 12.1)

Post by justice »

Hey odroid,

Sorry about the delay didn't have access to the device until now. Running "ls /dev/eth*" during the issue resulted in:

Code: Select all

/dev/eth*: No such file or directory
I look in the /dev directory and there weren't any subpaths for "eth" at all.

Running "lsusb" resulted in:

Code: Select all

Bus 001 Device 002: ID 0424:9514
Bus 003 Device 002: ID 046d:c52b
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 003 Device 001: ID 1d6b:0002
Bus 004 Device 001: ID 1d6b:0003
Bus 001 Device 003: ID 0424:ec00
Bus 001 Device 004: ID 0c40:8000
Another thing to note, running "ls /dev/eth*" or "lsusb" when the device is properly connected provides the same results. Let me know if you need anything else, Thanks!.

User avatar
odroid
Site Admin
Posts: 42329
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3656 times
Been thanked: 2030 times
Contact:

Re: Issues with DHCP (CM 12.1)

Post by odroid »

"0bda:8153" should be listed on the lsusb output.
"r8152" also should be listed on the lsmod output.

Can you try our official 4.4.4 image to narrow down the root causes?

justice
Posts: 58
Joined: Thu Mar 07, 2013 5:58 am
languages_spoken: english
ODROIDs: Odroid U2, Odroid U3, Odroid XU Lite, ODroid C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Issues with DHCP (CM 12.1)

Post by justice »

Hey odroid,

I was not able to get it to reproduce with the 4.4.4 image but I was able to emulate it by disable dhcp on the router the device was connected to. After waiting for the dhcpd to time out, if I reenable it on the router, the device won't reconnect. It seems like unplugging and replugging the ethernet cable or restarting the device is the only way to fix it afterwards. Let me know if you need any more information.

Justin

User avatar
voodik
Posts: 2664
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 115 times
Been thanked: 802 times
Contact:

Re: Issues with DHCP (CM 12.1)

Post by voodik »

I will check it.
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

User avatar
voodik
Posts: 2664
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 115 times
Been thanked: 802 times
Contact:

Re: Issues with DHCP (CM 12.1)

Post by voodik »

Dear justice,
I cant reproduce the issue, by disabling dhcp server or make server ureachable for odroid.
Did you make your test on latest release ?
Also i found in marshmallow dhcp timeout is set to infinity.
https://github.com/CyanogenMod/android_ ... 9eb31775f4

Can you check issue with our Marshmallow image ? If it solved i merge this commit to CM-12.1
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

justice
Posts: 58
Joined: Thu Mar 07, 2013 5:58 am
languages_spoken: english
ODROIDs: Odroid U2, Odroid U3, Odroid XU Lite, ODroid C1
Has thanked: 0
Been thanked: 0
Contact:

Re: Issues with DHCP (CM 12.1)

Post by justice »

Hey Voodik,

Thanks for looking into it. I just tried it with Marshmallow (CM-13.0 Alpha-0.5_23.04.16) and seem to encounter the same issue still. I flash the emmc using the selfinstall image (http://oph.mdrjr.net/voodik/5422/ODROID ... _24.12.15/) then updated it to the latest version using the ODroid updater. I disable the DHCP Server on the router the device is connected to (through ethernet). After about 30 seconds from when tries to establish the dhcp connection, it times out. Even if I re-enable the DHCP Server, it will never attempt to reconnect (although only tested waiting for about 2 hours) until the device is either rebooted or the ethernet cable is unplugged and plugged again.

I see the following logs related to dhcp:

12-31 16:00:31.545 3934-3934/system_process I/EthernetServiceImpl: Read stored IP configuration: IP assignment: DHCP Proxy settings: NONE
12-31 16:00:31.545 3934-3934/system_process I/EthernetService: Registering service ethernet
12-31 16:00:33.924 3934-4383/system_process I/EthernetNetworkFactory: dhcpThread(eth0): mNetworkInfo=[type: Ethernet[], state: UNKNOWN/IDLE, reason: (unspecified), extra: da:2a:9b:25:3e:d7, roaming: false, failover: false, isAvailable: true]
12-31 16:00:33.976 4385-4385/? I/dhcpcd: version 5.5.6 starting
12-31 16:00:34.100 4385-4385/? I/dhcpcd: eth0: rebinding lease of 192.168.1.105
12-31 16:00:39.103 4385-4385/? I/dhcpcd: eth0: broadcasting for a lease
12-31 16:01:04.149 3934-4383/system_process D/NetUtils: dhcp_start failed : eth0
12-31 16:01:04.149 3934-4383/system_process E/EthernetNetworkFactory: DHCP request error:Timed out waiting for DHCP to finish

On a side note:
We have multiple users in enterprise settings that have managed switches with Spanning Tree protocol enabled. For these users, the device never receives an IP address because the window during which the DHCP negotiation takes place happens after the ODROID device already polls for an IP address and then times out. For some of these users, the issue was resolved by them enabling "Portfast" which extends the window for DHCP negotiation. However, we would like to resolve this issue without requiring users to enable "Portfast" if possible.

I'm not sure I'm doing something wrong or overlooking something since it should never time out right? Let me know if you need anymore information or if there's anything else I could do. Thanks again!

User avatar
odroid
Site Admin
Posts: 42329
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3656 times
Been thanked: 2030 times
Contact:

Re: Issues with DHCP (CM 12.1)

Post by odroid »

Can you reproduce the issue with our official Android 4.4 ?
We need to find a reference platform for easier comparison.

chdh
Posts: 10
Joined: Fri Dec 30, 2016 2:16 pm
languages_spoken: english
ODROIDs: C2
Location: Winterthur, Switzerland
Has thanked: 0
Been thanked: 0
Contact:

Re: Issues with DHCP (CM 12.1)

Post by chdh »

I have the same problem with Android 6.0.1. The Ethernet connection is stuck if the DHCP server is unreachable for about 5 minutes or longer after the LAN cable is connected.

The timeout is in dhcp_utils.c, dhcp_start(), wait_for_property(result_prop_name, NULL, 30).
Here, the timeout is only 30 seconds. However, in my tests, the effect only shows up when there is no DHCP response for several minutes.
The following messages appear twice in the log about 3.5 minutes after booting:

Code: Select all

01-01 01:03:32.383  3224  3793 D NetUtils: dhcp_start failed : eth0
01-01 01:03:32.384  3224  3793 E EthernetNetworkFactory: DHCP request error:Timed out waiting for DHCP to finish
There appear to run two DHCP threads for eth0 in parallel in EthernetNetworkFactory.onRequestNetwork().

I was able to solve the problem by periodically calling unregisterNetworkCallback() + requestNetwork() when there is no connection.
Or by executing the OS commands "ifconfig eth0 down" + "ifconfig eth0 up".

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 1 guest