lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Optimizing TCP writes


From: Jonathan Larmour
Subject: Re: [lwip-users] Optimizing TCP writes
Date: Thu, 06 Mar 2008 12:07:06 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Bill Auerbach wrote:
>> From: address@hidden
>> [mailto:address@hidden On Behalf
>> Of Jonathan Larmour
>>
>> Bill Auerbach wrote:
>>> Is there a way to call tcp_write and defer the output?  I know I have
>>> several small chunks of data going out and each is sent separately with
>>> tcp_write.  If I can get lwIP to build the outgoing segment list and
>>> send them all at once performance would improve a lot.
>> That's intrinsic to tcp_write. tcp_write only enqueues. It needs
>> tcp_output
>> to actually send anything (possibly called via tcp_output_nagle as you
>> notice below...)
> 
> Without using tcp_output_nagle, I still see the same behavior.  Each segment
> is in its own Ethernet frame.  I proved this by stopping at the low level
> output routine and seeing each packet is small with the small piece of data
> I used with tcp_write.
> 
> Is this normal or have I still done something wrong?

I believe tcp_output always outputs a segment. What tcp_output_nagle does
is choose times _not_ to - i.e. to wait a bit and save it up. You can see
if defined in include/lwip/tcp.h.

In other words, only call tcp_output when you do want to output something.
And arguably the same for tcp_output_nagle (although it won't guarantee you
will). Obviously you may need some care you don't keep enqueuing data and
never sending it, until you run out of buffers!

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
 **  Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv>  **
 **  April 15-17 2008, Booth 3012, San Jose McEnery Convention Center **
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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