DHCP client on PIC Micro

From: AbsoluteSoftware (googlenews_at_smartsw.co.uk)
Date: 01/06/05


Date: 6 Jan 2005 02:13:46 -0800

Hello.

I am embedded programmer working on a project implementing Ethernet
functionality. The hardware is a PIC18F6620 and the TCP/IP stack was
based on Jeremy Benthams TCP/IP Lean. The TCP/IP stack acquires its IP
address through DHCP but I am having problems with some DCHP servers.

In its raw state Jeremy Benthams code worked with the first server we
tried it with but not the second. The second router sent a 'bad DHCP
packet error'. After looking through all the DHCP specification such
as RFC 2131 and RFC 2132 I could find no problem with the
implementation - it was extremely bare bones as you would expect with
a TCP/IP stack running on a PIC micro, but seemed to adhere to the
specification. I compared the DHCP discover packet with the one sent
out on my windows machine and could find no real difference, the
windows machine had many more options, but according to the
specification they are just that, options. The only other difference
was packet size, the windows packet was longer and padded with zero's
at the end. I padded my DHCP packets out with zero's to make them the
same size as the packets from the windows machine and this solved the
problem. Now I have a problem with yet another DHCP server, this time
it is a D-link DSL-G604T wireless router. This just simply ignores the
discover packets as though they didn't exist, no error message (I am
using ethereal to spy on the network traffic). I have had another check
through the documentation about DHCP but have found no leads. One
possibility was the fact that my client sets the broadcast flag and
does not cope with a unicast response, however changing this flag made
no difference.

I would appreciate any help or pointers possible. Is there some
application or implementation guide for DHCP, for example where is the
requirement for minimum packet length stated? Has any one implemented a
DHCP client before and is aware of any pitfalls to watch out for and
what this problem might be? Does anyone know of any other forums on
which I could post this message?

Ben Thomas



Relevant Pages

  • Re: DHCP serving more than one subnet (longish)
    ... >>destination address is all ones (which means it is a broadcast packet). ... > Responses from the server however rely on the ethernet address only since ... DHCP works over media other than ethernet. ... the case if the request is relayed through a router]. ...
    (comp.os.vms)
  • Re: Regarding dhcp client problem
    ... I have captured the packet information from the device. ... win2k dhcp server sends ... But the dhcp client in the device is not receiving the offer at ... User Datagram Protocol, Src Port: bootpc, Dst Port: bootps ...
    (comp.arch.embedded)
  • Re: DHCP serving more than one subnet (longish)
    ... > packets to allow a host's ethernet layer to pass the packet onto the TCPIP stack. ... DHCP packets are formatted the same as any other IP packet. ... > address nor that of a DHCP server. ...
    (comp.os.vms)
  • RE: CodeRed Observations.
    ... the rule that is being triggered by my IDS sensor ... When I get a real packet I will mail it out. ... than that means that Windows' TCP/IP *STACK* is really broken. ... TCP/IP stack on the machine receiving ...
    (Incidents)
  • Re: DHCP serving more than one subnet (longish)
    ... > DHCP packets are formatted the same as any other IP packet. ... > destination address is all ones (which means it is a broadcast packet). ... of a relay server if the giaddr field is not null. ... > and DHCP requests can certainly be relayed via a router. ...
    (comp.os.vms)