My
TCP/IP and lwIP expertise are limited. Please help me
understand the situation by correcting my assumptions:
-
The Ethernet driver has a fixed, limited number of DMA
slots, so it already limits the amount of data at that
level.
-
An Ethernet frame is normally limited to 1500 bytes (or a
little more). However, an UDP packet can be up to roughly
64 KiB long.
-
In the case of large UDP (or even TCP) packets, lwIP is
merging several Ethernet frames (IP fragmentation) into a
large buffer (or a pbuffer chain). Therefore, it is
"allocating" a bigger logical chunk. In the process of
doing so, it could check whether some maximum reassembly
packet size has been reached, and then discard the whole
packet. Depending on the allocation strategy, that would
significantly drop the temporary memory requirements.
- If I turn off IP_REASSEMBLY, would it help here? I guess
the maximum size of UDP (or even TCP) packets would then be
limited by the largest possible Ethernet frame. Would
turning off IP_REASSEMBLY break other things, or severely
impact performance, at least on IPv4?