Changing UDP packet fragmenting (lwip) configuration in Arduino

Greg Corson
Posts: 35
Joined: Sun May 20, 2018 9:16 pm

Changing UDP packet fragmenting (lwip) configuration in Arduino

Postby Greg Corson » Tue May 21, 2019 5:28 pm

I found that the build of the Arduino platform seems to have UDP packet fragmentation support turned off for send and receive.

How do I go about turning packet fragmentation support on? Is there an API call or does the whole Arduino-ESP32 package have to be recompiled?

Without fragmentation support if the ESP32 sends a packet larger than the MTU size (1440 usually) instead of being fragmented it is just broken into pieces and sent as separate UDP packets. This can be bad because these pieces can individually be lost or reordered causing delivery of a partial or scrambled message. With fragmentation support, you either get the whole packet (in the right order) or nothing.

vult-r
Posts: 1
Joined: Thu Oct 22, 2020 11:56 am

Re: Changing UDP packet fragmenting (lwip) configuration in Arduino

Postby vult-r » Thu Oct 22, 2020 12:02 pm

Yep , this issue is causing troubles for me too. The small MTU (approx 1460) is becoming a pain when working with binary buffers as camera frames, files etc.

TCP is not always an option as it is blocking the main loop , or running into bufferissues with async too.

I rather have the full UDP packet lost , then scrambled all the time. Now i need to double-buffer everything and manage it with some sort of number/ack system, costing too much resource for the usage. In most situation i rather send and forget about the data.

ESP32 is doing everything and more , but this one keeps being a bummer, pleae can there be any support for the TX buffer size?

Who is online

Users browsing this forum: No registered users and 46 guests