1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

DHCP client on PIC Micro

Discussion in 'Embedded' started by AbsoluteSoftware, Jan 6, 2005.

  1. 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
    AbsoluteSoftware, Jan 6, 2005
    1. Advertisements

  2. The minumum length of the DHCP data is 548 bytes per the RFC.

    Paul Bosselaers
    Paul J. Bosselaers, Jan 6, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.