All,
Tried to find the code, logged in and can see the source code but cannot find any suitable ‘network’ or ‘dhcp’ files :-((.
Anyway - I went to the associated forum and see that there are a number of complaints about DHCP being flakey over the years…
So - I re-captured my DHCP from a power-down reboot.
Although I reported the DHCP DECLINE coming from the client - this is only after the initial failure.
The first DISCOVER results in an OFFER from my server.
This is followed by a REQUEST from the client, then a NAK from my server. I think I now know why !!!
My server is possibly implementing part of the DHCP protocol which may be being ignored by others :-O.
the RFC (2131 - although I have not yet checked any subsequent updates!) specifically states :
The DHCPREQUEST message contains the same xid as the DHCPOFFER
message.
Well in the case of the EMX board this is NOT the case. It is bumping the transaction ID between the OFFER and the REQUEST (see the following from an MS Network Monitor V3.4 capure) :
102 10:34:52 17/05/2013 10.1929378 0.0.0.0 255.255.255.255 DHCP DHCP:Request, MsgType = DISCOVER, TransactionID = 0xABCD0002 {DHCP:29, UDP:68, IPv4:67}
110 10:34:53 17/05/2013 11.1933372 192.168.1.1 255.255.255.255 DHCP DHCP:Reply, MsgType = OFFER, TransactionID = 0xABCD0002 {DHCP:29, UDP:68, IPv4:67}
111 10:34:53 17/05/2013 11.1946106 0.0.0.0 255.255.255.255 DHCP DHCP:Request, MsgType = REQUEST, TransactionID = 0xABCD0003 {DHCP:30, UDP:68, IPv4:67}
112 10:34:53 17/05/2013 11.1950930 192.168.1.1 255.255.255.255 DHCP DHCP:Reply, MsgType = NAK, TransactionID = 0xABCD0003 {DHCP:30, UDP:68, IPv4:67}
NB I skipped frames 103 - 109 as not being part of this conversation.
Clearly the request is coming with a new transaction ID - so the router is strictly correct in Nacking it !!
NB I did a similar trial using an Olimex Pic32 board (using the Microcgip stack) and it worked perfectly - the transaction ID’s all remained the same though…
So - not quite sure how to get this fixed, but as I will need to deploy my EMX box(es) into the field - clearly I will have little control over the routers they will be connecting with :-((. So - I need a version of the code which works with all (well as many as it can) routers :-)). Any code ‘released into the wild’ MUST be able to cope with numerous DHCP servers - or it becomes a liability and will generate numerous support issues upon deployment :-((. DHCP is fundamental to establishing an IP Address :-O.
Summary: strictly speaking this is an issue with the NetMF implementation of DHCP (IMHO), but one which admittedly many routers seem able to ignore - as they probably simply rely on the client MAC address. There are questions about WHY DHCP uses Transaction ID’s as well as client MAC address - but they are WAY beyond the scope of this forum :-)).
Hope this feedback helps, and that someone knows who/how to get this fixed please ???. NB I saw the same issues in the NetDuino forum and will probably find them elsewhere if I were to look ;-)) - some also did specifically mention the DLink DIR-655 :-O.
Many Thanks
Best Regards
Graham