[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Strategy Question for DHCP

From: Zach Smith
Subject: Re: [lwip-users] Strategy Question for DHCP
Date: Wed, 27 May 2015 19:17:37 +0000

Sounds like you are almost there. Since you are getting the auto assigned link local address I assume you are calling autoip_start() and autoip_tmr() at the appropriate interval (AUTOIP_TMR_INTERVAL msces).


I’m not sure why you are not able to ping the address. Wireshark should show your device query for the address once the dhcp time-out hits. Then I think once it has taken the address you should see a gratuitous ARP for that address. When you start pinging from the PC Wireshark should show an ARP query first (Who has 169.254.x.x?) then the ping request. Is the device answering the ARP query from the PC? The PC must be on the same subnet of course.


So, you are not using the standard auto ip net (AUTOIP_NET         0xA9FE0000)? If you are changing that, maybe there is something else you didn’t quite get changed right?


Maybe attaching your Wireshark capture would help.


From: lwip-users-bounces+address@hidden [mailto:lwip-users-bounces+address@hidden On Behalf Of Robert Deschambault
Sent: Wednesday, May 27, 2015 11:58 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Strategy Question for DHCP




I have tried to use the approach with no success so far.  I needed to tweak the IP address pool to be compatible with our network.  I hope that isn't a problem.  In lwipopts.h I have:


// AUTOIP options

#define LWIP_AUTOIP             1




and the DHCP tries is set to 6 in our application.  I can see our target board waiting for DHCP and then falling over to a valid address for our pool.  But I can't ping that address.  Wireshark shows the request for the local link address, but not much more than that.  Am I missing something?





On Thu, May 14, 2015 at 2:55 PM, Zach Smith <address@hidden> wrote:

Use the auto ip feature of lwip which I believe is the proper way to handle this situation. With this feature enabled, after a certain number of dhcp timeouts the device will fail over to an “auto ip” address. The auto ip address is an address the device chooses for itself in the range 169.254.x.x. It will perform a quick check to see if any other device out there has the address. If so, it chooses another one and checks again. Upon finding a free address it self-configures with that address. dhcp discover messages continue to go out at some defined interval and if a dhcp server ever responds then the assigned address overwrites the previously assigned auto ip address.


Check out autoip.c (it does all this for you) and the following defines:


#define LWIP_AUTOIP                                              1  

#define LWIP_DHCP_AUTOIP_COOP                  1 //defines auto ip to work with dhcp

#define LWIP_DHCP_AUTOIP_COOP_TRIES    6 // controls how many dhcp discovers to try before timing out to an auto ip address

#define LWIP_AUTOIP_CREATE_SEED_ADDR     //lets you control the first auto ip address the device will try




Bob Deschambault

Confidentiality Notice: This e-mail may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive from the recipient), please contact the sender by reply e-mail and delete all copies of the message.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]