lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Sending too slow.


From: Kieran Mansley
Subject: Re: [lwip-users] Sending too slow.
Date: Tue, 12 Sep 2006 11:51:33 +0100

On Tue, 2006-09-12 at 12:00 +0200, Mateusz Plocinski wrote:
> Hi,
> I'm sending a packet trace on Your private email because I didn't know if I 
> can send it on the mailing-list.
> Its dumped from ethereal.
> Sender (server): 62.21.58.112
> Receiver (client): 62.21.58.111
> I generate sent packets with a single test command:
> netconn_write(pxNetCon, NULL, 32000, NETCONN_NOCOPY );
> 
> As I said, the sender waits for ACK which comes every 200ms and I cant
> make it to send faster.

Two things of interest from the packet trace:
 - Your writes are being alternately sent as 1460 and 40 byte segments -
this is clearly inefficient, and suggests that the stream is being
segmented twice (first to 1500 bytes, then to 1460 and 40 bytes).
Perhaps this is due to an incorrect MTU setting.  I'm not sure.

 - Ethereal reports bad checksums on all the acknowledgements from the
WinXP machine, but to be honest ethereal often gets things wrong, and
from the response to the ACKs it doesn't seem that lwIP thought the
checksums were wrong, so that is probably not relevant.

Otherwise, I agree, it does seem like something is wrong.  I've no idea
what though.  As far as I know (others please correct me if you know
otherwise!) the section of code that deals with windows and sending
packets has been stable and unmodified for some time, so I would expect
someone else to have noticed this if it were more widespread.

Perhaps someone else can comment on your use of the lwIP API - I'm not
sure what is required here to ensure lwIP gets the processing time it
needs to send packets.  The code in question is tcp_output() in
core/tcp_out.c.  There is a loop in that function that begins:

  while (seg != NULL &&
  ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
#if TCP_CWND_DEBUG
    LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %lu, cwnd %lu, wnd
%lu, effwnd %lu, seq %lu, ack %lu, i%d\n",
                            pcb->snd_wnd, pcb->cwnd, wnd,
                            ntohl(seg->tcphdr->seqno) + seg->len -
                            pcb->lastack,
                            ntohl(seg->tcphdr->seqno), pcb->lastack,
i));
    ++i;
#endif /* TCP_CWND_DEBUG */

You might try enabling that print statement as it will give you all the
data that is used to make the "can I send another packet now" decision.

Kieran





reply via email to

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