Join our Newsletter — 33% off our NHI Course
Home› Guides› SYN Flood Attacks: How They Work and How…
Guide Network Security

SYN Flood Attacks: How They Work and How to Mitigate Them

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 15 min read
On this page

A SYN flood keeps a server so busy holding half-open TCP connections that real clients cannot connect, even when bandwidth and CPU look fine. It remains a routine part of multi-vector DDoS attacks because every TCP listener has a finite queue for unfinished handshakes. This guide explains the mechanics for network and platform engineers, then sets out layered defences: SYN cookies and backlog tuning on the host, SYN proxies on firewalls and load balancers, and upstream scrubbing and remotely triggered blackholing when the flood exceeds what you can absorb. It finishes with the detection signals and metrics that tell you a flood is under way and that your mitigations are working. For the wider DDoS programme (scrubbing contracts, CDN, DNS resilience and the response runbook) see the DDoS Protection Guide; this page goes deeper on the TCP layer only.

Key takeaways

  • The target is state, not bandwidth. Each unanswered SYN occupies an entry in the listener's SYN backlog until it times out; fill the backlog and new legitimate connections are refused on that port.
  • SYN cookies are the host's safety net. On Linux, net.ipv4.tcp_syncookies=1 (the kernel default) sends stateless cookies only when the backlog overflows, at the cost of some TCP options during the attack.
  • Tuning buys headroom, not immunity. Raising tcp_max_syn_backlog and somaxconn and lowering tcp_synack_retries helps, but RFC 4987 notes an attacker simply sends proportionally more SYNs.
  • Volumetric floods must be stopped upstream. Once a flood saturates your links, only your provider's scrubbing service, RTBH or Flowspec can help, so those contracts and triggers must be in place before the attack.
  • Measure the queue, not just the pipe. SYN-RECV counts, listen overflows, cookies sent and the SYN to ACK ratio reveal a flood earlier and more precisely than link utilisation.

How a TCP handshake is abused

A normal TCP connection opens with three packets: the client sends SYN, the server replies SYN-ACK, the client completes with ACK. Between the second and third packets the server holds a record of the pending connection. RFC 4987 (an Informational RFC from the IETF, published August 2007) describes this record as a Transmission Control Block (TCB) created when a SYN arrives on a port in the LISTEN state, with the connection sitting in the SYN-RECEIVED state. The number of these half-open connections a listener will hold is bounded by its backlog.

A SYN flood sends SYNs whose source addresses are spoofed or belong to hosts that never answer. The server sends SYN-ACKs that are never acknowledged, retransmits them, and keeps each entry until the timer expires. If the attacker sends SYNs faster than the entries expire, the backlog stays full and legitimate SYNs are dropped. RFC 4987 stresses two points that drive the defence design:

  • Per-port effect: the attack exhausts the queue of a specific listening port, so a host can look healthy while one service is unreachable.
  • Low cost to the attacker: the volume needed depends on the backlog size and the time an entry lives, not on the victim's bandwidth. On Linux the default tcp_synack_retries of 5 gives a final passive timeout of about 63 seconds, per the kernel documentation, so every bogus SYN can hold state for about a minute.

Spoofing has a side effect: the SYN-ACKs go to the forged addresses, so innocent third parties receive unsolicited traffic. BCP 38 (RFC 2827) uses exactly this SYN flood example to argue for ingress filtering of spoofed source addresses.

In MITRE ATT&CK the host-level effect maps to T1499.001 OS Exhaustion Flood under T1499 Endpoint Denial of Service, and a flood large enough to saturate links maps to T1498.001 Direct Network Flood under T1498 Network Denial of Service. See the MITRE ATT&CK T1499 Endpoint Denial of Service and the MITRE ATT&CK T1498 Network Denial of Service pages.

Variants

Defenders see several forms in practice. Knowing which one you face decides whether host tuning, a SYN proxy or upstream filtering is the right lever.

VariantWhat the target experiencesMain pressure pointMost effective layer
Spoofed direct SYN floodMany SYNs from random or forged sources, almost no final ACKsListener SYN backlog, firewall state tableSYN cookies, SYN proxy, upstream scrubbing; ingress filtering at source networks
Botnet SYN flood (real sources)SYNs from real, routable hosts; some may complete the handshakeBacklog plus accept queue and application connection limitsPer-source rate limits, SYN proxy, scrubbing with reputation and behavioural filtering
High-rate volumetric SYN floodLinks or provider edge saturated, packet rate rather than bit rate is the problemRouter and firewall packets per second, uplink capacityProvider scrubbing, RTBH or Flowspec; host defences cannot help once the pipe is full
SYN-ACK or ACK floodUnsolicited SYN-ACK or ACK packets that match no connectionStateful firewalls and connection tracking lookupsStateless filtering upstream, drop out-of-state packets early
SYN-ACK reflectionThird-party servers send SYN-ACKs to you because the attacker spoofed your address in SYNs to themInbound bandwidth and state on your edge devicesUpstream filtering of unsolicited SYN-ACKs; your own networks should never be the reflector target source
Spread or "carpet" floodsLower rates spread across many addresses in a prefix, each below per-host thresholdsAggregate edge capacity; per-IP thresholds miss itPrefix-level detection and scrubbing

Most real attacks are multi-vector: a SYN flood alongside UDP reflection or HTTP floods. Treat SYN handling as one layer of the plan in the DDoS Response Playbook, not the whole response.

Detection signals

A SYN flood shows up first in TCP state and kernel counters, often before link graphs move. Collect these continuously so you have a baseline; a spike is only meaningful against normal values for the same hour and day.

SignalWhere to read itWhat a flood looks like
Half-open connectionsLinux ss -n state syn-recv count per listening port; load balancer half-open or embryonic connection countersCount jumps from tens to thousands and stays at the backlog limit
Kernel flood warningKernel log message "TCP: Possible SYN flooding on port", followed by the listening address and port and the action taken (for example "Sending cookies")Appears at the start of the attack (rate limited) and names the affected address and port
Cookie and overflow countersnstat or /proc/net/netstat: TcpExtSyncookiesSent, TcpExtSyncookiesRecv, TcpExtSyncookiesFailed, TcpExtListenOverflows, TcpExtListenDropsSyncookiesSent climbs steeply while SyncookiesRecv stays low (few clients complete); ListenOverflows rises if the accept queue fills
SYN to ACK ratioFlow telemetry (NetFlow, IPFIX, sFlow) or packet counters with TCP flag breakdown at the edgeInbound SYNs far exceed completed handshakes towards a single destination and port
Source distributionFlow records grouped by source address and TTLVery large number of unique sources each sending few packets, or odd TTL patterns suggesting spoofing
Firewall state tableFirewall connection table utilisation and new sessions per secondTable near capacity, session setup rate many times normal
Service symptomsSynthetic checks and client-side connect times from outside your networkTCP connect timeouts while the server CPU and application look idle

The Linux kernel documentation adds a useful warning: if SYN flood messages appear under legitimate load, the listener is misconfigured, not attacked. For flow collection design see the NetFlow and IPFIX Flow Telemetry Guide.

Mitigations: host

Host and load balancer defences protect against floods that reach the server without saturating the link. RFC 4987 surveys the options and is candid about their limits.

TechniqueHow it helpsTrade-off stated in RFC 4987 or kernel docs
SYN cookiesNo state is kept for the SYN; the connection details are encoded in the SYN-ACK sequence number and checked when the ACK arrivesHard to encode TCP options: MSS limited to a few values, window scaling and SACK restricted unless timestamps carry the extra state; data on the SYN is not kept. The kernel calls cookies a fallback that violates TCP norms
SYN cacheKeeps a small partial entry in a keyed hash table with per-bucket limits; full state only after the handshakeBounded memory and CPU; RFC 4987 cites about a 15% rise in legitimate connection time under attack in Lemon's tests
Larger backlogMore room for half-open entries before overflowNeeds efficient data structures; scaling problems were seen in older stacks
Shorter SYN-RECEIVED timerEntries expire fasterSlow legitimate clients may fail; attacker compensates by sending more SYNs
Hybrid cache plus cookiesCache under normal load, cookies when the cache is fullThe approach most modern stacks take

On Linux the relevant settings, as described in the kernel's ip-sysctl documentation, are:

  • net.ipv4.tcp_syncookies: default 1, which sends cookies only when a listener's SYN backlog overflows. Value 2 sends cookies unconditionally and the documentation suggests it only for testing the effect of cookies. Leave it at 1 in production and confirm no build or hardening baseline has set it to 0.
  • net.ipv4.tcp_max_syn_backlog: the per-listener maximum of remembered connection requests in SYN_RECV not yet acknowledged by the client. The minimum is 128 on low-memory machines and it scales with memory; raise it on internet-facing servers that see overload.
  • net.core.somaxconn: the cap on the listen() backlog, default 4096 (128 before Linux 5.4). The application's own backlog argument must also be raised, or the kernel limit is never used.
  • net.ipv4.tcp_synack_retries: default 5, giving about 63 seconds before a passive half-open connection is abandoned. Reducing it to 2 or 3 frees entries sooner; test with slow and mobile clients first.
  • net.ipv4.tcp_abort_on_overflow: default off. The documentation advises enabling it only if the listener genuinely cannot be tuned to accept faster, because it resets clients during bursts.

A SYN proxy moves the handshake in front of the server. On Linux, netfilter's synproxy answers the handshake with SYN cookies and only passes connections that complete it to the backend. The nftables documentation lists the prerequisites: tcp_syncookies=1, tcp_timestamps=1 and nf_conntrack_tcp_loose=0, untracked SYNs via a raw-priority rule, and MSS and window scale values that match the backend server. Firewalls and load balancers offer the same idea under names such as SYN proxy, TCP intercept or SYN protection; RFC 4987 notes this shifts the load to that device, so size its connection setup rate and state table for attack volumes. See the Load Balancer Security Guide.

Mitigations: network and upstream

When the flood carries more packets per second than your edge routers, firewalls or links can handle, nothing on the host matters. Defences must sit in networks with more capacity than the attacker.

LayerWhat it doesWhen to use itWatch out for
Edge ACLs and rate limitsDrop SYNs to ports you do not serve; cap SYN rate per destination on edge routersAlways; cheap and statelessRate limits drop good and bad SYNs alike once triggered
Cloud or provider scrubbing (always-on or on-demand)Traffic is diverted by BGP or DNS through a scrubbing centre that validates handshakes and forwards clean trafficFloods larger than your links; services that must stay upOn-demand diversion takes minutes; test it, and keep origin IPs private so attackers cannot bypass it
CDN or reverse proxyTerminates TCP at the edge so floods hit the provider, not your originHTTP and HTTPS servicesNon-web ports and exposed origin addresses stay vulnerable
Destination RTBHYour provider discards all traffic to the attacked addressTo protect the rest of your network when one address is drowningCompletes the attack for that address; use as a last resort and for the shortest time
BGP FlowspecDistributes match and action rules (for example TCP SYN to destination X, port 443, rate limit) to upstream routersPrecise filtering of a known signature without blackholingBad rules cause self-inflicted outages; validate and expire them
Source address validationDrops packets with spoofed sources at the network edge, per BCP 38Your own networks, so they cannot originate spoofed floodsProtects the internet more than it protects you; still a good citizen control

RTBH and Flowspec mechanics, guard rails and trigger security are covered in the RTBH and BGP Flowspec DDoS Mitigation Guide, and anti-spoofing in the Source Address Validation and Anti-Spoofing Guide.

Choosing the right layer

  • Small organisation, single site: keep host defaults (cookies on), put public services behind a CDN or provider with built-in DDoS protection, and agree an emergency RTBH contact with your ISP.
  • Mid-size, several public services: add SYN proxy on the edge firewall or load balancer, flow telemetry with SYN ratio alerts, and an on-demand scrubbing contract tested at least yearly.
  • Large or availability-critical (finance, gaming, public sector): always-on scrubbing for critical prefixes, Flowspec with pre-approved templates, and automated detection that triggers diversion within minutes.

Rolling out and testing SYN flood defences

  1. Inventory listeners: list every internet-facing IP and TCP port, which device terminates the handshake (server, load balancer, CDN), and which ports need not be exposed. Close the latter.
  2. Baseline: collect half-open counts, cookie counters and SYN rates per service for at least two weeks to set thresholds.
  3. Host hardening: confirm tcp_syncookies=1, raise tcp_max_syn_backlog, somaxconn and application backlogs on one pilot server pool, and reduce tcp_synack_retries cautiously. Monitor client connect times for a week before wider rollout. Roll back by restoring the previous sysctl file and reloading.
  4. Edge SYN proxy: enable in monitor or alert-only mode where the platform supports it, then enforce on one virtual service, checking MSS, window scaling and timestamp behaviour against backends.
  5. Upstream: agree scrubbing diversion procedures, RTBH communities and Flowspec acceptance with providers; document who can trigger each and how to withdraw.
  6. Test: run an authorised DDoS simulation through a provider that coordinates with your ISP and scrubbing service. Never generate test floods across third-party networks without written agreement.
  7. Review: after every test or real event, record time to detect, time to mitigate and any legitimate traffic lost, and adjust thresholds.

Metrics and framework mapping

  • Time to detect: minutes from flood start to alert, from flow or counter data.
  • Time to mitigate: minutes from alert to effective filtering (cookies, proxy, diversion or Flowspec).
  • Handshake completion rate during attack: share of legitimate connections completing, measured by external synthetic checks.
  • Coverage: percentage of internet-facing services behind a SYN proxy, CDN or scrubbing path.
  • Test frequency: date of last successful diversion and RTBH test per provider.
FrameworkReferenceRelevance
NIST SP 800-53 Rev 5SC-5 Denial-of-service Protection; SC-7 Boundary Protection; SI-4 System Monitoring; CP-8 Telecommunications ServicesProtection, edge filtering, detection and provider arrangements
NIST CSF 2.0PR.IR-04 Adequate resource capacity; PR.IR-03 Resilience mechanisms; DE.CM-01 Network monitoring; RS.MI-01 Incidents are containedCapacity, resilience, detection and containment
ISO/IEC 27001:2022 Annex AA.8.6 Capacity management; A.8.16 Monitoring activities; A.8.20 Networks securityCapacity planning, monitoring and network controls
MITRE ATT&CKT1499.001 OS Exhaustion Flood; T1498.001 Direct Network Flood; T1498.002 Reflection AmplificationHost-level, link-level and reflection variants
MITRE D3FENDD3-ITF Inbound Traffic Filtering; D3-NTA Network Traffic AnalysisFiltering and detection countermeasures

Common failure patterns

  • Cookies disabled by a hardening baseline: an old template sets tcp_syncookies=0 and the first flood empties the backlog. Audit sysctl values in configuration management.
  • Kernel backlog raised, application backlog not: the server's listen() call still passes a small value, so somaxconn changes have no effect.
  • Origin addresses exposed: services sit behind a CDN or scrubbing service, but DNS history or a forgotten record reveals the origin, and the flood goes straight to it.
  • Stateful firewall as the bottleneck: the state table fills before the servers notice. Put stateless filtering or a SYN proxy ahead of it, or size it for attack rates.
  • Untested diversion: the scrubbing contract exists but no one has run the BGP or DNS change, and the first attempt during an attack takes hours.
  • Alerting on bandwidth only: a moderate-rate SYN flood exhausts a port without moving link graphs; nobody alerts on half-open counts.

Practitioner checklist

  • Confirm net.ipv4.tcp_syncookies=1 on every internet-facing Linux host and equivalent SYN protection on load balancers and firewalls.
  • Raise tcp_max_syn_backlog, somaxconn and application listen backlogs on public services, after a pilot.
  • Test a reduced tcp_synack_retries value against slow and mobile clients before adopting it.
  • Enable SYN proxy or TCP intercept on the edge device that terminates public TCP, with MSS and window scale matched to backends.
  • Alert on half-open counts, SyncookiesSent, ListenOverflows and inbound SYN to ACK ratio per service.
  • Keep origin addresses private and restrict origin access to the CDN or scrubbing provider ranges.
  • Agree and test scrubbing diversion, RTBH and Flowspec procedures with each upstream provider at least yearly.
  • Apply source address validation on your own networks so they cannot originate spoofed traffic.
  • Record time to detect and time to mitigate after every test and real event.

Standards and references

Related NHI Mgmt Group resources: DDoS Protection Guide · DDoS Response Playbook · RTBH and BGP Flowspec DDoS Mitigation Guide · DDoS Readiness Checklist

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.