Designing ISP BGP Communities from Scratch (Part 3): Automated DDoS Mitigation with BGP RTBH

Continuing directly from Part 2: our customer’s ten prefixes are steering cleanly across Telia and NTT—until a few days later, when a single host server comes under a heavy volumetric DDoS attack that saturates the transit links and threatens every other customer behind the backbone. To isolate the victim IP before attack traffic ever enters our network, we implement community-driven RTBH (Remote Triggered Black Hole) signaling.

RTBH Architecture & Prerequisites

To enable automated RTBH, we add a high-priority blackhole import policy on the customer eBGP session and insert upstream translation policies that map our internal RTBH community onto each transit carrier’s blackhole community. Figure 1 illustrates the end-to-end mitigation flow:

ISP BGP RTBH architecture showing customer AS 65535 signaling 45.1.10.2/32 with community 65535:666 to AS 65000, translated to Telia 1299:999 and NTT 2914:666 to drop DDoS traffic upstream
Figure 1: BGP Community-triggered RTBH signaling from Customer AS 65535 through AS 65000 to Telia (1299:999) and NTT (2914:666).

Prerequisites & Upstream Blackhole Communities

  • The working dual-homed BGP Community backbone configured in Part 2.
  • RTBH filtering enabled on your upstream transit sessions along with each provider’s published blackhole community (simulated lab values below):
    • NTT (AS 2914): 2914:666
    • Telia (AS 1299): 1299:999

Baseline Check: Verifying Customer Prefix State

Before enabling RTBH, confirm on Internet-Routes that all ten customer /24 prefixes from Part 2 are installed along their expected upstream next-hops (101.0.0.1 via Telia and 101.1.0.1 via NTT):

Internet-Routes#  show ip route bgp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set

      45.0.0.0/24 is subnetted, 10 subnets
B        45.1.1.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.2.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.3.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.4.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.5.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.6.0 [20/0] via 101.1.0.1, 00:23:07
B        45.1.7.0 [20/0] via 101.1.0.1, 00:23:07
B        45.1.8.0 [20/0] via 101.1.0.1, 00:23:07
B        45.1.9.0 [20/0] via 101.0.0.1, 00:23:07
B        45.1.10.0 [20/0] via 101.1.0.1, 00:23:07

Configuring Junos RTBH Import & Upstream Community Translation

In our attack scenario, host 45.1.10.2 inside 45.1.10.0/24 (gateway 45.1.10.1) is targeted by a volumetric flood. On Littlewolf-Backbone, define the internal rtbh community (65535:666) and the two upstream blackhole communities (1299:999 for Telia and 2914:666 for NTT), then insert customer-rtbh ahead of customer-import and *-blackhole ahead of bgp-announce:

root@Littlewolf-Backbone# show | compare
[edit policy-options]
+   community ntt-rtbh members 2914:666; // NTT upstream blackhole community
+   community rtbh members 65535:666; // Internal customer-triggered RTBH community
+   community telia-rtbh members 1299:999; // Telia upstream blackhole community
[edit policy-options]
+   policy-statement customer-rtbh {
+       term rtbh { // Accept host routes tagged with the internal RTBH community
+           from community rtbh;
+           then accept;
+       }
+   }
+   policy-statement ntt-blackhole {
+       term rtbh { // Append NTT blackhole community and advertise immediately
+           from community rtbh;
+           then {
+               community add ntt-rtbh;
+               accept;
+           }
+       }
+   }
+   policy-statement telia-blackhole {
+       term rtbh { // Append Telia blackhole community and advertise immediately
+           from community rtbh;
+           then {
+               community add telia-rtbh;
+               accept;
+           }
+       }
+   }
[edit protocols bgp group upstream neighbor 47.0.0.1]
-     export [ telia-prepend telia-filter bgp-announce ];
+     export [ telia-prepend telia-filter telia-blackhole bgp-announce ]; // Insert Telia RTBH translation before bgp-announce
[edit protocols bgp group upstream neighbor 74.1.0.1]
-     export [ ntt-prepend ntt-filter bgp-announce ];
+     export [ ntt-prepend ntt-filter ntt-blackhole bgp-announce ]; // Insert NTT RTBH translation before bgp-announce
[edit protocols bgp group downstream neighbor 10.0.0.0]
-     import customer-import;
+     import [ customer-rtbh customer-import ]; // Evaluate customer-rtbh ahead of /24 import filter

Policy Ordering & Production Hardening Note: Because 45.1.10.2/32 matches customer-rtbh before reaching customer-import, it bypasses the no-telia (65535:6661) tag applied to 45.1.10.0/24—allowing both Telia and NTT to receive the /32 blackhole announcement simultaneously. In production deployments, always pair from community rtbh with an explicit customer aggregate and host-length constraint (e.g., route-filter 45.1.0.0/16 prefix-length-range /32-/32) so a customer cannot accidentally or maliciously blackhole third-party prefixes or an entire /24.

Verifying /32 RTBH Signaling & Upstream Traffic Drop

Once committed, instruct the customer to advertise 45.1.10.2/32 tagged with 65535:666. Verify on Littlewolf-Backbone that the /32 host route is accepted from the customer and advertised to Telia carrying both 1299:999 and 65535:666:

root@Littlewolf-Backbone> show route receive-protocol bgp 10.0.0.0

inet.0: 22 destinations, 25 routes (21 active, 0 holddown, 1 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 45.1.1.0/24             10.0.0.0             0                  65535 I
* 45.1.2.0/24             10.0.0.0             0                  65535 I
* 45.1.3.0/24             10.0.0.0             0                  65535 I
* 45.1.4.0/24             10.0.0.0             0                  65535 I
* 45.1.5.0/24             10.0.0.0             0                  65535 I
* 45.1.6.0/24             10.0.0.0             0                  65535 I
* 45.1.7.0/24             10.0.0.0             0                  65535 I
* 45.1.8.0/24             10.0.0.0             0                  65535 I
* 45.1.9.0/24             10.0.0.0             0                  65535 I
* 45.1.10.0/24            10.0.0.0             0                  65535 I
* 45.1.10.2/32            10.0.0.0             0                  65535 I

inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

root@Littlewolf-Backbone>  show route advertising-protocol bgp 47.0.0.1  45.1.10.2/32 extensive // Confirm blackhole communities sent to Telia

inet.0: 22 destinations, 25 routes (21 active, 0 holddown, 1 hidden)
* 45.1.10.2/32 (1 entry, 1 announced)
 BGP group upstream type External
     Nexthop: Self
     AS path: [65000] 65535 I
     Communities: 1299:999 65535:666

Finally, run comparative traceroute checks from Internet-Routes to both the healthy subnet gateway (45.1.10.1) and the blackholed host (45.1.10.2):

Internet-Routes#traceroute 45.1.10.1 source lo0 // Trace path to healthy subnet gateway
Type escape sequence to abort.
Tracing the route to 45.1.10.1
VRF info: (vrf in name/id, vrf out name/id)
  1 101.1.0.1 139 msec 123 msec 168 msec
  2 74.1.0.0 252 msec 1000 msec 26 msec
  3 10.0.0.0 28 msec 22 msec *
Internet-Routes#traceroute 45.1.10.2 source lo0 // Trace path to blackholed server IP
Type escape sequence to abort.
Tracing the route to 45.1.10.2
VRF info: (vrf in name/id, vrf out name/id)
  1  *  *  *
  2  *  *  *
  3  *  *  *
  4  *
Internet-Routes#

Reachability to 45.1.10.1 continues smoothly via NTT, while all traffic destined for 45.1.10.2 is dropped directly at the upstream provider edge—shielding both our backbone transit capacity and neighboring customer servers.

From Control-Plane Communities to Data-Plane QoS

Across Parts 1–3, we built a complete control-plane BGP Community framework covering baseline transit hygiene, multi-homing traffic engineering, and automated RTBH mitigation. In Part 4, we take BGP communities one step further into the data plane—using Cisco QPPB and Juniper SCU/DCU to enforce granular per-region and per-ASN rate limits without burning router TCAM on massive IP ACLs.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.