RFC 3882
Configuring BGP to Block Denial-of-Service Attacks
1. Existing BGP-Triggered Black-holing Techniques β¨
okay so the old-school way of doing BGP-triggered black-holing π³οΈ works by changing the BGP next hop address of the network being attacked, and that change gets passed around the whole iBGP network π‘. A router in the attacked AS makes a custom iBGP advertisement where the next hop for the targeted network or host points to an RFC 1918 [RFC1918] (private internet) address π. Most routers on the Internet, especially edge routers, have static routes that send RFC 1918 addresses to the null interface, so all the traffic headed to the attacked network gets pulled into the null interface ποΈ.
When an iBGP-speaking router inside the destination AS gets that iBGP update, the advertised prefix goes into its routing table with an RFC 1918 network as the next hop π§. The router then tries to resolve that RFC 1918 next hop to qualify the route and figure out which forwarding interface to use. That lookup comes back with the null interface as a valid next hop π . As long as the router is set up to send RFC 1918 traffic to a null interface, the traffic aimed at the attacked network gets dropped, and that network becomes unreachable for the attacker and everyone else too π.
Here's the catch, though π. This technique does keep the internal infrastructure safe from the attack, which protects a ton of devices, but it also means the targeted network becomes unreachable across the entire destination AS. Even if the static route pointing RFC 1918 addresses to a null interface isn't on every router in the destination AS, the changed next hop still makes the traffic unroutable to its legit destination. It's a whole mess, bestie.
Network operators usually only keep these BGP-triggered black holes up for a short period of time β³. The technique drops traffic at every ingress point of the AS for anything headed to the attacked network. By default, routers that drop traffic into a null interface should send an "ICMP unreachable" message to the source address belonging to the origin/attacking AS π¨.
Once things get to this point, one of the source addresses of the attack traffic gets hijacked πͺ, by bringing in a device that uses the same source IP address inside the BGP domain of the destination/attacked AS. That device collects the ICMP unreachable packets π΅οΈββοΈ. The source addresses on those ICMP unreachable packets reveal which edge routers within the destination/attacked AS the attack is coming in through π. After that, the network operator may choose to manually stop the traffic on the routers where the attack traffic is entering π.
2. Enhanced BGP-Triggered Black-holing Technique π
This part describes a technique that was built to tell a selected set of routers to change the next hop address of a particular prefix using the BGP protocol π¦. The next hop can be either a null interface or, as we'll get into later in this paper, a sinkhole tunnel interface π§. This technique doesn't use an access list or a rate limiting statement to deal with attack traffic, and it doesn't change the next hop of the attacked prefix across the whole network π ββοΈ. The next hop only gets changed on a selection of routers, with the help of BGP communities inside the destination/attacked AS π.
To get the network ready for this technique, the network operator needs to define a unique community value for each destination AS border router that could possibly send attack traffic to the victim π. For example, say a network with BGP autonomous system number 65001 has two border routers, R1 and R2. Community value 65001:1 identifies R1, community value 65001:2 identifies R2, and community value 65001:666 identifies both R1 and R2 at the same time π.
After the BGP community assignments are done, R1 and R2 must be configured with the following:
- Static route pointing an RFC 1918 network to a null interface.
- AS-Path access list that matches local BGP prefix advertisement.
- BGP community access list to match the community value assigned by the network operator for the particular router (i.e.,
65001:1for R1). - BGP community access list to match the community value assigned by the network operator for all routers (i.e.,
65001:666for R1 and R2). - Under the BGP process, an iBGP import route policy should be applied on received iBGP advertisements to do the following logic. (Statements are in a logical AND order.)
- a. A policy statement to permit routes that match the following criteria and apply the following changes.
- i. Match for a community specific to that router (i.e.,
65001:1, for R1). - ii. Match the AS-Path to locally generated BGP advertisements.
- iii. Set the BGP next hop to an RFC 1918 network.
- iv. Overwrite the BGP community with the well-known community (
no-advertise).
- i. Match for a community specific to that router (i.e.,
- b. A policy statement to permit routes that match the following criteria and apply the following changes.
- i. Match for a community that covers all routers (i.e.,
65001:666). - ii. Match the AS-Path to locally generated BGP advertisements.
- iii. Set the BGP next hop to an RFC 1918 network.
- iv. Overwrite the BGP community with the well-known community (
no-advertise).
- i. Match for a community that covers all routers (i.e.,
- a. A policy statement to permit routes that match the following criteria and apply the following changes.
Once those policies are set up on R1 and R2, the network operator can, if there's an attack, advertise the targeted network into iBGP of the destination/attacked AS π¨. That network could be one or more /32 "host" routes. The advertisement must include the community value tied to the router(s) where the attack is arriving, plus the well-known community (no-export) π«Ά. Because BGP communities are used, the original next hop address of the targeted network is kept on every router that doesn't have the special route policy configured β¨. iBGP then carries the prefix advertisement to all routers in the destination/attacked AS πΈ. Every router in the destination AS, except the ones matching the community stamped on the prefix, won't even notice the community value and will install the network route with its legit next hop address πββοΈ. The routers that do match the community will also install the network route in their routing table, but they'll change the next hop to an RFC 1918 network and then to a null interface, based on the route policy configuration and a recursive route lookup π.
The reason for matching locally announced networks is to make sure no eBGP peer can misuse this community to send any network to a null interface π. Black-holing the targeted/attacked hosts is recommended, but not the whole address block they belong to, so the blackhole has the smallest possible impact on the attacked network π.
This technique stops traffic from being forwarded on to its legit destination on the routers that are identified as transit routers for attack traffic and that have route map matches for the community value tied to the network advertisement π. All the other traffic on the network still gets forwarded to its legit destination, which keeps the impact on the targeted network as small as possible π.
3. Sinkhole Tunnels β¨
Okay so, bestie, this is where things get spicy πΆοΈ. Once you've done the Enhanced BGP-Triggered Black-holing Technique, sometimes you need to actually look at the attack traffic to figure out what's going on π΅οΈββοΈ. That makes everything way more complicated, ngl. Usually, on broadcast interfaces, network operators plug a network sniffer into a spanned port of a switch so they can analyze traffic π. Another option is to announce a network prefix covering the attack host address into iBGP and change the next hop to a sinkhole device that logs traffic for analysis. The catch? That second method takes down the services running on the targeted/attacked IP addresses π. Inter-AS traffic gets sucked into the sinkhole, and so does the Intra-AS traffic π. Packet-level analysis means redirecting traffic away from the destination host to a sniffer or a router. So if the traffic being examined includes legitimate traffic, that legit traffic never makes it to the destination host, and that's a full denial of service for it π.
Okay, so here's the upgrade: a sinkhole tunnel π¦. A sinkhole tunnel is set up at every possible entry point that attacks could come through into the destination/attacked AS. Using the BGP community technique, traffic headed for the attacked/targeted host can get re-routed onto a special path (a tunnel) where a sniffer can capture it for analysis π. Once it's been analyzed, the traffic exits the tunnel and gets routed normally to the destination host. In other words, the traffic passes through the network to a sniffer without altering the next hop information of the destination network π . All routers inside the destination/attacked AS iBGP domain keep the proper next hop address. Only the entry point router gets the altered next hop info πΈ.
Let's walk through the setup, lol π§. A sinkhole router, with an optional sniffer attached to its interface, gets installed and configured to participate in the IGP and iBGP of the attacked AS. Next up, a tunnel gets created (MPLS Traffic Engineering is the example here π) from every border router attacks could enter from (Inter-AS traffic) to the sinkhole router. When a host or network is under attack, a customized iBGP advertisement gets sent to announce the network address of the attacked host(s), with the proper next hop so traffic still reaches those hosts or networks π. That advertisement also carries a community string value matching the set of border routers the attack is coming in from, as described in section 2 π₯. The new next hop address configured in the route policy section of all border routers should be the sinkhole IP address π. That IP address belongs to the /30 subnet assigned to the tunnel connecting the border router to the sinkhole router π.
Routers that don't have a match for the community string just do regular routing π. Not matching the community means the special route policy doesn't change the next hop address on them β¨. Traffic entering from border routers without a match on the special community passes through regular router interfaces to the legit destination π«Ά. It might also be necessary to let the traffic reach its destination after it's been captured π¦. In that case, a default network route gets configured to point to any interface attached and configured on the iBGP network. That includes the same physical interface the tunnel is built on π . Since the next hop address doesn't change on the sinkhole device, traffic coming in from the tunnel gets sent back into the network thanks to the default route π. Then the routing protocols take care of routing it properly to its original destination (the attacked network) β.
Honestly, this technique is useful for more than just analyzing attack traffic π. Legit traffic can also be pulled out of normal routing into a tunnel and then reinserted into the backbone, without changing the next hop addressing scheme across the whole iBGP network π.
MPLS Traffic Engineering, with all its features, is a great way to slide traffic over to the sinkhole device π§. Features like QoS policies can be applied to the attack traffic, which stops it from fighting over resources with the legitimate traffic π.
To change the next hop on the border router, a subnet of an RFC 1918 network gets statically routed to the tunnel interface πΈ. Here's an example of the static route:
ip route 192.168.0.12 255.255.255.255 Tunnel0
Setting the next hop of the target IP address to 192.168.0.12/32 forces the traffic through the tunnel π¦.
Traffic arrives at the sinkhole interface via the TE tunnel π. Then three methods can be installed: rate-limiting policies, QoS policies, and access lists π . These policies can rate limit or drop traffic classified as attack traffic π₯. All of this happens on the interface of the sinkhole device π. Another useful trick for a sinkhole router is to pull traffic in through tunnels to an inbound interface, with a default route statement forwarding it out to an Ethernet interface π. That Ethernet interface connects to the iBGP network, guarantees proper delivery, and still lets you use a packet sniffer to dig into the attack traffic π΅οΈββοΈ.
This gets super useful when you can't apply an access list or rate limiting statement on the BGP border router or last hop router before the attacked host or network, because of hardware or software limitations π. So instead of upgrading interfaces at the point of entry for the attack traffic, you can pull that traffic into the sinkhole and deal with it there π. If the sinkhole router is a powerful device, operational costs can stay minimal π«Ά.
4. Security Considerations π
Okay, this part is seriously important, bestie π€. It is very important to keep tight control over eBGP peering points before you implement any of the techniques described in this paper π¨. eBGP customers might be able to blackhole a particular subnet using the Blackhole communities π. To eliminate that risk, you must not skip the match for locally generated BGP advertisements in the special route policy π ββοΈ.
Seriously, don't skip that match. Anyone who can blackhole your subnets is a whole disaster π.
5. Acknowledgments π«Ά
The author of this document wants to shout out the developers of the remotely triggered black-holing technique π, and the developers of the backscatter technique for collecting backscatter traffic π. The author also wants to thank all the members of the IP Engineering department for helping verify that this technique actually works π.
6. Informative References π
- [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., and E. Lear, "Address Allocation for Private Internets", BCP 5, RFC 1918, February 1996.
7. Author's Addresses π
Doughan Turk Bell Canada 100 Wynford Drive
EMail: doughan.turk@bell.ca
8. Full Copyright Statement Β©οΈ
Copyright (C) The Internet Society (2004).
This document is subject to the rights, licenses and restrictions contained in BCP 78 and at www.rfc-editor.org, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/S HE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property π§
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the ISOC's procedures with respect to rights in ISOC Documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf- ipr@ietf.org.
Acknowledgement π
Funding for the RFC Editor function is currently provided by the Internet Society.
π¦ where this page comes from
- ietf: rfc3882 2004-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms