lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp receive queue size at socket layer...


From: Jonathan Larmour
Subject: Re: [lwip-users] tcp receive queue size at socket layer...
Date: Wed, 01 Nov 2006 14:44:06 +0000
User-agent: Thunderbird 1.5.0.7 (X11/20060913)

Frédéric BERNON wrote:
Hi group,

In my device, I use lwip 1.1.1 (updated with last CVS release) with
several sockets. One of them is a TCP socket sending large packets. This
socket exchange datas with its peer, using a protocol like "server send
a packet, client send a packet, server send a packet, etc...". The
server (lwip) doesn't really need the client's packets. So I only do "n"
recv()- in one time - after "n" send() - to reduce potential recv()
delays. But it seems that I "block" the stack if "n" is too big : no
ping answer, even other udp tasks don't reply to my requests, etc...

Can you confirm me that one socket which don't do any recv() - but
packets are send to this socket - can "consume" all internals
packets/memory/resources and so, can block other sockets (or do a deny
of service like with ICMP)?

All the resources (packet/memory) can be configured, so one solution is just to increase them as needed, but ultimately there is a finite amount of everything and you may be memory-constrained.

If it's true (and with what I know about
lwip, I'm sure at 90% it's true), is there any feature or patch (with
socket layer) to give a limit to socket receive queue size (to drop
input packets when this queue is "full")?

You could reduce TCP_WND. That sets the maximum amount of space advertised to the remote end, per socket. Obviously that can affect performance, but it's an obvious way to stop each one eating up too many resources.

With Microsoft winsock, it's possible to give a limit to recv queue size
with SO_RCVBUF option. Is anyone already implement something like that?

lwip doesn't implement that. I don't believe there's anything that presently allows the queue size to be set dynamically at run-time for each socket. It wouldn't be hard to add though, but probably isn't important enough to take space in the standard stack distribution.

Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
------["The best things in life aren't things."]------      Opinions==mine





reply via email to

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