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.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 19 guests