GlobeLatency
GlobeLatency › Learning Center › How the internet works

Internet Routing, BGP and Peering: Why Paths Are Indirect

9 min read · How the internet works

In short

The internet is thousands of independently run networks (autonomous systems) that exchange reachability information using BGP, a protocol driven by business agreements and policy rather than shortest distance. Because of this, packets often take indirect paths, and the quality of an ISP's peering and transit largely decides your latency to far-away destinations. Route changes can add or remove tens of milliseconds instantly.

On this page
  1. What is an autonomous system?
  2. How does BGP work?
  3. What are tier-1 networks, transit providers, and peering?
  4. What is an internet exchange point (IXP)?
  5. What is hot-potato routing and why are paths asymmetric?
  6. Why are internet paths longer than the straight line?
  7. How do route changes cause latency spikes?
  8. What are BGP leaks, hijacks, and outages?
  9. How does ISP peering quality show up in tests?
  10. How do you read a traceroute?
  11. Common mistakes and myths
  12. What to do next

Quick answer: The internet is not one network but a federation of tens of thousands of independently operated networks called autonomous systems (ASes). They exchange routing information using the Border Gateway Protocol (BGP). BGP selects paths mainly by commercial relationships and policy, not by geography or measured speed, so real paths are often longer than the straight-line route, and the way your ISP connects to the rest of the world strongly shapes your latency. This page explains the concepts you need to interpret why one destination is fast and another is oddly slow.

What is an autonomous system?

An autonomous system is a set of IP address ranges (prefixes) and routers managed by one organisation under a common routing policy. Each is identified by an AS number, such as AS64496 (a number reserved for documentation). A typical home user sits inside an ISP's AS. Content companies, cloud providers, universities, and enterprises run their own. A large global ISP may operate several.

Inside an AS, the operator uses an internal routing protocol (OSPF or IS-IS are common) tuned for efficiency. Between ASes, BGP is used. The distinction matters because inside a network the goal is usually shortest or lowest-cost path, while between networks the goal is whatever the contracts and policies say.

How does BGP work?

Each AS announces the prefixes it owns to its neighbours. Neighbours re-announce those prefixes to their own neighbours, adding their AS number to an AS path. A router that hears several announcements for the same prefix picks one. The decision considers, in order of typical importance:

  1. Local preference: the operator's own policy, such as "prefer routes learned from customers, then peers, then paid transit" because customer routes earn money and transit costs money.
  2. Shortest AS path: fewer ASes between source and destination, a rough proxy for simplicity, not distance or delay.
  3. Other tie-breakers, including origin type and, within a network, the closest exit point.

Nothing in this process measures latency. A route through 3 ASes that circles half a continent can beat a 4-AS route that is geographically direct. That single fact explains most "why is this path so indirect?" questions. For the broader picture of how traffic gets from device to server, see how the internet works.

What are tier-1 networks, transit providers, and peering?

Networks interconnect in two main commercial ways:

ArrangementWho paysWhat is reachableTypical effect on latency
Transit (customer to provider)Customer pays providerThe whole internet, via the providerReliable reach; path may be longer if provider is far or congested
Settlement-free peeringUsually neither side pays the otherOnly each side's own customers and prefixesOften the shortest, lowest-latency route between the two
Paid peeringOne side pays for a direct connectionSame as peeringSimilar to peering, with dedicated capacity

A tier-1 network is conventionally defined as one that can reach every other network on the internet through settlement-free peering alone, without buying transit. Only a small number of networks are widely described that way, and the exact list is debated and changes over time, so treat "tier" labels as informal. Smaller ISPs buy transit from larger ones, and also try to peer directly with the content networks their users want most.

What is an internet exchange point (IXP)?

An internet exchange point is a physical location, usually one or more data-centre sites with shared switches, where many networks connect to exchange traffic directly. Instead of building a separate cable to every partner, a network connects once and can peer with many others across the same fabric. Benefits include lower cost, shorter paths that stay inside a region, and improved resilience. When a local ISP and a local content network both attend the same exchange, traffic that would otherwise detour through another country can stay in town, often cutting round-trip time by tens of milliseconds.

Exchanges exist in most major cities, with large ones in Europe, North America, and Asia. A country with few exchanges or weak local peering will often send domestic traffic out through a foreign hub and back, a pattern called tromboning.

What is hot-potato routing and why are paths asymmetric?

When traffic must cross from network A to network B at one of several possible interconnection points, the sending network usually chooses the exit closest to the source, minimising its own backbone use. This is hot-potato routing. The alternative, cold-potato, keeps traffic in your own network until it is close to the destination, which gives better performance at higher cost; some large content networks do this for their own customers' benefit.

Because each network makes its own choice, the outbound path and the return path can differ. This is asymmetric routing. It is normal. The measured round trip is the sum of both directions, so a long return path inflates the time even when the forward path looks short, and a traceroute shows only the forward half.

Why are internet paths longer than the straight line?

Several independent factors stack up:

  • Cable routes follow rights of way, coastlines and existing duct corridors, not geodesics (undersea cables and the speed of light).
  • Networks meet where they have equipment, typically in a limited set of cities.
  • Policy beats distance: BGP prefers cheaper or customer-learned routes.
  • Hot-potato exits hand traffic over early.
  • Queueing and processing at each router add small, variable delay.

As a rule of thumb, measured RTT between two cities is commonly 1.3 to 2 times the theoretical minimum for the great-circle distance, and occasionally much more. Worked example: two cities 800 km apart have a physical minimum of roughly 8 ms RTT (about 1 ms per 100 km of fibre path). A direct, well-peered route might measure 10 to 14 ms. If the ISP has no direct path and traffic goes via a hub 600 km away in a different direction, the fibre path may be about 1,500 km, giving about 15 ms of propagation alone, and about 18 to 25 ms measured.

How do route changes cause latency spikes?

BGP paths change for ordinary reasons: a link fails, a provider does maintenance, an operator adjusts traffic engineering, or a peering link becomes congested and traffic is shifted. Effects you can observe:

  • A step change: latency jumps from 35 ms to 60 ms and stays there until the route changes back. This is the signature of a new path, as opposed to congestion, which tends to fluctuate with time of day.
  • Brief loss or spikes during convergence: after a change, routers across the internet take seconds to minutes to settle, during which some packets are dropped or looped.
  • Daily patterns: a peering link that fills up in the evening produces higher latency and jitter at that time (jitter explained), while the same destination is fine in the morning.

A continuous monitor makes these patterns visible: a flat line that jumps and stays is a path change; a wavy line is load. GlobeLatency's monitor shows each destination's recent readings as a sparkline, so you can spot a step change without reading raw numbers.

What are BGP leaks, hijacks, and outages?

BGP historically trusts what neighbours announce. Mistakes or malice can therefore have wide effects, described here generally rather than as specific events:

  • Route leak: a network announces routes to the wrong audience, such as passing provider-learned routes to another provider. Traffic is attracted to a network that cannot handle it, causing congestion, high latency, or loss.
  • Prefix hijack: a network announces address space it does not own, attracting traffic meant for someone else. A more-specific announcement (a smaller prefix) wins over a broader one.
  • Withdrawal outage: a network's announcements disappear, for instance after a misconfiguration, and other networks no longer know a path to it. The destination looks completely unreachable although its servers are running.

Defences include prefix filtering, maximum-prefix limits, and RPKI route origin validation, which lets owners cryptographically declare which AS may originate their prefixes. Adoption is substantial but incomplete. For an ordinary user the symptom is simply that some destinations become slow or unreachable for a while, while others work normally, which is a hint the problem is not your Wi-Fi.

How does ISP peering quality show up in tests?

If your ISP connects well to the networks hosting popular services, you will see low latency to those destinations even when they are far away. Poor peering shows as:

  • One destination or provider being much slower than others at a similar geographic distance.
  • Latency to a nearby destination higher than to a farther one.
  • Evening-only degradation toward specific providers while everything else is unchanged.
  • Large differences between you and other visitors, which the global comparison expresses as a percentage against the world average for that destination.

Switching DNS resolver, changing browsers, or rebooting will not fix peering. A VPN sometimes does, by sending traffic over a different path, and sometimes makes things worse (VPN and latency). If the pattern is persistent, collect evidence and use talking to your ISP.

How do you read a traceroute?

Traceroute (tracert on Windows) sends probes with TTL values of 1, 2, 3 and so on. Each router that decrements the TTL to zero returns a "time exceeded" message, revealing itself. Example output, simplified and invented purely for illustration:

HopHost (example)RTTInterpretation
1192.168.1.12 msYour home router
2isp-gateway.example.net9 msFirst ISP router; access network (cable, DSL, fibre)
3core1.city-a.example.net11 msISP core
4transit.example.org13 msHand-off to another network
5core2.city-b.example.org58 msLarge jump: long-distance link, probably a different city or a sea crossing
6edge.destination.example60 msDestination network

How to read it:

  • Look for a jump that persists in all later hops. A big increase at hop 5 that carries through to the end means delay was added there (distance or congestion). A single hop with a high time and normal times afterwards is usually that router deprioritising replies to probes, not a real problem.
  • Stars (* * *) mean no reply to probes, often because a router is configured not to answer. They are not necessarily loss; check whether later hops answer.
  • Hostnames often include airport or city codes that hint at geography, which helps spot detours.
  • Only the forward path is shown. Tools such as mtr repeat probes and report loss and variation per hop, which is more reliable than a single run.

Traceroute uses ICMP, UDP, or TCP probes, depending on the tool and options, and does not measure what a browser measures. Compare with ping vs HTTPS latency.

Common mistakes and myths

  • "The shortest path is always used." BGP follows policy; the shortest AS path is not the shortest distance.
  • "A high hop count means high latency." Ten hops inside one city can total 5 ms; two hops across an ocean can total 120 ms.
  • Treating one slow traceroute hop as the culprit. Look at where the increase begins and persists.
  • Assuming the return path equals the outbound path.
  • Blaming a website when only your ISP's route to it is poor, or the reverse. Test several destinations before deciding.
  • Confusing congestion with a route change. One is wavy, the other is a step.

What to do next

Run a broad test so you can see whether slowness is specific to one network or general: run a free latency test across several regions and providers and see the live map for geography. If one provider is consistently slow for you, read troubleshoot high latency and then talking to your ISP. To understand why anycast services often avoid these problems, continue with CDN and anycast.

Frequently asked questions

What is BGP in simple terms?

The Border Gateway Protocol (BGP) is how networks on the internet tell each other which IP address ranges they can reach. Each network announces its ranges to neighbours, who pass them on with the path attached. Routers then choose among available paths using policy and rules such as shortest AS path. It is the system that glues separately owned networks into one internet.

What is an autonomous system (AS)?

An autonomous system is a network or group of networks under one administrative control that presents a single routing policy to the internet. Each is identified by an AS number (ASN). ISPs, cloud providers, universities and large companies each run one or more. Public internet routing is essentially a graph of ASes connected by agreements.

What is the difference between peering and transit?

Transit is paid: a network pays a larger provider to carry its traffic to the rest of the internet. Peering is an exchange of traffic between two networks, often settlement-free, covering only each other's own customers and addresses. Peering usually gives shorter, cheaper paths between the two networks, while transit provides reach everywhere else.

Why is my ping to a nearby country high?

Traffic may not travel directly. Your ISP may hand it to a transit provider in a different city or country because it has no direct peering with the destination network. A path that goes through a hub 1,500 km away adds roughly 30 ms of round-trip time compared with a direct route, even if the destination is close on the map.

Can a BGP problem make websites unreachable?

Yes. If a network wrongly announces or withdraws address ranges, traffic can be sent to the wrong place or nowhere. Such mistakes, called route leaks or hijacks when traffic is misdirected, and outages when announcements disappear, have affected large parts of the internet before. Filtering and validation such as RPKI reduce the risk but do not remove it.

What does a traceroute show?

A traceroute lists the routers between you and a destination by sending packets with increasing hop limits (TTL) and recording who replies. It shows hop count, the name or address of each router, and a round-trip time per hop. It reveals roughly where delay is added, but individual hop times can mislead because routers deprioritise replies.

What is hot-potato routing?

Hot-potato routing means a network hands traffic to the next network at the nearest available exchange point, getting rid of it as quickly as possible to save its own backbone costs. The result can be a path that leaves your ISP early and then travels a long way inside the other network, and the return path may differ from the outbound one.

See your own numbersFree, in your browser, no signup.
Run a latency testLive map

Related guides