I found this using the ESP32 arduino setup, but I think it will apply to the ESP IDF as well so I posted it here.
The issue is how large UDP packets are being handled. When a UDP packet is bigger than the MTU (around 1.4k) it is supposed to be broken into fragments, sent over the net, and reassembled on the receiving end. It is still lossy, that is if any of the fragments are lost, the whole packet is lost.
So for example a 2000 byte packet would get broken into 2 IP fragments and if both fragments didn't make it to the receiving end, you would get nothing.
Now I understand that packet fragmentation is DISABLED in the lwip configuration for ESP32, nothing really wrong with that but the way lwip is handling large UDP packets in this mode seems bad.
What it seems to be doing is breaking the one large packet into several smaller ones and sending them as independent UDP packets.
This can be bad because, for example, if you send a 2000 byte UDP packet it will get broken into two pieces, but if one piece is lost the other will still be delivered, leaving you with less than 2000 bytes of data on the receiving end and an odd amount of missing data.
It seems like what should happen is that if IP fragmentation is disabled and you try to send a UDP packet bigger than the MTU, you should get an error and/or the packet should not be sent. But that's not what's happening.
Can anyone comment on this? Should it be considered a bug and fixed?
I didn't notice what was going on right away because the UDP messages were going to a black-box data logger that was just taking the UDP messages assuming each one was complete and writing it to a file. A dropped packet wouldn't be a problem because you would lose the COMPLETE message. But the way lwip handles things, you could lose part of a message which corrupts the log.
UDP packet fragmentation problem
-
- Posts: 35
- Joined: Sun May 20, 2018 9:16 pm
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Gaston1980 and 85 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.