Fix UDP drops due to NAT timeouts and state table limits on specific routers. #97
Replies: 1 comment 3 replies
|
Thanks for sharing this, @wangjushi930531-arch. These are very useful findings. Could you also share some details about your test environment? That would help with reproducing the behavior:
Could you confirm whether you tested both modes available in the official ESPectre traffic generator script: broadcast mode and specific target device list mode? One important note regarding the code you posted: the TCP connections do not appear to be persistent yet. At the moment, the loop performs socket() → connect() → close() on every iteration, which is closer to repeated short-lived TCP probes than to a persistent connection. It would be helpful if you could open a PR (a draft is fine) so we can collaborate on this and move toward a design that:
If we move toward TCP transport, we will likely need coordinated changes on the device side as well to support TCP end-to-end, along with corresponding updates to configuration, documentation, and tests. As an additional experiment, it might also be worth testing ICMP-based traffic generation (e.g., periodic pings to the device). Some routers treat ICMP differently from UDP, which might avoid part of the router-specific filtering behavior. Another option could be to let users choose the traffic mode (UDP, TCP, or ICMP), or implement a fallback mechanism when the observed performance does not match the requested PPS. |
Uh oh!
There was an error while loading. Please reload this page.
Issue: The native UDP mode suffers from severe throughput degradation (dropping to 5–10 pps) in specific router environments due to NAT timeouts and firewall restrictions.
Modification: Refactored the underlying logic of traffic_generator.py to implement support for persistent TCP connections.
Result: Throughput has recovered to a stable range of 90–130 pps, with significantly enhanced transmission stability.
Note: Due to the lack of extensive compatibility testing across diverse router brands, this code has not been committed to the main repository. It is provided solely as an architectural reference to address low-throughput bottlenecks.
All reactions