lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Slow sending speed


From: Rejean Groleau
Subject: Re: [lwip-users] Slow sending speed
Date: Tue, 23 Dec 2008 10:57:20 -0800 (PST)

Hi Sebastian,

I had the same problem on my platform (a Luminary Stellaris microcontroller
with 64KB of RAM).
To speed things up (from a typical 200ms to a less-than-10ms delay), I had
to do the following:

1. Use a TCP_SND_BUF value four times greater than the TCP_MSS (according to
RFC 3390).
2. Always fill completely the TCP_SND_BUF (unless no more data is to be
sent).
3. Set a callback through tcp_poll() to attempt resending data (after an
arbitrary amount of time).
4. In my case (an HTTP server), use the HTTP 1.1 specification (to reuse
connections).

I did this according to RFC 3390 (available at
http://tools.ietf.org/html/rfc3390), which states:

If (MSS <= 1095 bytes)
    then win <= 4 * MSS;
If (1095 bytes < MSS < 2190 bytes)
    then win <= 4380;
If (2190 bytes <= MSS)
    then win <= 2 * MSS;

I interpreted (read between the lines) that when this "upper-bound" limit is
reached, an ACK is sent back.

Note that although my MSS is 1472 bytes, I still had to go under the first
condition
(4 * MSS instead or 4380 bytes). It seems the web browsers (or windows XP)
do not exactly follow this scheme.

Also, I did some small modifications to the contrib/apps/httpdserver
example to make it HTTP 1.1 compatible. As soon as I find the time to polish
it,
I'll try and publish it here, along with a few other contrib/apps examples
of my own,
such as a simple callback-based SMTP client
(with basic/login/digest-MD5 authentications support).

I hope this helped! Tell me if it works,

- Reggie


Sebastian-56 wrote:
> 
> Hello,
> 
> as the title already says, I've got a problem with the sending speed,
> which is 
> extremly slow. My  platform is a LPC2468 Controller from NXP with an ARM 
> Core.
> It seems the problem is that lwIP sometimes holds back packets and waits
> for 
> the next ACK of the packet just sent. According to a typical TCP session,
> the 
> remote station expects a second packet and waits for 200ms before it's
> sends 
> the ACK. After that, lwIP will send the next packets.
> 
-- 
View this message in context: 
http://www.nabble.com/Slow-sending-speed-tp21136522p21149534.html
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

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