Skip to content

How it works

Ferry has two halves: an app on the phone and an app on the computer. Between them is a Wi-Fi Direct network that the phone creates, and over it a single encrypted connection called Ferry Link.

flowchart LR
  subgraph PC["Computer"]
    direction TB
    apps["Apps<br/>browser, games, calls"] --> adapter["Ferry virtual adapter"]
    adapter --> stack["Ferry's TCP/IP stack<br/>(user space)"]
  end
  subgraph Phone["Phone"]
    direction TB
    link["Ferry Link server"] --> sockets["Ordinary app sockets"]
    sockets --> net(("Internet<br/>mobile data"))
  end
  PC == "Ferry Link<br/>Noise over TCP" ==> Phone

Android’s hotspot and USB or Bluetooth tethering all go through the system tethering service. Carriers and vendors can block it there. An app that opens sockets like any other app is not tethering, so none of that applies, and to the network the traffic looks like the phone’s own.

  1. The phone makes a network. Ferry creates a Wi-Fi Direct group with its own name (DIRECT-xy-Ferry) and WPA2 password. The computer sees it as a normal access point. It works even when the phone’s Wi-Fi isn’t connected to anything, which is the situation on a train.
  2. The computer joins and dials. Ferry for the computer joins that network, finds the phone at the network’s gateway address, and opens Ferry Link to it.
  3. The handshake proves both sides. The computer knows the phone’s public key from pairing, and the phone keeps a list of computers it paired. A neighbour on the same Wi-Fi password gets nowhere.
  4. Traffic is captured on the computer. A virtual adapter takes the default routes. A small TCP/IP stack in user space turns each TCP connection into a Ferry Link stream and each UDP flow into a datagram flow.
  5. The phone opens real connections. For each stream the phone connects by name or address, as an app. DNS queries are forwarded and answered by the phone’s own resolver.

The first time, the computer shows a QR code. The phone scans it, and the computer asks “Pair with <phone>?”. After that, Ferry reconnects by itself. The details, and why it is built this way, are in Security and pairing.

What the computer gives up while connected

Section titled “What the computer gives up while connected”

A computer has one Wi-Fi radio, so joining the phone’s network leaves any other Wi-Fi. Ethernet keeps working.