How does a hosting network use BGP?
Behind every rented server sits a network that announces its addresses to the internet and decides how traffic leaves. BGP is the tool it uses for both.
Why does a hosting network connect to several upstreams?
For resilience and reach. A network with one transit provider is cut off when that provider has trouble; with several, BGP withdraws the failed path and traffic shifts to the others within seconds to minutes. Connecting to internet exchanges and peering directly with access networks adds short, direct paths to the end users of those networks. This multihoming is why the routes your traffic takes can change over time without anything changing on your server. Our BGP article covers the protocol basics.
How is outgoing traffic steered?
With local preference, set by the network's routing policy. When several neighbours offer a route to the same destination, the network can prefer, for example, a direct peering link over paid transit, or a less congested path over a shorter one. Operators also measure performance to popular destinations and adjust preferences when a path degrades. This is outbound traffic engineering: deciding which door packets leave by.
How is incoming traffic influenced?
Less directly, because other networks make the final choice. The usual tools are announcing more specific prefixes on preferred links, prepending the network's own number to make a path look longer and less attractive, and sending BGP communities that ask an upstream to treat a route differently. Inbound engineering is always a negotiation; the receiving network can only suggest.
| Technique | Direction | Effect |
|---|---|---|
| Local preference | Outbound | Chooses which neighbour carries traffic out |
| AS path prepending | Inbound | Makes one path look longer to discourage it |
| More specific prefixes | Inbound | Attracts traffic for a block to a chosen link |
| Communities | Both | Tags that request actions from neighbours |
| Blackhole community | Inbound | Asks upstreams to drop traffic to one address |
What are BGP communities?
Labels attached to route announcements that carry instructions or information. Standard communities are two 16-bit numbers, large communities three 32-bit numbers. Upstreams publish which values they honour: "do not announce to this peer", "prepend twice towards Asia", "set low preference", or "blackhole this /32". Hosting networks use them to fine-tune where their routes go and to react quickly during attacks.
How does BGP help against DDoS attacks?
By moving traffic to where it can be cleaned. When an attack targets an address, the network can announce that address's prefix towards a scrubbing system, which filters attack packets and passes clean traffic back to the server. In extreme cases, a blackhole announcement drops all traffic to one address at the upstream edge, sacrificing that address to protect everyone else. Every server here includes DDoS filtering; our DDoS protection on bare metal and Stopping a DDoS attack articles describe how mitigation behaves from the server's point of view.
What is anycast?
Announcing the same prefix from several locations, so each user reaches the nearest one in routing terms. Public DNS resolvers, root servers and content networks rely on it. It suits stateless request-response services best, since a routing change mid-connection can send packets to a different site. Anycast needs your own address space and BGP sessions from each location, which rented servers here do not offer; for similar results, use DNS-based geographic routing across servers in several of our data centres. Our DNS root servers article shows anycast in a well-known setting.
How do networks avoid accepting bad routes?
With filters on every session and origin validation. Networks build prefix filters from registry data so a customer or peer can announce only its own address space, cap the number of prefixes per session, reject private and reserved ranges, and drop routes whose origin fails RPKI validation. These measures limit the damage from mistakes and hijacks anywhere on the internet. You can check how your server's prefix is announced and validated with public looking glass and RPKI tools.
whois -h whois.radb.net -- '-i origin AS64511' | grep -E '^route6?:' | head curl -s "https://stat.ripe.net/data/rpki-validation/data.json?resource=AS64511&prefix=203.0.113.0/24" | head -c 400
What should I take from this as a customer?
That location and network quality matter more than settings on your machine. You cannot influence BGP from a rented server, but you can test real paths from your users' networks before choosing between, say, Paris and Frankfurt, place servers in several regions for resilience, and use DNS to steer users. Our Network connectivity article lists the measurements worth taking.
Related pages
BGP
The Border Gateway Protocol in plain terms: autonomous systems, route announcements, path selection, hijacks and RPKI, and what it means for a rented server.
Read moreNetwork backbone
The long-distance core that links data centres and exchange points: how backbones are built, why capacity and path diversity matter, and testing routes.
Read moreDDoS protection on bare metal
How network edge filtering stops volumetric attacks before they reach your port, and what you still handle yourself.
Read moreNetwork connectivity
What connects a server to its users: ports, uplinks, transit, peering, latency and packet loss, and how to measure each one yourself.
Read moreQuestions and answers
Can I announce my own IP addresses from a rented server?
No. BGP sessions with customer servers are not offered. Servers use addresses from the network blocks the data centre announces.
What is multihoming?
Connecting a network to several upstream providers and peers, so traffic can reroute through the others if one path fails.
What is a BGP blackhole?
An announcement, often triggered with a community, asking upstream networks to drop all traffic to one address, used as a last resort during very large attacks.
What is anycast used for?
Serving the same address from many locations so users reach the nearest one, as with public DNS resolvers and content networks.
Why does the route to my server change sometimes?
Networks adjust routing policy and react to failures or congestion, so BGP may choose a different path between the same two points over time.