· 7 min read

Always-On vs On-Demand DDoS Protection: BGP Diversion Guide

Always-on vs on-demand DDoS protection comes down to one question: is your traffic scrubbed all the time, or only after an attack is detected and you divert it? Always-on keeps your prefix pointed at the scrubbing path permanently, so there is no detection delay. On-demand keeps traffic on your normal path and uses BGP to pull it into a scrubbing center only when an attack starts.

Neither model is universally better. The right choice depends on how fast attacks hurt you, how much latency you can tolerate, and how reliable your detection is. This guide explains the difference, what "detection time" really includes, and how BGP moves traffic to a scrubbing center, with a working configuration example.

Always-on vs on-demand: the core difference

Always-on On-demand
Normal traffic path Through the scrubbing network, always Direct to your network
Attack start Filtered from the first packet Hits you until diversion completes
Detection needed Not required for routing Required (flow, thresholds, or manual)
Extra latency Small, constant (path via scrubber) None until diversion
Operational effort Low once set up Higher: triggers, runbooks, testing
Typical fit Game servers, hosting, anything latency-tolerant but downtime-intolerant Networks with strong monitoring and a tight latency budget

A third pattern is common: always-on routing with on-demand filtering strictness. Traffic always arrives via the protected path, and you tighten rules during an attack.

What "detection time" actually includes

When people ask how fast on-demand protection reacts, they usually mean one number. In practice it is the sum of several delays:

  1. Telemetry delay. NetFlow/IPFIX/sFlow records are exported on a timer. Active timeouts of 30–60 seconds are common, and some exporters batch longer.
  2. Detection logic. Threshold or baseline checks often need a few consecutive intervals to avoid false positives.
  3. Decision and trigger. An automated script or a human approving the diversion.
  4. BGP propagation. The announcement has to be accepted by the scrubbing network and, if you are re-originating the prefix, propagate to the internet. Convergence varies by topology and is not instant.
  5. Tunnel and return path warm-up. The clean-traffic path (usually GRE) must already be up and tested.

The attack runs at full strength during all five steps. For a volumetric flood that saturates your uplink, that window is the outage. This is why on-demand works best when upstream capacity is larger than the attack's peak during the delay, or when your detection is automated and tuned.

Always-on removes steps 1 through 4 from the critical path entirely. You pay for that with constant path inflation and the need to trust the scrubbing path with all of your production traffic.

Reducing detection time for on-demand

A flow-based monitoring and detection platform such as NixMon is designed for this role: it analyzes flow data to spot attacks and can feed an alert into whatever triggers your diversion.

How BGP diverts traffic to a scrubbing center

BGP does not "filter" anything. It changes where packets go. The scrubbing flow has three parts:

  1. Attract. The scrubbing network announces your prefix (or you announce it to them), so internet traffic for that prefix flows to the scrubbing center.
  2. Clean. The scrubbing center drops attack traffic and keeps legitimate traffic.
  3. Return. Clean traffic is delivered back to you, typically through a GRE tunnel, because the scrubbing center cannot simply route it back via the same BGP path without looping.

Two common ways to attract traffic:

Most IPv4 networks filter prefixes longer than /24, so a diversion needs to be a /24 or shorter. You cannot rely on announcing /32s to pull a single host's traffic across the public internet. For single-host mitigation inside a network, see RTBH instead.

Example: on-demand diversion with BIRD 2

This sketch uses documentation ranges. Your ASN is AS64496, your prefix is 198.51.100.0/24, and the scrubbing network is AS64500 reachable at the tunnel address 192.0.2.1.

# /etc/bird/bird.conf (excerpt)

define MY_ASN   = 64496;
define SCRUB_AS = 64500;

filter export_to_scrub {
    if net = 198.51.100.0/24 then accept;
    reject;
}

protocol static my_prefix {
    ipv4;
    route 198.51.100.0/24 blackhole;
}

protocol bgp scrub {
    local 192.0.2.2 as MY_ASN;
    neighbor 192.0.2.1 as SCRUB_AS;
    disabled;            # on-demand: keep down until an attack
    ipv4 {
        import none;
        export filter export_to_scrub;
    };
}

Trigger and clear:

# Start diversion
birdc enable scrub

# Verify the session and the announced route
birdc show protocols scrub
birdc show route export scrub

# End diversion after the attack has ended
birdc disable scrub

Before relying on this, confirm that the GRE tunnel is up, that your ROA covers the origin AS the scrubbing network will use, and that the max-length matches the prefix you announce. For tunnel MTU and MSS tuning, see our GRE tunnel DDoS protection guide.

Always-on in practice with a BGP tunnel

If you have your own ASN and IP block, an always-on setup usually means a GRE tunnel to the protection network with a BGP session running inside it. Clean traffic arrives through the tunnel, and your prefix is announced via the protection network at all times. Nixcon operates AS40368 and provides this through NixGuard Edge, described on the DDoS protection and firewall page. Your ASN is added to the AS-NIXCON AS-SET, and ownership is validated through RPKI ROA and RIR/IRR records.

You can inspect how routes appear from different locations (Izmir, Frankfurt, and the US) with the public looking glass using BGP route, ping, and traceroute queries.

Which model should you choose?

Choose always-on if:

Choose on-demand if:

A middle path is to run always-on for the prefixes hosting critical services and keep on-demand for the rest.

Common mistakes and fixes

Quick readiness checklist

Whichever model you pick, measure the result. A diversion you have never timed is a guess, not a defense.

Frequently asked questions

What is the main difference between always-on and on-demand DDoS protection?

Always-on routes all traffic through a scrubbing network continuously, so attacks are filtered from the first packet. On-demand keeps traffic on your normal path and diverts it via BGP to a scrubbing center only after an attack is detected.

Why does on-demand protection have a detection delay?

The delay is the sum of flow export timers, detection logic, the trigger decision, BGP propagation, and tunnel readiness. The attack continues at full strength during that whole window.

Can I divert a single IP address with BGP?

Not across the public internet in most cases. IPv4 prefixes longer than /24 are commonly filtered, so diversion normally uses a /24 or shorter. For a single host inside a network, RTBH is the usual tool.

How does clean traffic get back to my server after scrubbing?

Typically through a GRE tunnel from the scrubbing network to your router or server. You need to set the tunnel MTU and TCP MSS correctly and decide how outbound traffic is routed to avoid asymmetry problems.

Own an ASN? Explore DDoS-protected BGP with Nixcon.Learn more