> <LF>udp_send: ip_output_if (,,,,IP_PROTO_UDP,)ip_output_if: em0
> <LF>IP header:+-------------------------------+| 4 | 5 | 0x00 |
> 33 | (v, hl, tos, len)
> <LF>+-------------------------------+| 0 |000| 0 |
> (id, flags, offset)
> <LF>+-------------------------------+| 64 | 17 | 0x47b8 |
> (ttl, proto, chksum)
> <LF>+-------------------------------+| 133 | 38 | 20 | 150 |
> (src)
> <LF>+-------------------------------+| 133 | 38 | 20 | 50 |
> (dest)
> <LF>+-------------------------------+netif->output()
It looks like the packet is getting a good way through the stack - as
far as the netif->output() call, so it's done all the UDP and IP parts
without any problem. I'm not sure what this function pointer will be
set to in your project, but typically this will be something like
etherarp_output(). I would debug what is going on there. As lwIP is
also failing to respond to the ARP query, I suspect there might be a
problem with ARP. If not that, then you're into your driver.
Kieran
_______________________________________________
lwip-users mailing list
lwip-...@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users
Could it be the checksum error?
I check for netif->output, and as you say, it is set to
etherarp_output.
But I don't really understand why you say lwIP is failing to respond
to the ARP query. If you means lwIP can't respond to ARP request from
an another host on the net, you make a mistake. My application works
successfuly in tcp mode.
But as you say, I wonder if lwIP does manage correctly an ARP request
from the host itself. I add some trace on lwIP, which give :
######################### TRACE BEGIN ######################
Nevertheless, as the udp frame seem to be received by the target, I
don't think this is the problem for sending an udp frame from the
embedded lwIP to my linux station.
So I think you should investigate what happens to the packet once it
gets there.
> But I don't really understand why you say lwIP is failing to respond
> to the ARP query. If you means lwIP can't respond to ARP request from
> an another host on the net, you make a mistake. My application works
> successfuly in tcp mode.
I misunderstood: I thought the ARP was for the target from the PC, but I
see now that it looks like it is the target sending an ARP request for
its own address.
> But as you say, I wonder if lwIP does manage correctly an ARP request
> from the host itself. I add some trace on lwIP, which give :
[snip]
> Is this what it is expected ?
Not sure: I find it really hard to go through text output of packet
captures rather than being able to work through the capture in wireshark
itself. Could you attach a pcap file instead?
Subject: Re: [lwip-users] UDP packet sending problem
From: patrick Deflandre
I don't think the UDP checksum is invalid.
It maybe come from "Checksum offloading".
http://www.wireshark.org/docs/wsug_html_chunked/ChAdvChecksums.html
Looks fine.
> 2) The second set is for an udp echo test. udp_echo.pcap ,
> udp_echo.trace.txt
One thing I notice when comparing the two captures is that the second
has a lot of other ARP traffic in it. I wonder if that could be part of
the problem. I don't know why this features in the UDP capture and not
the TCP one.
As the trace file showed that the UDP reply is being sent by the stack
and getting as far as etharp_output() I think this has got to be where
things go wrong. The gratuitous ARP also points to an ARP problem too.
By adding some tracing to that function you should be able to quickly
see what's going on.
I'm not convinced: the TCP packets in your other capture show the
correct checksum, and you would expect them to have the wrong checksum
if checksum offloading was happening. On the other hand, the checksum
in the text debug trace of the UDP application is different to the one
in the UDP packet capture, and so something has filled it in correctly,
so maybe checksum offload is happening.
> None of the packet are compliant with the tftp protocol. This will
> surely make wireshark in trouble when checking an expected checksum...
No: the UDP checksum is independent of the next protocol layer, and so
won't care if the TFTP bit is correct or not.
> Defenitivily, it must not be the reason of my udp sending problem.
It is not your problem for sure, as lwIP receives the UDP packet, thinks
the checksum is correct, and sends a response. The response gets lots
somewhere in etharp_output() before making it onto the network though.
I notice that in the udp_echo.trace.txt there is the following:
<LF>find_entry: selecting empty entry 1
<LF>etharp_request: sending ARP request.etharp_raw: sending raw ARP
packet.etharp_query: queued packet 215bf0 on ARP entry 1
This is odd for two reasons: (i) it should already have an entry for the
PC's MAC address as it's updated that entry lots already from the other
ARP requests seen on the network earlier; and (ii) the packet it sends
is not an ARP request for the PC's MAC, but a gratuitous ARP of its own
MAC. I think there is definitely something going wrong here.
Do you have ARP_QUEUEING on?
Kieran
On Mon, 2009-06-29 at 15:16 +0200, patrick Deflandre wrote:One thing I notice when comparing the two captures is that the second
> 2) The second set is for an udp echo test. udp_echo.pcap ,
> udp_echo.trace.txt
has a lot of other ARP traffic in it. I wonder if that could be part of
the problem. I don't know why this features in the UDP capture and not
the TCP one.
As the trace file showed that the UDP reply is being sent by the stack
and getting as far as etharp_output() I think this has got to be where
things go wrong. The gratuitous ARP also points to an ARP problem too.
By adding some tracing to that function you should be able to quickly
see what's going on.
On Mon, 2009-06-29 at 15:41 +0200, patrick Deflandre wrote:
No: the UDP checksum is independent of the next protocol layer, and so
> None of the packet are compliant with the tftp protocol. This will
> surely make wireshark in trouble when checking an expected checksum...
won't care if the TFTP bit is correct or not.
I notice that in the udp_echo.trace.txt there is the following:
This is odd for two reasons: (i) it should already have an entry for the
<LF>find_entry: selecting empty entry 1
<LF>etharp_request: sending ARP request.etharp_raw: sending raw ARP
packet.etharp_query: queued packet 215bf0 on ARP entry 1
PC's MAC address as it's updated that entry lots already from the other
ARP requests seen on the network earlier; and (ii) the packet it sends
is not an ARP request for the PC's MAC, but a gratuitous ARP of its own
MAC. I think there is definitely something going wrong here.
Do you have ARP_QUEUEING on?
It is not your problem for sure, as lwIP receives the UDP packet, thinks
the checksum is correct, and sends a response. The response gets lots
somewhere in etharp_output() before making it onto the network though.
I notice that in the udp_echo.trace.txt there is the following:
This is odd for two reasons: (i) it should already have an entry for the
<LF>find_entry: selecting empty entry 1
<LF>etharp_request: sending ARP request.etharp_raw: sending raw ARP
packet.etharp_query: queued packet 215bf0 on ARP entry 1
PC's MAC address as it's updated that entry lots already from the other
ARP requests seen on the network earlier; and (ii) the packet it sends
is not an ARP request for the PC's MAC, but a gratuitous ARP of its own
MAC. I think there is definitely something going wrong here.