LwIP configuration recommendations

I am relatively new to FreeRTOS and LwIP. We began working with it just recently (before we used Keil environment). So I am looking for any advice (tips, considerations) what values to specify for all the “MBOX” sizes - particularly values of TCPIP_MBOX_SIZE, DEFAULT_RAW_RECVMBOX_SIZE, DEFAULT_UDP_RECVMBOX_SIZE, DEFAULT_TCP_RECVMBOX_SIZE, and DEFAULT_ACCEPTMBOX_SIZE. We will be using BSD (socket) API and we will be using mostly TCP connections, but some UDP as well. We may have up to 10 (absolutely worst case scenario) connections open at the same time. But the data rate will be relatively low (at most 1MB/sec).
Any advices will be really appreciated.
Thank you very much.

Not an answer to your question - but have you tried the lwIP mailing list? The lwIP experts there might be able to give better advice.

Thank you very much Richard,

I was thinking about posting the same question on LwIP mailing list and decided that LwIP is probably mostly used these days with FreeRTOS and FreeRTOS forum can reach much more people. And using LwIP with FreeRTOS has quite a bit of specific, particularly related to FreeRTOS memory handling. But I can post my question on LwIP mailing list just as well.

Thank you for the advice,

In that case, you might as well consider using FreeRTOS+TCP.

Here is the FreeRTOS+TCP main page.

There is also a tutorial.

You can see a list of drivers here. Some other drivers are not yet uploaded.

If you have any more questions, you can ask them in this forum thread.

The good thing about FreeRTOS+TCP is that it is built “on top of” the FreeRTOS kernel. It uses many of its features, like queue, semaphores, event groups and heap functions.

+TCP runs a separate task, the “IP-task”, which handles all API calls from the application.

What kind of platform (CPU) are you thinking of?

Thank you very much for answering.

We would be very interested in trying FreeRTOS+TCP. Unfortunately I couldn’t find any relatively new ports of FreeRTOS+TCP to the CPU platform we plan to use, which is Altera (Intel) NiosII. I did find a fully working port of FreeRTOS to NiosII with LwIP. Everything there has been working quite well, but in this hardware environment we have extremely limited amount of RAM (~ 200KB). And the port example we found required way much more RAM and most of it was used by LwIP. I was able to configure LwIP to use much less RAM but I am concern how appropriate my configuration changes were.

Both lwIP and FreeRTOS+TCP can be configured to use as much RAM as you like. I can help you with configuring the latter.

I pressed Reply too early, I wasn’t ready typing yet.

If you have a network driver for lwIP, it can be translated to FreeRTOS+TCP. That requires a bit of work though, depending on how much you want to optimise it.

You will find a skeleton of a driver here. It shows what functions are expected.

Thank you so much, I would really appreciate your help.
LwIP is quite widely used and it has been working quite well so far. Our main consideration would be minimum RAM usage (not code segment, where we don’t expect any limitations). So if LwIP optimized for minimum RAM usage (while satisfying our network requirements that I mentioned above) would use similar (or less) amount of RAM as FreeRTOS+TCP we would rather stick with LwIP (just because it already works).

@mplotkin : I would suggest starting with config values used in the port you mentioned and tuning them to the required performance level. lwip provides a tcp implementation of the iperf2 protocol, which is a very common open source network performance test utility.