← Back to blog

How BGP works: prefixes, AS paths, routing decisions and DDoS impact

BGP is the protocol that lets networks announce reachability to each other. Understanding prefixes, AS paths, communities and route preference is essential before buying protected transit.

How BGP works: prefixes, AS paths, routing decisions and DDoS impact
BGP announces prefixes

An AS tells other networks which IP blocks it can reach.

Best route is policy

AS path, local-pref, MED and communities influence decisions.

DDoS depends on routing

Attracting, moving or withdrawing a route changes exposure.

BGP, Border Gateway Protocol, is the protocol autonomous networks use to exchange routes on the Internet. When a network announces an IPv4 or IPv6 prefix, it tells the world where those addresses can be reached. BGP does not carry user packets; it carries routing decisions. This distinction matters for DDoS protection: mitigation often starts by steering traffic toward a network that can absorb it, filter it and return legitimate traffic cleanly.

Protected IP transit

Peeryx makes BGP design operational

Peeryx can integrate your ASN, under-ASN, AS-SET, tunnels or cross-connect so routing and mitigation stay understandable.

Defining the problem

Calling BGP “the protocol of the Internet” is true but not enough. BGP is an announcement system between autonomous systems. Each network publishes prefixes, receives routes and chooses according to local policy.

This distributed nature is powerful and sometimes counter-intuitive. Different ISPs may choose different paths. A more-specific route can attract more traffic. A community can ask a transit provider to change preference, prepend or blackhole. For protected transit, these details are operational, not academic.

BGP attributes are not universal commands. Local preference is usually internal to one network, AS path prepending may or may not influence remote networks, and MED is often ignored across provider boundaries. This is why testing with real upstreams matters.

Why this matters

BGP matters for DDoS because it controls where traffic lands before filtering. If a prefix is announced only behind a small port, a volumetric attack may saturate the link before servers can respond.

Clean delivery matters as much. After scrubbing, traffic must return through tunnel, cross-connect or another defined model. Without a clear BGP design, asymmetry and route conflicts appear during incidents.

In DDoS mitigation, the most-specific accepted route often wins. A /24 IPv4 announcement can attract traffic away from a larger aggregate. That is useful for mitigation, but dangerous if it is not coordinated with RPKI, IRR objects and prefix filters.

For search and onboarding, this distinction should be explained plainly on the page. Buyers are often comparing providers that all claim large capacity; the differentiator is whether the routing and mitigation model can be audited before an outage.

Possible solutions

Classic customer eBGP lets the customer announce prefixes and control routing with full table or default route.

Provider-operated announcement is simpler for customers without deep routing skills, but it must remain transparent.

The mitigation model announces the prefix toward the DDoS network, filters traffic and delivers clean traffic through GRE, IPIP, VXLAN, router VM or cross-connect.

Default route is enough for many protected customers because inbound traffic is the main exposure. Full table becomes useful when the customer wants detailed egress control, traffic engineering or multiple transit relationships.

A practical design should include acceptance criteria: expected latency, maximum tolerated packet loss during mitigation, handoff bandwidth, escalation contacts and the exact conditions under which a disruptive control such as blackhole may be used.

BGP element Role DDoS impact
Prefix Announced IP block Defines what is protected
AS path AS sequence Influences traffic attraction
Community Operator instruction Can change preference or blackhole

Turning BGP decisions into predictable protected routing

Peeryx treats BGP as a control plane, not a slogan. We define who announces the prefix, which AS is used, prefix limits, communities, handoff and return path.

In protected IP transit, BGP attracts traffic to mitigation capacity. The DDoS layer filters it, then clean traffic is delivered through the chosen integration.

For gaming and hosting, this clarity prevents latency surprises, unstable sessions and routes that only work on paper.

Peeryx uses this distinction during scoping. A customer may need full routing control, or may simply need its prefix protected and clean traffic returned. The design should not be more complex than the operational team can maintain.

Protected IP Transit BGP announcement, clean handoff, tunnels or cross-connect for exposed networks.
Open offer
Game DDoS protection Reverse proxy and game-aware mitigation for Minecraft and FiveM environments.
Open offer
Technical scoping Share your prefixes, traffic pattern and delivery constraints with Peeryx.
Open offer

Concrete use case

A hoster owns a /24 and wants to protect several customers. It announces the prefix to Peeryx, attracts traffic to mitigation and receives clean traffic back while customers keep their IPs.

A customer without an ASN may use Peeryx protected IPs. BGP still exists behind the product, but the customer sees a simpler integration. In both cases, the path must be tested and monitored.

Before production, a route should be tested from several external vantage points. Looking only from the customer router proves that the session is up; it does not prove that the Internet sees the intended origin and path.

Frequent mistakes

BGP mistakes often appear only under load, when a provider changes preference or when an attack forces the network onto paths that were never tested.

Another mistake is treating BGP changes like harmless configuration edits. Route propagation, filters and cache effects can make rollback slower than expected, so changes need staged procedures.

  • Thinking BGP filters packets like a firewall.
  • Announcing a prefix without defining clean return path.
  • Ignoring IPv4/IPv6 prefix limits.
  • Using more-specific routes without policy.
  • Skipping RPKI/ROA and basic routing hygiene.

FAQ

Is BGP mandatory for DDoS protection?

No. Protected IPs and tunnels can work, but BGP is valuable when protecting your own prefixes.

Does BGP choose the shortest path?

Not necessarily. It follows policy and attributes.

Do I need a full routing table?

Not always. Some customers use default route; others need full table for egress control.

Does BGP stop DDoS?

No. It steers traffic. Filtering requires a DDoS layer.

Conclusion

BGP is not magic, but it is one of the most important levers in a serious DDoS design. It decides where traffic goes and how mitigation can be inserted without renumbering every customer. A good provider must explain routing as clearly as filtering capacity.

Resources

Related reading

To go deeper, here are other useful pages and articles.

BGP & mitigation 8 min read

BGP Flowspec for DDoS: useful or dangerous?

What Flowspec does well, what it should never do alone and how to fit it into a safe multi-layer strategy.

Read the article
BGP fundamentals Reading time: 14 min

How BGP works: prefixes, AS paths, routing decisions and DDoS impact

BGP is the protocol that lets networks announce reachability to each other. Understanding prefixes, AS paths, communities and route preference is essential before buying protected transit.

Read article
BGP & DDoS mitigation Reading time: 14 min

BGP Blackhole vs BGP FlowSpec: choosing the right DDoS filtering tool

Blackholing saves capacity by sacrificing a destination. FlowSpec can remove attack traffic more precisely, but only when rules are short, measurable and reversible.

Read article
Network architecture Reading time: 14 min

Anycast DDoS protection: when it helps, when it does not

Anycast distributes traffic toward several points of presence, but it is not a magic shield. The clean delivery model after mitigation still decides latency, stability and customer experience.

Read article
Routing security Reading time: 14 min

Route hijacking and DDoS: how BGP incidents can turn into outages

A route hijack can divert, intercept or blackhole traffic before packets reach your infrastructure. DDoS planning must include routing security, monitoring and fast withdrawal procedures.

Read article
VXLAN / IPIP 11 min read

DDoS protection over VXLAN or IPIP: when should you use them?

VXLAN and IPIP do not solve exactly the same clean traffic delivery problem after DDoS mitigation. This guide explains when each one makes sense, which limits matter and how to choose a model that matches your topology, edge design and operations. It also helps compare VXLAN, IPIP, GRE, clean handoff and post-mitigation traffic delivery with an operator-grade architecture, operations and buying logic.

Read the article
Protected IP transit 12 min read

Protected IP transit benefits for operators, hosters and exposed services

Protected IP transit combines Internet connectivity and Anti-DDoS mitigation in the same delivery model. The benefit is not only attack absorption, but clearer routing, cleaner handoff and fewer emergency migrations.

Read the article
DDoS guide Reading time: 7 min

Clean handoff design after DDoS mitigation

Clean traffic delivery is only useful if the handoff stays readable, supportable and aligned with the customer topology.

Read article
DDoS guide Reading time: 7 min

Operator buying checklist for Anti-DDoS and protected transit

A practical checklist for hosters, operators and technical buyers comparing Anti-DDoS providers, handoff models and protected transit offers.

Read article

Need clean BGP routing to protect your prefixes?

Send us your prefixes, current upstreams, traffic baseline and latency constraints. We will map the clean-traffic delivery model before talking about price.