lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] TCP Checksum errors.


From: address@hidden
Subject: Re: [lwip-users] TCP Checksum errors.
Date: Mon, 22 Sep 2008 18:30:15 +0200
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Nick Thomas wrote:
Hi, I am using the netconn_X functions. In stepping through
inet_chksum_pseudo() routine I notice that checksum errors are observed when
there is more than one pbuf in the chain.
Did you use the netconn API for UDP also?
inet_chksum_pseudo() is used both for rx and tx, at which point did you step inside? From what you said, it's not clear whether you see checksum errors on packets sent by lwIP or received by it!
I never seem to get more than 2
pbufs in a chain.
That depends on the amount of data passed to netconn_write and the speed of the ACKs returning from the remote side.
But, anyway, when the chain only has one pbuf then the
checksum appears to be calculated OK (at least wireshark doesn't complain
about it.).
What most people do wrong when seeing this error is in the netif driver (in netif->linkoutput, I think), they only copy the first pbuf in a chain, instead of copying ever p and p->next and stop at the last pbuf of a packet (which has p->len == p->tot_len; NOT p->next == NULL). If you have a DMA enabled MAC, it could be that you pass p->payload and p->tot_len of the first pbuf in the chain to the DMA hardware. You should check whether the data sent by lwIP (as seen in debugger or as expected to send) matches the data received in wireshark (except for the checksum, of course). That way you can see whether it is a data-copy-problem or really a checksum-problem.


Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]