Rate limiting in hardware¶
Rate limiting is one of the most basic DDoS mitigation techniques. Doing it purely in software is hard, though: individual traffic meters usually have to be synchronized across many CPU cores, which slows processing down.
Some NICs can offload meters into hardware. All traffic then passes through a single point in the NIC, which rate-limits it there, and CPU synchronization is no longer needed.
Our first goal was to determine how a single RTE Flow rule with an egress meter affects throughput. The meter was configured so that it never drops, meaning all traffic was always green. Input traffic consisted of 83 B TCP SYN packets with random source IPs and ports, on Zen 4 and Zen 5 servers running 16 queues.
| NIC | No meters | One egress meter | Change |
|---|---|---|---|
| ConnectX-6 | 121 Mpps | 102 Mpps | −16 % |
| ConnectX-7 | 189 Mpps | 182 Mpps | −4 % |
| BlueField-3 | 190 Mpps | 188 Mpps | −1 % |
Even a single meter in the hardware pipeline limits the NIC's performance, most noticeably on ConnectX-6. We will add more measurements soon...