Skip to content

DDoS Attack Types: L3, L4 and L7 Differences and Defense

Author: Published: Updated: 6 min read

At which layers do DDoS attacks happen?

A DDoS (Distributed Denial of Service) attack tries to make a service unreachable with traffic from many sources. Classifying the attack correctly is the first step toward the right defense, because each class exhausts a different resource.

We classify with the OSI model. L3 is the network layer (IP), L4 the transport layer (TCP/UDP) and L7 the application layer (HTTP). The target is one of three things: bandwidth, tables that hold connection state, or the application's processing power.

The three attack classes

Volumetric attacks (L3/L4)

The goal is to fill the line. The attacker sends an enormous volume of packets, and legitimate traffic cannot get through because the target's internet connection is full. UDP floods and reflection/amplification belong here: the attacker spoofs the source IP as the target's address, an open DNS or NTP server answers a small request with a large reply, and the reply goes to the target.

Network providers can limit source spoofing by filtering at egress, a practice described in BCP 38 (RFC 2827). But that is a measure for the network the traffic leaves, not for the victim.

Protocol attacks (L4)

The goal is to exhaust the connection-state tables of the server or of devices in between. The classic one is the SYN flood. TCP connects through a three-step handshake: the client sends SYN, the server answers SYN-ACK, the client finishes with ACK. The moment the server sends SYN-ACK, it reserves memory for a half-open connection. The attacker sends many SYNs and never sends the final ACK; the half-open queue fills and new legitimate connections get refused.

Application-layer attacks (L7)

The goal is to wear the application down until it stops answering. Traffic volume can be small; each request is expensive.

  • HTTP flood: many GET or POST requests that look valid. They usually target paths that run database work, such as search, login or cart.
  • Slowloris-style attacks: the attacker holds connections open and sends headers or the body very slowly. The server waits on each one, tying up a worker or slot; the slots run out and new requests cannot get in. Volume stays low, so an alarm that watches bandwidth stays quiet.
  • Cache-busting requests: adding a random query parameter to every request defeats the cache and sends each request down to the origin.

Comparison table

ClassLayerExampleResource consumedTypical defense
VolumetricL3/L4UDP flood, DNS/NTP reflectionLine bandwidthUpstream (provider) filtering, distributed capacity
ProtocolL4SYN flood, ACK floodConnection tables, half-open queueSYN cookies, SYN rate limit, SYNPROXY, connection cap
ApplicationL7HTTP flood, slowloris, cache bustingCPU, database, connection slotsRate limits, timeouts, verification puzzle, WAF

SYN floods and SYN cookies

RFC 4987 describes the SYN flood and common mitigations. The classic one is SYN cookies: when a SYN arrives, the server allocates no memory for a half-open connection. Instead it derives a verifiable value from the connection details and embeds it in the initial sequence number of the SYN-ACK. If the client really answers, it returns that value in the ACK, and the server builds the connection at that moment. SYNs with spoofed sources get no reply, so they accumulate no state.

The cost: while using SYN cookies, the server cannot fully store some TCP options (window scaling, for example), so systems like Linux usually turn them on only once the queue is full. SYN cookies also do not protect against very fast completed handshakes from a single real source; that takes a per-IP rate limit.

How does a reverse proxy mitigate an attack?

In the reverse-proxy model, clients connect to the proxy, not to your server. That has three consequences:

  1. The surface shrinks. The proxy's web ports (80 and 443) are what the outside world sees. If you open ports 80 and 443 on your origin only to proxy addresses, an attacker cannot hit your server directly. For detail, see origin IP hiding and Origin Lock.
  2. The proxy absorbs connections. The proxy handles the TCP handshake, TLS and slow clients. A slowloris-style connection does not hold a slot on your origin.
  3. Requests get filtered before the origin. Rate limits, verification puzzles and WAF rules stop illegitimate requests in front of the origin.

Timing is part of the defense. The proxy should tighten when an attack starts and relax when it ends. When to turn on Under Attack mode explains when to make that switch by hand.

How Nexren Shield handles this

Verified facts only:

  • Kernel (L3/L4): XDP (eBPF) in generic mode drops packets of banned addresses on ports 80 and 443 before netfilter and connection tracking. An ipset DROP at raw/PREROUTING acts as a fallback.
  • Breakwave: it applies TCP flag checks, a per-IP SYN rate (default 100/s, burst 200) and a per-IP concurrent connection cap (default 300).
  • SYNPROXY is implemented and tested, but off by default.
  • L7: a classifier covers unknown-host scans, signatures and flood thresholds. Per-IP and per-path rate limits return 429 with Retry-After.
  • Automatic response: when a flood is detected, the site switches to verification mode automatically on every plan. Pro and Enterprise also get manual Under Attack and permanent attack mode.
  • Measurement (7 Oct 2026, relative on the same VM, N=7 medians, veth, generic XDP): per-packet receive CPU cost came out at 1020 ns with INPUT, 607 ns with raw and 539 ns with XDP. Under a SYN flood on an open port, the connection-tracking table filled (262,143 entries) with SYNPROXY off and stayed at zero with it on. We did not measure NIC line rate, packets per second or Gbps, IPv6, or native XDP.

Honest limits of a single-region service

A volumetric attack is not something a reverse proxy can solve. Traffic that fills the line does its damage at the provider connection before it reaches the server. Capacity spread across many points upstream solves that problem.

Nexren Shield does not offer that structure:

  • One region, one virtual server (Turkey).
  • No anycast, no upstream scrubbing.
  • No Gbps or Tbps capacity promise; we publish no capacity figure.
  • No percentage SLA.

In practice: against application-layer and connection-based attacks, Nexren Shield adds a real layer; against a large volumetric attack that fills the line, it gives no guarantee. If your threat model includes volumetric attacks, talk to us before you buy. For an overview of the product, read what is Nexren Shield.

Sources

Related product pages:Technology

Frequently asked questions

What is the difference between DoS and DDoS?

DoS comes from one source, DDoS from many distributed sources. Distribution makes per-address blocking harder.

Does a reverse proxy stop every kind of DDoS?

No. A volumetric attack that fills the line can do its damage at the provider before traffic reaches the proxy. A reverse proxy works better against connection and application-layer attacks.

Are SYN cookies a firewall?

No. They are a technique that lets the server's operating system answer SYNs without allocating memory for a half-open connection.

How do I know I am under attack?

A sudden request spike, longer response times, traffic piling onto one path or 'connection table full' log lines are typical signs. Check the source distribution so you do not confuse it with a campaign or a bot crawl.

Why does my origin IP matter during an attack?

If the attacker knows your origin IP, they can skip the proxy and hit the server directly. Opening the origin only to the proxy closes that path.

Related guides

Take a closer look at Nexren Shield

Review the plans and prices. Accounts are opened by our team; you can send an account request through the contact form.