lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How to limit the UDP Rx packet size to avoid big RAM al


From: R. Diez
Subject: Re: [lwip-users] How to limit the UDP Rx packet size to avoid big RAM allocations
Date: Wed, 27 Jun 2018 13:31:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0


It does. Input pbufs are PBUF_POOL pbufs which consume a constant memory size.

I'm no expert, but that sounds wrong. If the remote computer decides to send very small chunks, lwIP is going to waste memory fast. That's no good on embedded systems.

Anyway, I am using these at the moment:

#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1

So I guess what you say does not hold, at least in this scenario.


The problem I see is: how do you know the reassembled size in advance?

Do you not get an offset within each fragment? If the offset is too big, you know that the final packet size is over the limit, so you can discard at least those fragments quickly. And any other fragment under that offset too that you have already received.

Regards,
  rdiez



reply via email to

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