Feb 24, 2018
Linux UDP Buffers

Increasing UDP processing bandwidth

The default buffer sizes in Linux are woefully small for any services that make heavy use of UDP. The default RX buffer limit is set to 208kB.

CUWB Networks running with a reasonable quantity of nodes (30 or more) or that are running at high position rates (100Hz or greater) may experience loss of data due to these default UDP buffer limit. Data loss can be hard to notice, but usually has the effect of more jitter in computed position or anchors dropping out in the CUWB Viewer.

When installing the latest versions of CUWB Network (3.0.0 and greater) the user is prompted with a chance to set the default UDP buffers to a more reasonable figure (100MB). If you choose not to increase the buffers during installation, you can always reconsider this decision by running: sudo dpkg-reconfigure cuwb-network

Changing the UDP buffer limit can significant impact on system performance. We recommend setting this regardless of the size or speed of your setup.

Docker

If you are running in a docker container you will find that docker does not allow you to set this setting because it inherits the values from the host system. If the host system is linux, the following will help you setup the host appropriately.

To make the change on a running system, run the following command then restart the CUWB Network: sudo sysctl -w net.core.rmem_max=104857600 This change will go away upon system reboot.

To make the changes permanent, edit the file /etc/sysctl.conf. Add the following line to the end of the file: net.core.rmem_max=104857600 This change will only take place upon reboot.

This article is an updated version of a forum post. The original can be found here