|
From: | address@hidden |
Subject: | Re: [lwip-users] How to limit the UDP Rx packet size to avoid big RAM allocations |
Date: | Tue, 19 Jun 2018 20:38:41 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 19.06.2018 18:11, Sergio R. Caprile wrote:
UDP datagrams are carried by Ethernet frames. It is not lwIP but your driver who allocates memory to hold those frames before handling them to lwIP, which in turn will deliver to your application. The only way to stop allocation is there. Someone could also send pings of death, repeated SYNs... If you need firewall functionality, you need to build a firewall.
Well, the OP was not really asking about a firewall but about DoS protection. And he's correct in that to prevent DoS, a device must be able to keep up receiving at full wire speed, wether the packets are short or long.
But you are right here that throwing packets away in the driver as early as possible is the best way to achieve this on a resource constrained target. Of course, this makes the driver depend on the application in some kind of way, but I wouldn't consider it bad design if it was clearly separated from the driver.
You're also right that lwIP can't really help here :-) Simon
[Prev in Thread] | Current Thread | [Next in Thread] |