Blackhole routing: how a DDoS blackhole works, and what it costs
Blackhole routing is a way for a network to survive a flood aimed at one address: its routers are told to discard every packet bound for that address, so the flood dies at the edge instead of filling links behind it. The price is plain. For that address, the attacker has won. The BGP-driven form is called remotely triggered black hole filtering, RTBH, and it is what most people mean by a DDoS blackhole.
Quick facts
- Mechanism
- A BGP announcement makes routers point a prefix at a discard (null) interface (RFC 3882)
- Destination-based
- Drops all traffic to the target, attack and legitimate alike; the target goes offline (RFC 5635, section 1)
- Source-based
- Needs unicast Reverse Path Forwarding; drops traffic from announced source addresses (RFC 5635, section 4)
- Standard community
- BLACKHOLE, 65535:666 (0xFFFF029A), registered by RFC 7999, section 5
- Typical prefix
- As specific as possible: /32 for IPv4, /128 for IPv6 (RFC 7999, section 3.3)
- Who decides
- Each receiving operator chooses whether to honour the community (RFC 7999, section 3.1)
- Status
- RFC 3882, 5635 and 7999 are all Informational; none is an Internet standard
Blackholing is one entry in the wider DDoS mitigation toolbox, and the bluntest one. This page covers the routing mechanism only.
How blackhole routing works
A router normally forwards a packet towards the next hop its routing table names for the destination. A discard route names no real next hop: the packet is thrown away. Blackhole routing is the practice of installing such a route for one address or prefix while an attack is on.
The reason to do it with routing, not filters, is speed at scale. RFC 5635 observes that most routers forward traffic at a much higher rate than they can filter it, and hold far more forwarding entries than filter entries, so access lists on the edge run into limits on both entry count and packet rate. A discard route rides on forwarding performance instead.
The trigger
The original technique in RFC 3882 works inside one autonomous system. A router originates an iBGP route for the attacked host with its next hop changed to a private RFC 1918 address. Edge routers already carry a static route sending that private address to the null interface, so the attacked host's traffic is dropped. RFC 3882 is blunt about the first version of this: it makes the target unreachable throughout the destination AS, "to the attacker and everyone else".
Its enhanced version adds BGP communities. The operator assigns one community per border router and one for all of them, and import policy rewrites the next hop only on routers that match. Traffic then dies at the border routers where the attack enters, while other paths to the target keep working. The same RFC recommends blackholing the attacked host, not the whole address block it belongs to. The opposite approach, spreading a flood across many sites, is anycast.
Why the trigger needs care
The announcement is a routing change that any mistake or abuse can turn into an outage. RFC 5635 asks for the trigger to carry NO_EXPORT, for egress filters that stop it leaving the network, and for a restrictive import policy, typically accepting only /32 host routes. Section 5 of the same document says the techniques can cause significant forwarding loss if incorrectly deployed.
Destination-based vs source-based blackholing
Destination-based RTBH
The discard route covers the victim's address. Every packet addressed to it is dropped at the edge: the flood, and also every legitimate visitor. RFC 5635 states the trade directly. Collateral damage to other systems and to the network is limited, "but the negative impact to the target itself is arguably increased". It also says the technique "completes" the attack for the target address.
Source-based RTBH
Here the announced prefix is the attacker's address, not the victim's. For that to drop anything, the router also needs unicast Reverse Path Forwarding (uRPF, RFC 3704): the router looks up each packet's source, and a source whose route points at the discard interface fails the check. RFC 5635 explains why operators wanted this. Botnet traffic was often configured to re-resolve a hostname, so moving the victim to a new address stopped helping. Source filtering does not depend on where the victim lives.
It has its own costs. The RFC notes that blocking by source drops all traffic to and from that address, not only the traffic aimed at the victim. Strict-mode uRPF drops legitimate traffic under asymmetric routing, and loose mode may also discard legitimate traffic. Because the announced addresses are not the announcer's own, the RFC says operators should not accept source-based RTBH announcements from peers or customers; only local attack-management systems should install them.
What the RFCs say
- RFC 3882, Configuring BGP to Block Denial-of-Service Attacks (2004). The community-scoped, next-hop technique above, plus sinkhole tunnels that pull traffic aside for analysis without dropping it.
- RFC 5635, Remote Triggered Black Hole Filtering with uRPF (2009). Names destination-based RTBH, adds the source-based variant, and sets out the steps: choose a discard address, install the discard route, write the BGP policy, add egress safety filters, set up a trigger router. It also describes customer-triggered RTBH, where a customer may blackhole only prefixes it is authorized to advertise.
- RFC 7999, BLACKHOLE Community (2016). A well-known advisory transitive community so that networks need not each invent a trigger. Honouring it is each operator's decision; on a bilateral session both sides must agree first. Routers should not discard on it without explicit configuration.
RFC 7999 also explains a practical snag. Announcements longer than /24 in IPv4 or /48 in IPv6 are usually not accepted on the Internet, yet a blackhole prefix should be as long as possible, so operators have to make a deliberate exception for tagged routes. The receiver should honour a tagged route only if the neighbour is authorized to advertise the covering prefix, and should add NO_EXPORT or NO_ADVERTISE to keep it local.
The security section of RFC 7999 makes a related point: adding the BLACKHOLE community to someone else's prefix can itself be a denial-of-service attack, because it removes reachability. That is why every one of these documents insists on authorization checks. RFC 7999 also says the community is not meant for use with BGP Flow Specification, the finer-grained tool defined in RFC 8955.
The cost: the victim goes dark too
A DDoS blackhole does not tell attack packets from real ones. It cannot; routing sees an address, not a request. For the blackholed address, the outcome is the one the attacker wanted: nothing answers. What the operator buys is containment. The links stay usable, other customers stay online, and the attack's cost lands on one address instead of many.
Three practical consequences follow.
- The outage is total for that address. Health checks fail, sign-ins fail, API clients get timeouts. Nothing at layer 7 can help, because requests never arrive.
- It does not end the attack. Traffic still gets sent; it is just discarded closer to its entry point. The attack ends when the sender stops or the sources are cleaned up.
- Undoing it is a second, deliberate step. Someone withdraws the announcement and watches whether the flood resumes. RFC 5635 suggests moving the service to another address, for example by updating DNS records, as a way to stay up, which works only if the attack does not follow the name.
The RFC 3882 sinkhole tunnel exists for the opposite reason: it sends suspect traffic to a device for analysis and lets it continue to the destination afterwards, avoiding the denial of service that a plain sinkhole causes for legitimate traffic.
When a DDoS blackhole is the right call
RFC 5635 describes the case it was written for: attack traffic that exceeds what fits down the links from the provider to the victim, starving legitimate traffic and damaging other customers and the provider's network. In that situation the choice is between losing one address and losing everything that shares the pipe.
It fits when the target is one address you can afford to lose for a while, when the flood is large enough that nothing else will fit through the link, or when a cleaner option is not ready yet and the collateral damage is growing. It is a poor fit for a small attack that is hurting only the application. Blackholing turns a degradation into a full outage, so for application layer attacks the answer is filtering and rate limits, not routing.
The better question is usually what to use instead. Diverting traffic through a scrubbing centre keeps the target online by removing attack traffic and forwarding the rest. BGP Flow Specification can drop narrower slices of traffic than a whole address. Both need arranging before the day. Blackholing needs only a provider that honours the trigger. For the signs that an attack is actually volumetric and which layer it hits, read DDoS attack detection first, and keep the decision on your incident notes so it is withdrawn when it should be.
One more limit: blackholing is something networks do for each other. The party that operates the routers acts on the announcement, or on a customer's request to make one. Whether a given provider offers it, and on what terms, is in that provider's documentation, not in the RFCs.
Where a WAF helps and where it does not
Blackholing happens in routers, before any HTTP connection exists. A web application firewall works one layer up. It sees requests that arrive, which means it never sees traffic a router has already discarded, and it cannot make routing decisions. It does not stop a flood that fills a link before the request stage; that belongs to the network, as covered under layer 3, 4 and 7 attacks.
What the filter can do is deal with the requests that reach your origin: refuse those matching rules, and apply rate limits to the paths an attack targets. After a blackhole is lifted, the traffic that returns may be a mix of real users and botnet requests, and that part is application work. Start in monitor mode, read what would have been refused, then turn on block (see WAF monitor mode). Per-address blocking inside the application is covered in IP blocking, and it is a different tool from a BGP blackhole.
Questions
What is blackhole routing?
Blackhole routing is a technique where a network sends traffic for a chosen address to a discard interface, so the packets are dropped at the edge. In DDoS defence it is usually triggered by a BGP announcement, a method called remotely triggered black hole (RTBH) filtering.
What is the difference between destination-based and source-based RTBH?
Destination-based RTBH drops all traffic addressed to the victim, attack and legitimate alike, so the victim goes offline. Source-based RTBH uses unicast Reverse Path Forwarding to drop traffic from announced source addresses, which also drops everything else those addresses send.
What is the BLACKHOLE BGP community?
It is a well-known BGP community, 65535:666 (0xFFFF029A), registered by RFC 7999. It tells a neighbouring network that traffic to the tagged prefix should be discarded. It is advisory: each operator chooses whether to honour it.
Does blackholing stop a DDoS attack?
It stops the flood from reaching the network and its other customers, but the blackholed address becomes unreachable. RFC 5635 says the technique completes the attack for that address. It contains the damage; it does not keep the target serving.
Does a WAF do blackholing?
No. Blackholing is a routing decision made by networks before any HTTP request exists. A WAF works on the requests that arrive, at layer 7.