[Top][All Lists]

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

Re: [lwip-users] Why so many pbufs required?

From: JM
Subject: Re: [lwip-users] Why so many pbufs required?
Date: Thu, 13 Aug 2009 06:28:04 -0700 (PDT)

This does answer a question in my mind about small vs. large buffers, which is better, just as you describe.  I was thinking pbufs are used only for incoming data, but this could depend on the netif driver (Stellaris), which was provided by the micro supplier.  Maybe I'll stick with small pbufs.

--- On Thu, 8/13/09, Chris Strahm <address@hidden> wrote:

From: Chris Strahm <address@hidden>
Subject: Re: [lwip-users] Why so many pbufs required?
To: address@hidden
Date: Thursday, August 13, 2009, 7:54 AM

I'll give you my experience and guesses.  Right now I am using 24 buffers of 256 bytes.
Basically you can take 2 approaches to the pool.  One is to have a large number of small buffers, and the other is to have a small number of large buffers.  The total bytes represented may be the same, but the way lwIP acts may be very different.  It's kind of a fine grain vs. coarse grain issue.
It is often found that packets get dropped with a small number of large buffers.  If you have memory to burn, then sure use a large number of large buffers.  But bare in mind that many packets only contain 60 bytes for ACKs, SYNs, FINs, etc.  But if all you have is big buffers, then you get a 1500 byte buffer consumed that's ony 5% utilized, 95% wasted.  And something coming in next may have to wait for a buffer or get dropped entirely.
The likely reason you have better results when you add delay in your system, is because buffers have time to get free, so you see less packets dropped.  But that indicates you have a buffer problem right there.
Since lwip can chain pbufs together, it's generally better to use a finer grain approach where the buffers are smaller and more of them.  It will still handle the larger packets with much the same efficiency, but you won't likely see packets getting dropped.
I've only been working with lwIP for a short time now, and others here have far more experience, but that is my take on things so far.

-----Inline Attachment Follows-----

lwip-users mailing list

reply via email to

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