Network

Peering and BGP: How the Internet Works Behind the Scenes

The Internet is not a single network but thousands of networks interconnected via BGP. Discover what peering is, how IXPs reduce latency, why BGP security is critical and how your provider's peering policy directly impacts the performance of your infrastructure.

business EasyDataHost calendar_today May 1, 2026 schedule 9 min read

When a user in Madrid accesses a server in Frankfurt, data does not travel over a single global network: it crosses multiple independent networks that have agreed to exchange traffic with each other. At its core, the Internet is not one network but a collection of tens of thousands of autonomous networks that cooperate to transport packets from any source to any destination on the planet.

The protocol that makes this cooperation possible is called BGP (Border Gateway Protocol), and the mechanism by which two networks agree to exchange traffic directly is known as peering. Although most users never hear about BGP, it is literally the protocol that keeps the Internet running. Every time a video plays without buffering, a banking transaction arrives in milliseconds, or a server responds with low latency from another country, BGP and peering decisions are behind it.

In this article we explain what BGP is, how autonomous systems work, what types of peering exist, why IXPs are fundamental, how routing decisions are made, what security threats exist, and why your hosting provider's peering policy directly impacts the performance of your infrastructure.

What Is BGP (Border Gateway Protocol)

BGP is the routing protocol that enables the autonomous networks of the Internet to exchange information about how to reach blocks of IP addresses. It is known as the "postal system of the Internet": just as the postal service needs to know which routes to follow to deliver a letter from one country to another, BGP tells routers in each network where to send packets so they reach their destination across multiple intermediate networks.

Technically, BGP is a path vector protocol. Unlike interior routing protocols such as OSPF or IS-IS that optimise routes within a network, BGP operates between networks and does not seek the shortest route in terms of physical distance, but rather the best route according to policies defined by each operator. Each network announces the IP prefixes it owns and the routes it knows towards other prefixes, including the complete sequence of autonomous systems that must be traversed (the AS path).

BGP uses TCP connections on port 179 and establishes sessions between peers (neighbouring routers). When two BGP routers establish a session, they exchange their full routing table and, from that point on, send incremental updates every time a route changes, appears or disappears. This efficiency in updates is what allows BGP to scale to manage the global Internet routing table, which today exceeds 950,000 IPv4 routes and 200,000 IPv6 routes.

What Is an Autonomous System (AS)

An autonomous system (AS) is a network or set of networks under a single technical administration that presents a coherent routing policy to the outside world. Each AS is identified by a unique autonomous system number (ASN), assigned by regional Internet registries (RIPE NCC in Europe, ARIN in North America, APNIC in Asia-Pacific, etc.).

ASNs can be 16-bit (1-65,535) or 32-bit (up to 4,294,967,295), and are classified as public (visible in the global routing table) or private (for internal use). Any organisation that needs to connect to the Internet with its own IP address space and independent routing policy requires a public ASN.

  • dns ISPs and telecommunications operators: Telefonica (AS3352), Vodafone Spain (AS12430), Orange Spain (AS12479). They manage the last mile connecting end users.
  • cloud Cloud and datacenter providers: AWS (AS16509), Google (AS15169), Cloudflare (AS13335), EasyDataHost (AS205081). They host the services and applications that users consume.
  • public CDNs and content platforms: Akamai (AS20940), Netflix (AS2906), Meta (AS32934). They distribute cached content close to users.
  • business Large enterprises: banks, universities and multinational corporations with their own networks and independent routing requirements.

Types of Peering

Peering is the agreement between two autonomous networks to exchange traffic directly, without intermediaries. There are several types that differ by the infrastructure used and the economic conditions:

  • hub Public peering (IXP): takes place at an Internet Exchange Point, a shared infrastructure (typically a high-performance switch) where multiple networks connect and can exchange traffic with each other. Each network pays for a port at the IXP and can establish BGP sessions with any other member. It is the most efficient way to establish peering with many networks simultaneously.
  • cable Private peering (PNI): Private Network Interconnect. Two networks connect directly via a dedicated fibre or cross-connect, without going through an IXP. It is used when the volume of traffic between two networks justifies a dedicated connection, offering higher bandwidth and lower latency.
  • cell_tower Remote peering: a network connects to a remote IXP through a layer 2 connection, without having a physical presence at the IXP location. Services like Megaport facilitate this type of connection.
  • payments Settlement-free vs paid peering: in settlement-free peering, both parties agree that the mutual benefit of traffic exchange is sufficient and no charges apply. In paid peering, one network pays the other for the exchange, typically when there is a significant asymmetry in the volume or value of the traffic.

Internet Exchange Points (IXPs)

Internet Exchange Points are the physical infrastructure where public peering takes place. An IXP provides a high-performance switching platform where tens or hundreds of networks connect to exchange traffic directly, efficiently and cost-effectively.

IXPs serve a critical function: they reduce latency by eliminating intermediate hops, reduce transit costs by allowing traffic to flow directly between networks without going through paid carriers, and improve resilience by creating multiple alternative routes for traffic. The more networks that participate in an IXP, the greater the benefit for all members.

  • location_on ESPANIX (Madrid): Spain's main IXP, with over 100 connected networks and traffic peaks exceeding 400 Gbps. It is the reference exchange point for Spanish domestic traffic.
  • location_on DE-CIX (Frankfurt): one of the world's largest IXPs by traffic volume, with more than 1,100 connected networks and peaks exceeding 14 Tbps. It is the reference interconnection hub in Europe.
  • location_on AMS-IX (Amsterdam): one of the oldest and largest IXPs in Europe, with over 900 members and a mature peering ecosystem that attracts networks from around the world.

Key fact:

Peering at IXPs can reduce latency between two networks by 30-70% compared to using transit through an intermediary carrier. Furthermore, the cost per Mbps exchanged at an IXP is a fraction of the cost of traditional IP transit.

Comparison Table: Peering vs Transit vs CDN

The following table compares the three main network interconnection strategies across the aspects that matter most in production environments:

Criterion Peering IP Transit CDN
Cost Low (IXP fee or cross-connect) Medium-high (pay per Mbps or commit) Variable (pay per GB transferred)
Latency Minimal (direct route) Variable (depends on carrier) Very low (local cache)
Control High (own policy) Low (depends on upstream) Limited (CDN configuration)
Scalability High (more peers = more routes) Linear (more bandwidth = more cost) Global (distributed PoPs)
Reliability High with multiple peers Depends on carrier SLA High (CDN redundancy)
Traffic type All (bidirectional between peers) All (access to full table) Static and cacheable content

Why Peering Matters

Peering is not an abstract concept that only affects network engineers. It has a direct and measurable impact on the end-user experience and the operational costs of any business with an Internet presence:

  • speed Lower latency for end users: when your provider has direct peering with your customers' ISPs, packets travel the shortest possible route. This translates into faster load times, a better user experience and improved SEO rankings.
  • savings Reduced transit costs: every gigabyte exchanged via peering is a gigabyte that does not need to be paid to the transit carrier. For operators with high traffic volumes, the savings can amount to tens of thousands of euros per month.
  • shield Network resilience: the more alternative routes a network has, the greater its ability to absorb failures. If a transit carrier goes down, traffic can flow through alternative peering sessions, maintaining connectivity.
  • trending_up Better overall performance: a network with a good peering policy delivers lower latencies, less jitter and higher throughput than one that relies exclusively on one or two transit carriers.

BGP Routing Decisions

When a BGP router receives multiple routes towards the same destination prefix, it must choose the best one. BGP uses a selection process with multiple criteria evaluated in order of priority:

  • filter_1 Local preference: the highest-priority attribute. Each operator assigns a local preference to routes received from each peer. This allows prioritising, for example, peering routes over transit routes.
  • filter_2 AS path length: when local preference is equal, the route with the shortest AS path is preferred (fewer intermediate networks). A direct route with a single AS hop is preferred over one that traverses three networks.
  • filter_3 MED (Multi-Exit Discriminator): an attribute that a neighbouring AS can send to indicate which of its multiple entry points it prefers for receiving traffic. It is a suggestion, not an obligation.
  • filter_4 BGP communities: labels attached to routes to communicate policies between networks. They allow signalling routing preferences, blackholing for DDoS mitigation, or geographical propagation restrictions.

Additionally, operators apply route filtering to control which routes they accept and which routes they announce. Correct filtering is essential for network stability and to prevent incidents such as route leaks, where a network accidentally announces routes it should not.

BGP Security: RPKI, ROA and BGPsec

BGP was designed in the 1980s in a context of mutual trust among operators and, by default, does not include route authentication mechanisms. Any network can announce any prefix, and other routers will accept it if they do not have explicitly configured filters. This has led to serious incidents:

  • warning Pakistan-YouTube (2008): Pakistan Telecom announced a more specific prefix than YouTube's to block the site within Pakistan. The announcement propagated globally and YouTube became inaccessible to a large portion of the Internet for hours.
  • warning Frequent route leaks: misconfigurations that cause an AS to announce transit routes it should not, resulting in traffic from large networks flowing through suboptimal paths or being lost.

To mitigate these risks, the industry has developed RPKI (Resource Public Key Infrastructure), a cryptographic system that allows IP address holders to sign ROAs (Route Origin Authorizations) that declare which AS is authorised to originate each prefix. Operators that implement RPKI validation can automatically reject routes with invalid origins, preventing the majority of accidental hijacks.

BGPsec goes a step further by cryptographically signing each hop of the AS path, not just the origin. However, its adoption is very limited due to computational cost and the need for universal deployment to be effective. In practice, RPKI + strict prefix filtering + blackholing communities are the most widely used tools for protecting BGP sessions.

Key concept:

RPKI and ROAs are the first line of defence against route hijacking. A hosting provider that implements RPKI validation and signs its own prefixes demonstrates a genuine commitment to network security and the protection of its customers' traffic.

Peering for Businesses: Why Your Provider Matters

When a business chooses a hosting or colocation provider, the quality of the provider's network is just as important as the quality of the hardware. A datacenter with a single transit carrier is like a building with only one exit: it works, but any incident blocks everything.

Multi-homed connectivity (multiple transit carriers + peering at IXPs) ensures that traffic always has alternative routes. If a transit carrier goes down, traffic is automatically redirected through another route. If a peer has issues, transit absorbs the traffic. This redundancy is what distinguishes a provider with a resilient network from one that depends on a single connection.

Furthermore, being in a carrier-neutral datacenter provides access to multiple carriers and the ability to establish direct cross-connects with other operators, content delivery networks and cloud providers. This interconnection flexibility is a strategic asset that impacts latency, costs and service availability, as we explain in our article on the advantages of a European datacenter.

EasyDataHost AS205081: Our Peering Policy

EasyDataHost operates AS205081 and maintains an open peering policy aimed at maximising connectivity quality for its customers. Our network combines multiple premium transit carriers with direct peering at major European IXPs, ensuring optimal routes to any destination.

  • check_circle Peering at ESPANIX: direct connection to Spain's main IXP for minimal latency with domestic networks.
  • check_circle Multiple transit carriers: multi-homed connectivity with Tier 1 and Tier 2 carriers for total redundancy.
  • check_circle Signed RPKI and ROA: all our prefixes are protected with RPKI and we validate routes received from our peers.
  • check_circle Carrier-neutral datacenter: Tier III+ facility in Madrid with access to multiple operators and direct cross-connect capability.
  • check_circle Network as a Service: through NaaS we offer dedicated connectivity to public clouds, remote IXPs and international points of presence.

You can find full details of our peering policy, connected IXPs and how to establish a BGP session with us on our peering page.

Conclusion

BGP and peering are the invisible foundations upon which the Internet operates. Behind every web request, every API call and every data transfer, there are BGP routing decisions that determine where traffic travels, with what latency and with what level of reliability. Understanding these concepts is essential for making informed decisions about where to host your infrastructure.

  • arrow_right BGP is the routing protocol that interconnects the autonomous networks of the Internet.
  • arrow_right Peering reduces latency, transit costs and improves network resilience.
  • arrow_right IXPs like ESPANIX and DE-CIX are the critical infrastructure where public peering takes place.
  • arrow_right RPKI and ROAs are essential for protecting BGP sessions against route hijacking.
  • arrow_right EasyDataHost AS205081 maintains an open peering policy with a presence at ESPANIX and multi-homed connectivity.

If you need high-quality connectivity with optimised latency for your infrastructure, contact our team to design the network solution that best fits your requirements.

BGP Peering IXP Network RPKI
lan

High-quality connectivity with direct peering and multi-homed transit

EasyDataHost AS205081: peering at ESPANIX, multiple premium carriers, RPKI, carrier-neutral datacenter in Madrid. Optimised latency for your infrastructure.