TCP SYN Drop
The tcp_syn_drop filter mitigates TCP SYN floods in scrubbing mode by
requiring clients to retransmit SYN packets with acceptable timing. It drops the
first SYN of each connection attempt before it reaches the protected server. A
retransmission can pass only if its source and destination IP addresses, TCP
ports, and initial sequence number match those recorded from the first SYN, and
it arrives within the configured time window.
The filter supports IPv4 and IPv6. It does not generate SYN-ACKs or require the server’s return traffic to traverse the scrubber, so it can be used with direct server return.
Syntax🔗
tcp_syn_drop [min_delay=<milliseconds>] [max_delay=<milliseconds>] retry_count=<count> [block_timeout=<milliseconds>];
| Parameter | Default | Meaning |
|---|---|---|
min_delay |
500 |
Minimum delay between the recorded SYN and its next acceptable retransmission, in milliseconds. |
max_delay |
3000 |
Maximum delay for the first retransmission, in milliseconds. The maximum doubles after each accepted retransmission. |
retry_count |
Required | Number of timing-valid retransmitted SYNs that may pass during one validation cycle. Must be greater than zero. The initial dropped SYN does not count. |
block_timeout |
0 |
Blocking duration, in milliseconds, after the retry_count allowance is exhausted. Zero means the tuple remains blocked until LRU eviction. |
Evaluation mode🔗
In evaluation mode, packets that would be dropped are allowed through, including the initial SYN. SYN-drop state and decision counters are still updated, but clients may complete handshakes without retransmitting. Use evaluation mode to observe decisions.
Monitoring🔗
| Counter | Meaning |
|---|---|
xfw_syn_drop_blocked_packets |
SYNs rejected for timing violations, retry exhaustion, or an existing block. |
xfw_syn_drop_blocked_bytes |
Bytes corresponding to those blocked SYNs. |
xfw_syn_drop_passed_packets |
Retransmitted SYNs that pass this filter’s validation. Later filters can still drop them. |
xfw_syn_drop_passed_bytes |
Bytes corresponding to those validated SYNs. |
These counters are updated independently of incident logging. The deliberately
dropped initial SYN is excluded from both blocked and passed counters, as is
the first SYN starting a new cycle after a finite block. A flood consisting
entirely of unique first SYNs can therefore be filtered without increasing
xfw_syn_drop_blocked_packets. Consult the general xfw_syn_packets counter and
ingress statistics as well.