DHCP INFORM coming from server rather than from client

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DHCP INFORM coming from server rather than from client

samyuktar
This post was updated on .
I am using an ENC28J60 with a CC1352p1 and LWIP to set up a networking stack.
I am trying to assign my device an IP address using the DHCP protocol. I'm
able to send a DHCP DISCOVER message from my device (client with MAC address
74:69:69:2d:30:31) to the DHCP server (which is running on my PC with MAC
address b0:0c:d1:4c:15:5f):

DHCP DISCOVER: DHCP Discover

<http://lwip.100.n7.nabble.com/file/t2316/Screen_Shot_2020-01-03_at_3.png

I then get a DHCP OFFER from the server: It has the SRC MAC address of my
computer, DST MAC of my device, and assigns an IP of 192.168.1.100 to my
device. I can confirm that the device actually sees the OFFER packet as I
can see the contents of the packet in the code when I debug.


<http://lwip.100.n7.nabble.com/file/t2316/Screen_Shot_2020-01-03_at_3.png

DHCP offer:



I can then see in Wireshark, a DHCP Inform. I assumed this meant that it was
requesting more information, but I thought DHCP Inform is supposed to come
from the client to server - in this case, from the device to my computer!
According to Wireshark though, the DHCP Inform is being broadcasted from the
server, i.e. my computer.

DHCP Inform :

Moreover, the inform packet lists b0:0c:d1:4c:15:5f as the client MAC address when in fact it is the server MAC address!

Any ideas what could be going wrong?



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP INFORM coming from server rather than from client

Jens Nielsen-2
It means your computer is also running a DHCP client, the DHCP Inform is
for client ip 192.168.1.11 which I assume is your computer?

So that request has nothing to do with your lwip device and there's
nothing wrong with this? Or what exactly is the problem?

And in general it's much easier to analyze if you attach the wireshark
capture instead of screenshots of the wireshark capture (or both if you
insist)

I also assume you solved the problem with your driver that truncates
your DHCP Requests? Would you care to reply on that thread?

Best regards
Jens

On 2020-01-04 00:30, samyuktar wrote:

> I am using an ENC28J60 with a CC1352p1 and LWIP to set up a networking stack.
> I am trying to assign my device an IP address using the DHCP protocol. I'm
> able to send a DHCP DISCOVER message from my device (client with MAC address
> 74:69:69:2d:30:31) to the DHCP server (which is running on my PC with MAC
> address b0:0c:d1:4c:15:5f):
>
> DHCP DISCOVER: DHCP Discover
> <http://lwip.100.n7.nabble.com/file/t2316/Screen_Shot_2020-01-03_at_3.png>
>
> I then get a DHCP OFFER from the server: It has the SRC MAC address of my
> computer, DST MAC of my device, and assigns an IP of 192.168.1.100 to my
> device. I can confirm that the device actually sees the OFFER packet as I
> can see the contents of the packet in the code when I debug.
>
> DHCP offer:
>
> <http://lwip.100.n7.nabble.com/file/t2316/Screen_Shot_2020-01-03_at_4.png>
>
> I can then see in Wireshark, a DHCP Inform. I assumed this meant that it was
> requesting more information, but I thought DHCP Inform is supposed to come
> from the client to server - in this case, from the device to my computer!
> According to Wireshark though, the DHCP Inform is being broadcasted from the
> server, i.e. my computer.
>
> DHCP Inform :
>
> <http://lwip.100.n7.nabble.com/file/t2316/Screen_Shot_2020-01-03_at_4.png>
>
>
> Any ideas what could be going wrong?
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP INFORM coming from server rather than from client

samyuktar
This post was updated on .
Hi Jens,

Thanks so much for your response!

DHCPDiscoverOfferInform.pcap
<http://lwip.100.n7.nabble.com/file/t2316/DHCPDiscoverOfferInform.pcap

I've attached the Wireshark capture illustrating what happens when I send a
DHCP Discover. I get the Offer, and then get an inform, but I don't get a
request from my device - I can go into ip_input() and see the DHCPOffer
packet of length 342 in that function, so I know it's being processed.

If the DHCP Inform that I'm seeing is completely independent of the DHCP
Discover/Offer, then the issue seems to be that the Offer is being ignored
by the client. Correct, 192.168.1.11 is my computer, and the Server on my
computer assigns with Offer assigns an IP of 192.168.1.100 to my client
which is the CC1352P1.

I fixed the issue with the malformed DHCP packet - it was an issue with the ethernet driver that I wrote, very low level and had to do with using a uint8_t instead of a larger integer to store the length of the packet so that it couldn't handle packets larger than 256 bytes. (Dumb, I know). Commented on that post!

--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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