When many places are all 1.1.1.1

networkanycastbgpcdn

Open https://1.1.1.1/cdn-cgi/trace and one line reads colo=: the Cloudflare location that answered, named by its airport code. Results from three cities in October 2026:

Connecting fromAddresscolo
Taiwan1.1.1.1TPE (Taipei)
Tokyo1.1.1.1NRT (Tokyo Narita)
Paris1.1.1.1CDG (Paris Charles de Gaulle)

Same address, machines in three different cities. Machines in many places sharing one IP is called anycast.

If all you have learned is unicast, one IP for one machine, this is hard to picture. The packet only says 1.1.1.1. It does not say Taipei or Paris. So how does it end up at one of them?

Every router on the way looks up its own routing table and sends the packet in the direction the table gives. Unicast and anycast both work this way.

How a unicast packet finds its way

From the computer onwards, every stop looks something up:

1. Your own computer. On macOS, route -n get 1.1.1.1:

   route to: 1.1.1.1
destination: default
    gateway: 192.168.0.1

The computer does not know where 1.1.1.1 is, so it falls back to default: anything it does not recognise goes to 192.168.0.1, the home router.

2. The home router. Also only a default entry. It hands the packet to the ISP.

3. The ISP's outward-facing routers. These hold a full routing table, listing for every block of addresses (prefix) on the internet which neighbour to hand it to (next hop):

Block of addresses (prefix)Hand to (next hop)
1.1.1.0/24a router in a neighbouring network
8.8.8.0/24a router in another neighbouring network

The router compares the packet's destination against the table, picks the most specific entry if several match, and forwards the packet that way. The next router looks it up again, hop after hop.

Even for unicast, no router knows which city 1.1.1.1 is in. A router's job is to pass the packet to the next one; where it goes after that is the next router's problem.

Where each routing table entry comes from: BGP

The internet is many separately run networks joined together. Each one is an AS (Autonomous System) with its own number; Cloudflare is AS13335.

A connection from Taiwan to 1.1.1.1 can meet three kinds of AS. In order of distance from the user:

RolePositionWhat it doesExample
ISPClosest to the userConnects homes and phones; lines mostly inside one countryA Taiwanese telecom
TransitMiddleCarries other networks' traffic over lines that cross countries; ISPs pay it to reach places they have no line toNTT (AS2914)
CloudflareOther end1.1.1.1 is inside its network; locations in many cities, direct lines to many ISPs, and connections to transit tooAS13335

From Taiwan to 1.1.1.1, the packet leaves the ISP and goes straight into Cloudflare with no transit, as the traceroute further down shows. Transit is needed only when the ISP has no direct line to the destination.

Two networks having a "direct line" means their routers can pass packets and run BGP with each other without going through a third network. Physically this is usually one of two setups: a cable between the two routers in the same data centre, or both connected to the same switch at an Internet Exchange (IX). An IX is a place where many networks meet to exchange traffic; its switch only connects the lines, is not a network, and does not appear among the AS numbers on a path.

Neighbouring ASes use BGP (Border Gateway Protocol) to tell each other "for this block of addresses, hand traffic to me". That is an announcement. Each network that receives one writes the block and "hand it to whom" into its routing table, but it does not necessarily pass it on.

Once the line is in place, the two networks still have to agree whose traffic may use it. The most common agreement is peering: each side carries traffic headed for its own network and for the networks that pay it, and does not forward the other side's traffic to third parties. Cloudflare's peering policy is open peering: any network with a location in the same place as Cloudflare can peer with it. Suppose the line between the Taipei ISP and Cloudflare is peering. Then the Taipei ISP passes the route it learned from Cloudflare only to the customer networks that pay it, never to its own transit. Cloudflare also connects to transit, and networks in other countries learn 1.1.1.0/24 from transit:

  1. Cloudflare (AS13335) announces 1.1.1.0/24 to the ISPs it has direct lines to and to the transit networks it connects to, with the path 13335.
  2. The Taipei ISP receives it, records "1.1.1.0/24 goes to Cloudflare", and passes it to its customer networks.
  3. The transit network receives it, records "1.1.1.0/24 goes to Cloudflare", and passes it to the ISPs that pay it. The path now has two numbers, the transit network's own AS number on the left and 13335 on the right.
  4. Those ISPs record "1.1.1.0/24 goes to this transit network".

Every network the announcement passes through adds one AS number to the path, so the receiving network knows how many networks the route crosses.

If the Taipei ISP passes the Cloudflare route it learned over peering to its own transit, that transit network now holds two routes. The one straight from Cloudflare has the path 13335; the one from the Taipei ISP has two numbers, the Taipei ISP's on the left and 13335 on the right. Transit networks usually prefer routes from customers, because customers pay them, and the Taipei ISP is its customer. So even though the Taipei ISP's route is longer, the transit network may pick it.

Once it does, it passes the route to its other paying customers. Their traffic to 1.1.1.1 then enters this transit network and is handed to the Taipei ISP. The Taipei ISP ends up paying for transit to carry other people's traffic to Cloudflare, and its lines may fill up.

RFC 7908 §3.4 calls passing a route on like this a route leak. In 2015 the Indian ISP Hathway passed 336 prefixes it had learned from Google to its transit provider Airtel, and Google services in Europe and Asia went down widely.

RIPE (the IP registry for Europe) places machines called collectors around the world to observe what announcements networks receive. Once a collector has BGP sessions with local networks, each network tells it the routes it is currently using, and the collector records them for anyone to query. A collector only records the routes it receives; it does not forward packets with them.

Read a recorded path from right to left. The rightmost number is the network that sent the announcement, and each number further left is one more network the announcement passed through. Take 4777 13335, received by the Tokyo collector:

  1. 13335 (Cloudflare) announces: hand 1.1.1.0/24 to me.
  2. 4777 (APNIC, the Asia-Pacific IP registry, its network in Tokyo) receives it and tells the Tokyo collector.
  3. The collector records the path 4777 13335.

Results from the RIPEstat looking glass for 1.1.1.0/24 on 2026-10-27:

Collector locationPath receivedNetwork that told the collector
Tokyo4777 13335AS4777, APNIC
London15692 13335AS15692, Razorblue (UK)
All 23 collectorsevery path ends in 13335351 peers in 254 ASes

Both paths have only two numbers, so there is no other AS between 4777 or 15692 and Cloudflare. A peer is a router that holds a BGP session with a collector, and one network can run several, so there are more peers than ASes. The Tokyo and London paths both end in 13335, but a path holds only AS numbers, so it cannot tell whether the two end at a location in the same city or in different ones.

The Amsterdam collector received the path 20514 1299 13335. Read right to left: Cloudflare announces, 1299 (the transit provider Arelion) receives it and passes it to 20514 (Axians in Sweden), and Axians tells the collector. There is no other number between 1299 and 13335, so Arelion received the 1.1.1.0/24 announcement directly from Cloudflare. In the same day's data, other transit providers such as NTT and Cogent also appear as the first number left of 13335.

Query commands

Fetch the RIPEstat looking glass data, list the path each collector received, and pick out the three paths mentioned above:

curl -s 'https://stat.ripe.net/data/looking-glass/data.json?resource=1.1.1.0/24' > lg.json
jq -r '.data.rrcs[] | .location as $l | .peers[] | "\($l)\t\(.as_path)"' lg.json \
  | grep -E '4777 13335|15692 13335|20514 1299 13335'
London, GB	15692 13335
Amsterdam, NL	20514 1299 13335
Tokyo, JP	4777 13335

Total peers, and the rightmost number of every path:

jq '[.data.rrcs[].peers[]] | length' lg.json
jq '[.data.rrcs[].peers[].as_path | split(" ") | last] | unique' lg.json

Look up who an AS number is registered to:

curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS4777' | jq -r .data.holder
# APNIC-COLO - Asia Pacific Network Information Centre

Collector peers change over time: 351 on 2026-10-27, and 355 the next day.

One block of addresses, announced from many cities

Cloudflare announces the same 1.1.1.0/24 from locations in different cities: the Taipei location to networks around Taipei, the Paris location to networks around Paris. The TPE, NRT and CDG answers in the opening table come from three cities each announcing it.

The Paris ISP now receives two announcements for 1.1.1.0/24. The Paris location tells it directly "hand it to me", with the path 13335. The Taipei location also hands its announcement to a transit network in Asia, and it reaches the Paris ISP through Transit Europe. Following that one means handing the packet to Transit Europe, with two more ASes on the path.

Receiving two announcements for the same block is common in unicast too. Say a company connects to ISP A and ISP B; both announce the company's addresses. A transit provider far away with direct lines to both A and B then receives one announcement from A and one from B, both leading to the same company. Routers have always picked the best of the routes they hear, put it in the routing table, and kept the rest as backups. A router cannot tell whether two routes end at the same machine, and its route choice does not use that information.

Pair each starting point with where 1.1.1.1 lives:

Starting fromOnly Taipei has 1.1.1.1 (unicast)Taipei and Paris both have it (anycast)
TaipeiTaipei ISP → Cloudflare TaipeiTaipei ISP → Cloudflare Taipei (same)
ParisParis ISP → Transit Europe → Transit Asia → Cloudflare TaipeiParis ISP → Cloudflare Paris

Of the four, only Paris with anycast changes. Following BGP's rules, the Paris ISP picks the Paris location's announcement, which has fewer ASes, and the packet goes to the Paris location.

A traceroute from Taiwan shows where the packet is handed to Cloudflare:

 1    192.168.0.1      home router
 2–7  10.x.x.x         inside the ISP
 8    162.158.240.6    Cloudflare's network (162.158.0.0/15 is registered to Cloudflare)
 9    1.1.1.1          21.2 ms

Hop 7 is still inside the ISP and hop 8 is already Cloudflare, with no transit in between. https://1.1.1.1/cdn-cgi/trace at the same time returned colo=TPE.

How "near" is decided

BGP's selection steps (RFC 4271 §9.1) compare, in order:

  1. The preference each network assigns to a route; the RFC leaves it to each network
  2. How many ASes the path crosses
  3. How far it is inside the network's own lines to the hand-off point

Only three are listed here; between the second and third the RFC has a few finer comparisons such as Origin and MED. Through all of them, geographic distance never comes up.

Most of the time the nearby location is also the one with the short path and the close hand-off, so it looks like "sent to the nearest location".

In October 2026, 40 measurement machines (probes) that Globalping places around the world each connected to 1.1.1.1 once. Going by geography, each should reach the Cloudflare location nearest to it. 22 of the 40 reached a location in their own city. The other 18 reached another city; some of their cities may have no Cloudflare location, but that was not checked one by one. In these two groups, probes in the same area reached different locations:

Probe inNetworkLocation reachedDistance
Nuremberg (Germany)netcupFrankfurt (FRA)Nuremberg to Frankfurt, about 190 km
Nuremberg (Germany)HetznerParis (CDG)Nuremberg to Paris, about 640 km
Montreal (Canada)OVHToronto (YYZ)the two cities are about 500 km apart
Toronto (Canada)HostPapaMontreal (YUL)the two cities are about 500 km apart

Distances are straight lines between the cities.

  • Nuremberg: two probes in the same city, on different networks. The netcup one reached the nearer Frankfurt; the Hetzner one reached Paris, 640 km away.
  • Montreal and Toronto: both cities have Cloudflare locations, so by distance each probe should stay local. Instead each reached the other city.

Seven minutes after the Hetzner result, a second round asked for Hetzner's network in Nuremberg again; all three probes it got reached Paris. A traceroute run at the same time showed the packets travelling on Hetzner's own lines from Nuremberg to Paris and being handed to Cloudflare only in Paris. The measurement data has no probe IDs, so it is not certain whether those three included the first-round probe.

Cloudflare has a location in Frankfurt too, and from outside there is no way to confirm why Hetzner does not hand traffic over there. A traceroute shows only the route Hetzner finally picked, and networks pass on only the route they chose, so public routing data cannot show whether Hetzner holds a Frankfurt route as well.

Isn't an IP supposed to be unique?

  • Registered once. 1.1.1.0/24 is registered under APNIC (the IP registry for Asia-Pacific), and the whois record says "Routed globally by AS13335/Cloudflare".
  • Only AS13335 may announce it. RPKI (Resource Public Key Infrastructure) is a set of signed records for routing. Its ROA (Route Origin Authorization) for 1.1.1.0/24 says only AS13335 may announce it. If another AS announces the block under its own number, networks that run RPKI validation mark the route invalid; whether they then drop it or only lower its preference is each network's choice (RFC 6811 §5).
  • RPKI validation compares only two things: the block of addresses (prefix), and the rightmost AS on the path, the one that sent the announcement. So a network trying to impersonate Cloudflare can put 13335 at the right end of the path it announces and still pass RPKI validation, and some traffic meant for 1.1.1.1 may then be sent to that network (RFC 6811 §6). RPKI validation also ignores which city an announcement came from, so every announcement Cloudflare sends from each city passes.

Common uses

  • CDNs: one IP announced everywhere, and most users get sent to a nearby location by the routers in their own network.
  • Spreading out DDoS traffic: a botnet's machines are all over the world, and each machine's traffic is sent by its own network to the matching location, so the attack lands at many locations instead of one. RFC 4786 (on operating anycast services) lists this as one of the reasons to use anycast.
  • Cloud global entry points: AWS Global Accelerator and Google Cloud's global external Application Load Balancer use anycast to bring users to a nearby edge. That edge is an entrance to the provider's private network. With Global Accelerator, the user's TCP connection ends at the edge, and a new connection goes on to the endpoint over AWS's own network. Google's Premium network tier works the same way, over Google's own backbone.