zero config in absence of DHCP server

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

zero config in absence of DHCP server

1,830件の閲覧回数
EdProulx
Contributor I

The DHCP client on my freescale system (MCF52258 based) works fine to obtain an IP address via the DHCP protocol. I'm using a linksys BESFR41 router for this purpose. When the router is not connected, the DHCP on my board simply times out and reverts to some hardcoded default IP. It was 0.0.0.0 but I now hard-code it to something else.

 

I wish to use "zero conf networking" protocol (as per RFC 3927) when DHCP times out. There is no such implementation in the freescale OS, and I have not seen it anywhere else on this forum. My application does not need access to the internet, but it does need an IP to operate correctly. Whether the IP is from DHCP or zero-conf does not matter.

 

So my question: does anyone have a zero conf functionality that I can port to my system?

 

Thanks.

 

Ed

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

942件の閲覧回数
scifi
Senior Contributor I
There is such functionality in lwip. However, I don't know how easy it would be to port it to your application...
0 件の賞賛
返信

942件の閲覧回数
EdProulx
Contributor I

It appears that I will implement zeroConf myself. It is not a complex protocol, in fact very simple:

 

- choose a pseudo-random class B IP address  (169.254.xxx.yyy based on the device's MAC)

- send an arp request for that IP

- if no response: the device claims the IP as its own

- if there is an arp response, then repeat the arp request for the next IP

 

It's a simple protocol, a simple implementation, but does get a bit complicated as you adhere to timers and retries and what-not, as per the protocol (RFC3927).

0 件の賞賛
返信