# XDP kernel-level filtering

Drop banned and blocklisted traffic at the NIC driver layer: per-node switches, automatic fallback and licensing.

XDP fast filtering drops banned IPs and blocklisted traffic at the NIC driver layer (XDP), before the kernel network stack, reducing the cost that floods of malicious connections impose on a node. Open Node Management › XDP Fast Filtering. This is a licensed add-on; see [Licenses and add-ons](https://www-sa2.kuxitong.com/en/guide/license) for license status.


## Requirements
- The node's NIC and driver support XDP, and the kernel is 5.10 or later. Otherwise the node stays in Standard mode and the page shows the reason.
- Filtering covers website ports only: TCP 80 / 443 and UDP 443. The allowlist, the master address, SSH and admin ports, and health-probe points are let through first and never dropped.

## Two modes
Each node shows its current mode and the reason:

| Mode | Meaning |
|---|---|
| Fast mode | Banned and blocklisted traffic is dropped at the NIC driver layer |
| Standard mode | The system firewall blocks it; bans and lists stay the same, but filtering does not happen at the NIC driver layer |

Available actions: Enable Fast mode, Switch to Standard mode, Pause, Resume and Switch to manual resume.

## Measured performance
| Test condition | Standard mode | Fast mode |
|---|---|---|
| 4 vCPU, 60,000 pps from blocked sources | Network interrupt CPU 1.0% | 0.4% |
| 4 vCPU, 120,000 pps from blocked sources | Network interrupt CPU 12.3% | 5.5%; meanwhile legitimate requests 9,438→11,381 per second, p99 5.29→3.60 ms, success rate 100% |
| 4 vCPU, 1.17 million pps from blocked sources | Network interrupt CPU 65% | 15%, with over 99% of packets dropped at the driver layer |
| 2 vCPU, single queue | Busiest core 93–97% at about 230,000–260,000 pps received | 520,000 pps received, busiest core about 90 percent |

Recommendation: turn on Fast mode when blocked sources send more than 60,000 packets per second; below that the two modes differ little.

Data comes from bare-VM stress tests (virtio NIC).

## Pause and automatic fallback
- **Pause**: all nodes temporarily run in Standard mode, with no gap in protection. A pause can resume automatically after a number of hours, or you can switch to manual resume, in which case you must click Resume yourself.
- **Automatic fallback**: if something abnormal happens at runtime, the node falls back to Standard mode on its own and raises an alert, and sites keep serving normally. Re-enable it once the cause is fixed.

To switch it off on the node itself, run as root:

```
gocdn-agent xdp off
```

## License and upgrades
- After the license expires there is a buffer period: nodes already deployed when it began keep running, and other nodes are not deployed. When the buffer ends or the license is withdrawn, all nodes run in Standard mode and bans and lists keep working. Renewal restores it automatically.
- After a node program upgrade, the XDP component is deployed automatically; no separate installation is needed.

:::tip
XDP only handles traffic already decided to be blocked (bans and blocklists). Detecting attacks is still done by CC, WAF and Bot protection; see [CC protection](https://www-sa2.kuxitong.com/en/guide/cc) and [Lists and access control](https://www-sa2.kuxitong.com/en/guide/lists).
:::