# The Meta Ray-Ban Display's internet goes through my phone

> The Meta Ray-Ban Display's apps reach the internet through the phone, one IP packet at a time. How Visor lets them out, with a NAT made of the phone's own sockets, a fetcher that speaks instagram://, and a detour to OpenStreetMap for every cafe.

Write-up · 26 Nov 2026 · 7 min read

The Meta Ray-Ban Display is a pair of Meta glasses with a small screen in the right lens, and apps of its own: Instagram, WhatsApp, Maps, a browser. Those apps can reach the internet through the phone, and normally the phone lends it through the Meta AI app. When [Visor](https://www.marco.win/work/visor), my open-source Android app, took that app's place, the Display's apps had no internet until Visor learned to lend it too.

## A gate that only opens one way

The Display starts with the phone's internet blocked. Its link manager reports the proxy as BLOCKED, and an app that asks for the internet fails at once. The switch is service 41108. The Display opens a channel on it and listens, with message type 6, and the phone answers with type 3: whether it's connected, whether the connection is metered, and its DNS servers.

Answering the Display's question does nothing, though. The Display only takes the phone's state on a channel the phone opens itself. The same message, sent back on the Display's own channel, is ignored. So Visor sends it on both, and then keeps watching the phone's network and sends it again whenever it changes:

```kotlin
override suspend fun respond(message: DataXMessage, mux: DataXConnection) {
    if (message.info.messageType != MT_LISTEN) return
    val state = phoneInternet()
    log.add("Internet: the Display asked; the phone is ${if (state.connected) "online" else "offline"}" + if (state.metered) ", metered" else "")
    val bytes = encode(state)
    mux.send(DataXConnection.mirror(message.info.channelId), bytes, messageType = MT_COMPANION_STATE)
    mux.sendOnService(SVC, MT_COMPANION_STATE, bytes)
    sent = mux to bytes
    watchNetwork()
}
```

Within a second of hearing "connected" on the right channel, the Display opens the tunnel.

## One IP packet per message

The tunnel is service 41111. The Display starts it with an empty type 3, and from then on every type 1 message carries one IP packet, in both directions, wrapped in what's called an ICEE frame:

| Bytes | Field                                                         |
| ----- | ------------------------------------------------------------- |
| 0-1   | `1C FB`, the frame's magic number, little-endian              |
| 2-3   | the packet's length, little-endian                            |
| 4-5   | the ethertype, big-endian: `08 00` for IPv4, `86 DD` for IPv6 |
| 6-7   | spare, zero                                                   |
| 8 on  | the IP packet                                                 |

So a 60-byte IPv4 packet goes out as `1C FB 3C 00 08 00 00 00` and then the packet. Inside the tunnel, the Display sits at `10.0.2.2` with an MTU of 1400. It tries IPv6 first, and it sends its DNS queries as DNS over TLS, to `8.8.8.8` on port 853.

These are packets, not connections. Somebody has to be the other end of every TCP connection the Display makes, and that somebody is the phone.

## A NAT made of the phone's sockets

Visor doesn't forward packets to the internet. It ends each of the Display's connections on the phone and opens a real one of its own. Each TCP connection from the Display becomes a socket of the phone's, and each UDP flow a datagram socket, so the Display's traffic is the phone's own traffic, through whatever network, VPN or firewall the phone has.

For TCP that means Visor plays a TCP stack towards the Display. When a SYN arrives, it connects a real socket to the same address and port, and only answers the Display once that worked:

```kotlin
private suspend fun run() {
    val connected = runCatching {
        runInterruptible { Socket().apply { connect(InetSocketAddress(remoteAddress, remotePort), CONNECT_MS); tcpNoDelay = true } }
    }.getOrElse {
        send(TcpSegment.RST or TcpSegment.ACK, 0, ByteArray(0))
        return finish("unreachable", failed = true)
    }
    socket = connected
    output = connected.getOutputStream()
    lock.withLock { synAck() }
    while (true) {
        val next = withTimeoutOrNull(IDLE_MS) { inbox.receiveCatching() } ?: return finish("idle")
        // Closed: the tunnel or the link went, and close() has already let go of everything.
        val seg = next.getOrNull() ?: return
        if (seg.rst) return finish("reset by the Display")
        if (seg.syn) {
            lock.withLock { synAck() }
            continue
        }
        if (seg.hasAck) onAck(seg)
        if (seg.data.isNotEmpty() || seg.fin) onData(seg)
        if (peerFin && finSent && sndUna == sndNxt) return finish("closed")
    }
}
```

The SYN-ACK offers a maximum segment size of 1360 bytes for IPv4 and 1340 for IPv6, which is what fits in the tunnel's 1400. It's a deliberately small TCP. The window is a fixed 65,535 bytes. A segment that arrives out of order isn't kept: Visor acknowledges the last good byte again, and the Display sends the rest. Data from the server goes out one segment at a time, as the Display's window allows, and if nothing is acknowledged for a second and a half, only the oldest segment is sent again. A connection ends when both sides have closed it, on a reset, or after ten idle minutes.

UDP is simpler: one connected datagram socket per flow, closed after a minute of quiet. If the phone can't reach an address at all, IPv6 on a phone without it for example, Visor drops the packet, and the Display falls back to IPv4 by itself.

The Display's DNS is encrypted, so the phone never sees a name, only addresses. To make its list of connections readable, Visor looks at the first bytes of each TCP connection, and when they're a TLS ClientHello, it reads the server name out of it. A row that said `tcp://157.240.x.x:443` says `tls://` and the real host name instead.

## Too much for Bluetooth

The session usually rides Bluetooth LE, and Bluetooth LE gives the tunnel about 40 KB/s. That's enough for messages and not much more. Right after a Display reboot with sharing on, the link started dropping every few seconds, and three things in the tunnel were crowding it:

- Tunnel frames had no limit, so the link's own small replies, the ones that keep it alive, waited behind them.
- A retransmission sent the whole window again every 1.5 seconds, up to 48 frames per connection, onto a link that was already not keeping up.
- Tunnels from an earlier connection kept writing under that connection's old keys, and kept retransmitting, for up to ten minutes.

Now at most 8 tunnel frames wait for the link at once, a retransmission sends only the oldest segment, and a new connection closes every tunnel of the old one. I couldn't prove those three were the cause, but all three were real faults.

Heavy traffic belongs on Wi-Fi. The Display asks for that with a lease on service 41107, and Visor grants a Wi-Fi lease by joining the glasses to the phone's own network if they know it, or to a Wi-Fi Direct group if not, then moving the session there with SwitchTransportLink, which keeps every channel and the cipher. The leases have a trap of their own: a link lease marked "medium" means Bluetooth Classic, not Wi-Fi. Reading it as Wi-Fi moved the session for a request that came at the start of every session, reset every channel on the glasses and ended the session.

## Fetch this for me

Not everything goes through the tunnel. Images, mostly, come through service 9000, the data fetcher, which asks the phone to fetch a URL. The request carries the URL, whether to compress the answer, how to scale an image, and the size of the pieces it wants back. The phone answers with the body in pieces, then a status.

That status has to be 0. The protocol has a second kind of success, `0x1000`, which another service answers with, and ending a fetch with it makes the Display's image loader treat every image as failed and fetch it again, forever.

The URLs aren't all web addresses:

- `https://` is fetched as it is, and an image is scaled down if that makes it smaller.
- `instagram://` wraps a `target_url`, with optional headers and a number of bytes to skip, which becomes a `Range` request.
- `sgmessaging://whatsapp` is an encrypted WhatsApp file on WhatsApp's servers. The phone fetches it, and the Display decrypts it itself.
- `sgmessaging://phone` is a picture from the phone's own messages.

A bare `instagram://reels`, with no target, arrives every few seconds. It's a check, and the right answer is no. That's how the Meta AI app answers it, so Visor says no too.

Instagram came last, the same afternoon as the tunnel. First the pictures loaded, through the fetcher. Then the tunnel let DNS, the Display's connectivity check and Instagram's own MQTT connection through, and Instagram still said it had no connection. Once the fetcher understood `instagram://` links, Reels, messages and likes all worked.

## An empty answer beats no answer

A lot of the Display's apps share one habit. When the phone doesn't answer a service at all, the app doesn't fail. It shows a spinner, forever. So a service Visor doesn't really serve still gets an answer of the right type, even an empty one. WhatsApp showed "loading chats" forever while its Wi-Fi lease was refused, and Maps drew its map and then waited for a location that never came.

## Zero cafes nearby

The Display's Maps app draws its map tiles itself, over its own Wi-Fi. Everything else it asks the phone for: where the wearer is, nearby places, routes, and its settings.

Place search arrives on service 55072. The first version asked Android's own geocoder, around the phone, and on the first test on real glasses every search came back empty. Cafe, park, attraction: zero places, each. Zero cafes anywhere near a phone takes some doing, so the search moved to [Nominatim](https://nominatim.openstreetmap.org), OpenStreetMap's search.

Nominatim has rules, and Visor keeps them. It wants a User-Agent that names the app, and at most one request a second. The glasses send their warm-up searches all at once, so a warm-up gets an instant empty answer, as the Meta AI app gives it, and its search fills a cache for five minutes.

Nominatim also ranks results by importance, not by distance, so a wide search around you returns the city's best known cafe rather than the nearest one. So the search starts small and grows: one kilometre, then four, then the radius the glasses asked for, until there are ten results. A cafe 500 m away is found before one in the next town.

Where the wearer is goes over service 11004, which turned out to be zstd. Each direction of each channel is one compressed stream, flushed after every message and never ended. Every message has to go through the same decompressor in order, including the ones the phone doesn't care about, because one lost message breaks every one after it. The phone sends a location about once a second, and the Display only takes one whose time is later than the last it took. With that, location, nearby places and the Maps settings work on the Display. Routes come from the OpenStreetMap community's routing server, but I haven't seen them on a Display yet.
