[lwip-users] autoip usage

203 views
Skip to first unread message

vincent cui

unread,
Dec 5, 2011, 7:00:50 AM12/5/11
to Mailing list for lwIP users

Hi:

 

I am gonna to enable AUTOIP when DHCP detection fail after trying some times.

If enable AUTOIP in this case, do I need disable DHCP ?

By the way , could enable AUTOIP be used in this case of cable is plugged out ?

 

 

Vincent Cui
Sr. Firmware Engineer
Mobile: +8613255150315
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: vince...@enlogic.com
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233

 

 

Simon Goldschmidt

unread,
Dec 5, 2011, 7:34:13 AM12/5/11
to Mailing list for lwIP users
vincent cui <vince...@enlogic.com> wrote:
> I am gonna to enable AUTOIP when DHCP detection fail after trying some
> times.

LWIP_DHCP_AUTOIP_COOP does this for you. When LWIP_DHCP_AUTOIP_COOP==1, LWIP_DHCP==1 and LWIP_AUTOIP==1, autoIP is started when DHCP does not get an address after ~30-40 seconds. DHCP is still continued in the background then (with increased retry-delays), so if you plug in a DHCP server later, it will switch back to DHCP. Also this sequence is restarted when the link status goes back to 'up'.

Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

_______________________________________________
lwip-users mailing list
lwip-...@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

vincent cui

unread,
Dec 5, 2011, 8:09:32 AM12/5/11
to Mailing list for lwIP users
Simon:

In my code,,, I check the failure of DHCP getting valid address by trying to check the IP address allocated, if try times is great than the 20, the DHCP doesn't get a valid address.

You said that "autoIP is started when DHCP does not get an address after ~30-40 seconds",,, so I could start autoIP at once after DHCP cann't get a valid address... in this case.
LWIP_DHCP_AUTOIP_COOP still work ?

In actually, 30 ~40 seconds is too long to me ? could I modify it ?

Vincent Cui
Sr. Firmware Engineer
Mobile: +8613255150315
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: vince...@enlogic.com
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233
 

Simon Goldschmidt

unread,
Dec 5, 2011, 8:26:09 AM12/5/11
to Mailing list for lwIP users
vincent cui <vince...@enlogic.com> wrote:
> so I could start autoIP at once after DHCP cann't get a
> valid address... in this case.
> LWIP_DHCP_AUTOIP_COOP still work ?

No, with LWIP_DHCP_AUTOIP_COOP enabled, you MUST NOT call autoip_start() yourself! Only the dhcp code may call this or else the AutoIP state machine might get out of sync.

> In actually, 30 ~40 seconds is too long to me ? could I modify it ?

Yes, just change the define LWIP_DHCP_AUTOIP_COOP_TRIES from its default value of 9. LWIP_DHCP_AUTOIP_COOP_TRIES is the number of DHCP-discover retries that have to fail before changing to AutoIP mode (which is why I don't remember the default time here - dhcp retries use an exponential backoff for the timeout...).

Simon
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone

vincent cui

unread,
Dec 5, 2011, 8:27:25 AM12/5/11
to Mailing list for lwIP users
Using LWIP_DHCP_AUTOIP_COOP, it still works when cable is unplugged into , right ?


Vincent Cui
Sr. Firmware Engineer
Mobile: +8613255150315
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: vince...@enlogic.com
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233
 


-----Original Message-----
From: lwip-users-bounces+vincent.cui=enlog...@nongnu.org [mailto:lwip-users-bounces+vincent.cui=enlog...@nongnu.org] On Behalf Of Simon Goldschmidt
Sent: 2011年12月5日 21:26
To: Mailing list for lwIP users
Subject: Re: [lwip-users] autoip usage

gold...@gmx.de

unread,
Dec 5, 2011, 1:20:28 PM12/5/11
to Mailing list for lwIP users
vincent cui wrote:
> Using LWIP_DHCP_AUTOIP_COOP, it still works when cable is unplugged into , right ?

I'm afraid I don't understand. What do you mean by 'it still works'?
What do you expect to work how?

Simon

vincent cui

unread,
Dec 6, 2011, 4:55:51 AM12/6/11
to Mailing list for lwIP users
Simon"

Thank you , it works now

Vincent Cui
Sr. Firmware Engineer
Mobile: +8613255150315
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: vince...@enlogic.com
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233
 

-----Original Message-----
From: lwip-users-bounces+vincent.cui=enlog...@nongnu.org [mailto:lwip-users-bounces+vincent.cui=enlog...@nongnu.org] On Behalf Of Simon Goldschmidt
Sent: 2011年12月5日 21:26
To: Mailing list for lwIP users
Subject: Re: [lwip-users] autoip usage

vincent cui

unread,
Jan 12, 2012, 5:24:04 AM1/12/12
to Mailing list for lwIP users
Simon:

After change to AUTOIP mode, it really get a AUTO IP address. But it cann't get IP address when I plug into a DHCP server ..

You said that DHCP is running background and will switch to DHCP mode again ...but it fails

Vincent Cui
Software Engineer Leader
Mobile: +8613255150315
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: vince...@enlogic.com
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233
 

-----Original Message-----
From: lwip-users-bounces+vincent.cui=enlog...@nongnu.org [mailto:lwip-users-bounces+vincent.cui=enlog...@nongnu.org] On Behalf Of Simon Goldschmidt
Sent: 2011年12月5日 21:26
To: Mailing list for lwIP users
Subject: Re: [lwip-users] autoip usage

Reply all
Reply to author
Forward
0 new messages