Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADR-0010: Reachability: LAN first, path-agnostic transport, relay later

  • Status: accepted
  • Date: 2026-11-08
  • Deciders: maintainer
  • Tags: protocol, networking, privacy

Context

Phone Link works from anywhere because every byte goes through Microsoft’s cloud with a Microsoft account on both ends. Tether has no account and no cloud (ADR-0003, ADR-0008), so the question is how far from the desk the phone can be.

Observations:

  • The large majority of Phone Link use is at a desk, with phone and PC on the same Wi-Fi. The LAN case is where latency-sensitive features (mirroring, calls, clipboard) are viable at all.
  • Cross-network reachability needs a rendezvous point: NAT traversal needs a signalling server, and the fallback for symmetric NATs is a relay. Both are infrastructure with uptime, abuse and cost implications, and a default hosted endpoint is a privacy decision users must be able to opt out of.
  • Users who already run Tailscale/ZeroTier/WireGuard have a flat virtual LAN; a manual address (ADR-0004) makes Tether work across the internet today for them.
  • Pushing wake-ups via FCM would require Play Services and a Google project.
  • Whatever we build must not require protocol changes: the session is TLS between two pinned keys; a relay that forwards opaque bytes cannot read anything.

Decision

  • LAN first. Milestones 1 to 4 target devices on the same network (or any routable path such as a VPN/mesh via manual address). No hosted service is required for any feature.
  • Path-agnostic transport. Core code treats a connection as an opaque byte stream carrying the TLS session (ADR-0002). Addresses are lists, not single values; liveness comes from Ping/Pong, never from discovery; reconnect logic is independent of how the stream was obtained. Timeouts are constants that a relay path may tune.
  • Relay in M5. A tether-relay crate: devices authenticate to the relay with their identity key (challenge signed with the P-256 key), rendezvous by the paired peer id, and the relay pipes bytes between the two; TLS stays end-to-end so the relay sees only metadata (ids, timing, volume). The phone keeps the relay socket open from the foreground service with adaptive keepalive; the desktop is always connected. Self-hostable (Docker image + docs); an optional hosted default may be configured but is never required and is off until the user opts in. UDP hole-punching for direct paths is an optimisation after that.
  • No FCM or other push service, ever.

Consequences

Positive

  • M1 to M4 ship with zero infrastructure and zero privacy questions.
  • The relay slots in without changing a single plugin or protobuf message.
  • Power users get internet reachability today via a mesh VPN and a manual address; this is documented as a supported configuration.

Negative / risks

  • Until M5 Tether is not at parity with Phone Link’s “works from anywhere”. Documented in docs/reference/feature-parity.md.
  • Mobile-data use through a relay costs battery and data; adaptive keepalive and a “LAN only” toggle mitigate.
  • A hosted relay, if we ever run one, is an abuse target and a metadata collector. Mitigation: authenticated devices only, no accounts, no logging of payload, published source, self-host instructions first.
  • Path-agnostic code is slightly more abstract than a LAN-only design. Accepted as the price of not rewriting core in M5.

Alternatives considered

  • Cloud relay from day one (parity-first): infrastructure and privacy burden before the product exists. Rejected.
  • libp2p or WebRTC data channels for NAT traversal: heavy dependencies on Android and Rust, their own identity models, and still need signalling servers. Rejected for now; hole-punching can be added narrowly later.
  • Bluetooth as a transport fallback: low bandwidth, but works with no network at all; relevant for the iOS spike (ANCS) and possibly for notifications when Wi-Fi is off. Deferred; not a reachability solution.
  • Require Tailscale: excellent for power users, unacceptable as a mandatory dependency. Documented as an option, not required.