Princeton DHCP Bug



  • Hi, I've got an Android device on my client's network right now experiencing the "Princeton Bug" (for lack of a better term - the bug where devices keep using an IP without renewing it). There's a small enough load right now that I don't know - but do you know if in 2.1 there are any protections to help mitigate this widespread bug? Ideally, I'm thinking the DHCP server should check ARP on the network and make sure an IP isn't being used before issuing it.

    To help mitigate the effect of this, I've changed my IP lease time from 2 hours to 12 hours. This should greatly increase the odds that an Android device will request a new lease before it expires.



  • From the dhcpd.conf man page:

    The  DHCP  server  checks IP addresses to see if they are in use before allocating them to clients.  It does this  by  sending  an  ICMP  Echo request  message  to  the IP address being allocated. If no ICMP Echo reply is received within a second, the address is assumed to  be  free. This  is  only done for leases that have been specified in range statements, and only when the lease is thought by the DHCP server to be free.

    Unless the IP address is one statically specified for a different host, you should be fine.



  • Nope, it's the bug Princeton saw where Android devices hang on to IP addresses without renewing the lease if they're asleep when the lease expires. Thanks so much :)



  • Ah! I see. The device goes to sleep and won't respond to the IP conflict detection ICMP. Not sure how the DHCP server could get around that problem? Other than using nearly infinite lease time. ARP table entries expire, so I'm not sure checking those would help.



  • I think pinging is all that's needed. When it's asleep it's still online and talking, but doesn't renew it's lease. Affects all version of Android prior to 4.2 but it's the first time I've ever NOTICED a device doing it.



  • 'Pigning' is ICMP. If it was responding to ICMP when asleep then the existing conflict avoidance already built-in to dhcpd would work. My phone is Android 4.2, so I can try it. Furthermore I have it set to disconnect when sleeping.



  • @jcyr:

    'Pigning' is ICMP. If it was responding to ICMP when asleep then the existing conflict avoidance already built-in to dhcpd would work. My phone is Android 4.2, so I can try it. Furthermore I have it set to disconnect when sleeping.

    That's what I mean, I didn't know the DHCP server had that conflict avoidance, it should be fine :) As for your phone, one - it doesn't affect Android 4.2, and two - it doesn't affect phones that disconnect when sleeping :)

    Here's details on the bug: http://www.net.princeton.edu/android/android-stops-renewing-lease-keeps-using-IP-address-11236.html

    I noticed it personally the first time two nights ago, a device in DHCP leases "online and expired"


Log in to reply