A new unreachable IP address every day: Bitcoin home-nodes on ISPs that rotate IPs

tl;dr: Home-nodes at ISPs that rotate IPs (often every 24h) self-announce a new, usually unreachable address after every rotation. The cost is small: about 8% of a node’s IPv4 connection attempts go to these ISPs, and more than 90% of the unreachable addresses in gossip come from ISPs that don’t rotate. The general fix would be that a node only self-announces once a peer has checked that it’s reachable, so that Bitcoin Core doesn’t gossip unreachable addresses in the happy path.


A Bitcoin Core node that listens and has finished its initial sync self-announces its address on every newly established connection that takes part in address relay, and then again at random intervals averaging 24 hours (AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL) to each of these peers [1].

Many home-nodes, usually sitting behind a router and a NAT, are unable to receive inbound connections and do not know about being unreachable. Bitcoin Core defaults to listen=1, which causes home-nodes to announce their address. These address are always unreachable and nobody will be able to connect to them. These addresses will be relayed in address gossip and make into the IP address manager (addrman) new table of other nodes on the network. This means, Bitcoin Core home-nodes are filling the addrman new table slots of all Bitcoin Core nodes with unreachable addresses in the default setup.

This is made worse by the fact that some ISPs rotate home IPs frequently (e.g. once per day). While this is nice for some extra privacy when browsing the web, it causes Bitcoin Core nodes to store even more unreachable addresses with new ones arriving every day through newly connections and timed self-announcements. This post explores the ISP (with Bitcoin nodes) that do this, shows the frequency of these rotations, and shows the effect on the network.

Which ISPs rotate home-node IPs and how often?

There seem to be at least 36 ISPs (with a meaningful number of Bitcoin home-nodes) that rotate IPs every 24 hours. 20 of these are German ISPs and there’s even a word and Wikipedia article for it (see Zwangstrennung). Germany has, along with the US (where frequently rotating IPs is a lot less common) the most home-nodes. Next to Germany, there other ISPs in Europe where this happens.

In Germany, the ISPs are primarily O2 (nearly 100% rotate daily), 1&1 (about 90% of IPs rotate daily), and Deutsche Telekom (about 25% rotate daily). Outside of Germany, the 24 hour rotation applies to nearly all lines of Odido (NL), Hrvatski Telekom (HR), BSNL (IN), Telecom Algeria (DZ), and China Mobile Liaoning (CN). Other ISPs use different intervals for rotation. This ranges from 4 hours (Wind Tre) to 8 days (Telefonica Brasil). Many other ISPs do not rotate IPs at all.

ISP Interval rough estimate of number of nodes that rotate (and their share of all nodes in the ISP)
Deutsche Telekom (DE) 24 h about 300 (about 25%)
1&1 (DE) 24 h about 220 (about 90%)
O2 (DE) 24 h about 170 (over 95%)
TOT (TH) 24 h about 40 (about 50%)
EWE (DE) 24 h about 35 (about 80%)
PURtel (DE) 24 h about 35 (over 95%)
Odido (NL) 24 h about 25 (over 95%)
Hrvatski Telekom (HR) 24 h about 20 (over 95%)
M-net (DE) 24 h about 20 (about 30%)
BSNL (IN) 24 h about 15 (over 95%)
NetCologne (DE) 24 h about 15 (about 25%)
Hutchison Drei (AT) 24 h about 10 (about 25%)
22 smaller ISPs, 13 of them German 24 h under 25 each, about 150 together
Wind Tre (IT) about 4 h about 25 (about 25%)
ANTEL (UY) 12 h about 10 (about 35%)
Free Mobile (FR) 12 h about 10 (all we saw)
A1 Hrvatska, Magic Net (HR) 2 days about 15 together (about 55%)
Iskon (HR) 3 days under 10 (over 90%)
Telefonica Argentina 4 days about 10 (about 80%)
Saudi Telecom 5 days about 25 (over 95%)
Arelion/Telia (SE) 7 days about 15 (about 20%)
True Internet (TH) 7 days about 40 (about 70%)
Telefonica Brasil about 8 days about 75 (about 80%)

The following comments contain:


  1. One of our listening nodes with about 100 address-relaying peers sent about 100 such repeats a day, plus one announcements on each new connections participating in address relay. ↩︎

Where we can spot rotations

ISPs (or routers) forcing a reconnect shows up in different ways in our data.

The inbound connections my peer-observer nodes receive from ISPs never get older than the rotation interval. Usually, these home-nodes start a new connection right after they reconnect to the Internet, and then (often) stay connected until their IP rotates again. So many of their connections to me last just under 24h.

This also shows up in (historical) bitnodes data for reachable addresses. By looking at how long bitnodes considered an address to be reachable, we can clearly spot rotations.

In address-relay gossip, for some IPv6 devices that choose the device’s MAC address in the lower 64 bits of an IPv6, we can see the devices rotating through IPv6 address prefixes. As an example, I picked an address from 1&1 (DE) that rotates every 24h. This is 4am in Germany. It makes sense to cut the connection at time when most people are sleeping and not using their Internet connection.

At what time of day do the rotations happen?

In the 1&1 example above, the rotation happens at 4am local time. For the other ISPs there are three patterns:

  • One hour for nearly all nodes: AIS Fibre (TH), Telenor (NO), and htp (DE) rotate at about 3am, M-net (DE) at 2am, and China Mobile Liaoning (CN) at 5am.
  • Spread over the night: For Deutsche Telekom, 1&1, O2, and a few others, the rotations are spread over a few hours of the night. For these three, about 80% of the rotations happen between midnight and 6am.
  • Any hour of the day: Odido (NL), BSNL (IN), TOT (TH), and Telecom Algeria (DZ) have no preferred hour.

What is the effect on the network?

After a rotation, a home-node opens new connections from its new IP and self-announces the new address to its peers. I estimate that about 1,000 home-nodes get a new IP every day. Nearly all of them are unreachable.

In address gossip, this shows up as a wave of new addresses every night. During the day, one of my nodes learns about 110 to 160 new IPv4 addresses per hour. Between 02:00 and 05:00 UTC, which is at night in Europe, it’s up to 300 per hour and more than half of them are from ISPs that rotate IPs.

Bitcoin Core only treats an address as stale when it hasn’t heard about it for 30 days (ADDRMAN_HORIZON). So a home-node that rotates daily can have about 30 of its old addresses in the addrman of other nodes at the same time. In getaddr responses, I see about 35 to 40 addresses per home-node from 1&1 and O2. For Vodafone (DE) and AT&T, which don’t rotate, it’s 2 to 3.

This means the ISPs that rotate IPs take up a lot more space than their share of nodes:

  • about 6% of all nodes are at ISPs that rotate IPs (rough estimate)
  • 12% of the addresses in the addrman new table of my nodes
  • 18% of the addresses in getaddr responses (getaddr only contains non-terrible addresses)
  • about 30% of the new IPv4 addresses a node receives per day

To put this into perspective: about 85% of the IPv4 addresses gossiped per day don’t answer at all, and more than 90% of these are from ISPs that don’t rotate. Rotating IPs make the problem worse, but the unreachable home-nodes themselves are the bigger part of it.

What does this cost a node?

Bitcoin Core picks the addresses for its outbound connections and feelers from addrman. A node makes a feeler connection every two minutes, which is about 720 per day. About 545 of them go to IPv4 addresses (the rest to IPv6, Tor, and I2P). Together with the other outbound connection attempts, it’s about 870 attempts to IPv4 addresses per day. About 70 of them (8%) go to ISPs that rotate IPs. Only 5% of these connect, compared to 23% for all other ISPs. For O2 and 1&1, 4 of about 800 attempts connected.

That’s a small cost. It’s 8% of the attempts and a failed attempt takes at most 5 seconds (the default connect timeout). Starlink, which doesn’t rotate IPs but contributes a lot of unreachable IPs, is similar: 7 of about 1400 attempts connected.

Similar behavior, but not necessarily a rotation

  • Starlink has many unreachable home-nodes but there does not seem to be a fixed rotation interval (I think). There might be something else going on with their CGNAT and automatic software updates that are applied at around 3am with a router reboot.
  • IPv6 privacy addresses: A device that keeps its prefix and picks a new random lower half for its IPv6 address also shows up with a new address. In getaddr crawls, I see about 1950 of these per day. All ISPs that rotate IPs together have about 1700 new addresses per day in the same crawls.
  • A single node on a timer: One node had 22 connections to me that ended after 24h, but it always came back from the same IP. This is a daily restart and not a rotation.
  • VPN providers: In the bitnodes data, some addresses from ProtonVPN last about 12h.

Potential fixes

Ideally, we would not gossip unreachable IP addresses at all no matter how ISPs behave. While an attacker might still spam unreachable addresses, at least the Bitcoin Core software does not produce them anymore in the non-attack, happy path.

A naive option could be to default to listen=0. I fear that would cause a lot of cloud-hosted nodes to become unreachable too, degrading the inbound capacity on the network even more. Telling home-node operators to run with listen=0 might also not be reasonable. They might want to receive inbound connections on Tor, but not IPv4.

Alternatively, a node could wait with the first self-announcement until it gets an inbound connection. However, since nobody knows about it before it announces itself, it can’t get an inbound connection. There could be a new protocol message reachable or feature-message instead of a self-announcement which a node sends to outbound peers on startup and after loosing it’s (inbound) connections. In it, it would ask the other side of the connection to open a short-lived outbound connect to the address it thinks it is (the address we’d self-announce). If this does not happen, the home-node keeps trying (potentially with a back-off). It only needs one honest peer for the node to learn about it being reachable. Then it can announce it’s address to the network.