On a service provider network, a volumetric attack on one subscriber can fill your upstream links and hurt everyone. The first goal of DDoS defence is therefore to stop the attack at the network edge, or earlier at the upstream. The two most common tools for that are RTBH and FlowSpec.
Detect first
Whatever the response, you have to see the attack first. sFlow, NetFlow or IPFIX data from edge and core routers is analysed continuously. When the bit rate, packet rate or share of a given protocol towards one target crosses a threshold, the attack is detected and classified: UDP flood, SYN flood, DNS or NTP amplification and so on.
RTBH: blackhole the target
Remotely Triggered Black Hole announces the attacked IP over BGP with a blackhole community. The announcement makes your own network, and your transit provider if it supports it, drop all traffic to that IP.
- Upside: very simple and very fast. Applied upstream, attack traffic never reaches your link.
- Cost: legitimate traffic to the target is dropped too. The attacker achieves their aim, but the rest of the network is protected.
RTBH is the right tool when the attack exceeds your link capacity and a short outage for the target is acceptable.
FlowSpec: filter only the attack
BGP FlowSpec distributes filtering rules over BGP. A rule matches criteria such as destination and source prefix, protocol, port and packet size. For example, "drop UDP from source port 123 to 203.0.113.10" stops an NTP amplification attack without blackholing the target.
- Upside: legitimate traffic keeps flowing and service continues.
- Cost: you need an accurate attack signature, and a FlowSpec rule on your own edge won't help if your link is already full.
Using both
In practice the two are used in stages:
- The attack is detected and its signature extracted.
- If link capacity allows, a FlowSpec rule is applied on your own edge.
- If the attack is big enough to fill the link, the FlowSpec rule is sent to an upstream that supports it, or the target is blackholed upstream with RTBH.
- When the attack ends, the rules are withdrawn automatically.
| RTBH | FlowSpec | |
|---|---|---|
| What is dropped | All traffic to the target | Only matching traffic |
| Speed | Very fast | Fast |
| Service impact | Target unreachable | Service continues |
| Upstream support | Common | More limited |
With CoreGate DDoS Shield
CoreGate DDoS Shield analyses flow data continuously, detects attacks within seconds using per-target thresholds and triggers FlowSpec or RTBH automatically depending on the attack type. Rules apply directly through CoreGate BGP Edge Gateway, are withdrawn when the attack ends, and every incident is reported.