Skip to main content

Overview

Gateways and Rendezvous Servers help the Endpoint and Connector find each other. The two sides then use hole punching to connect directly, or fall back to a Relay. This page covers how a connection is set up. For how the tunnel is protected, see Security. For how the VPN tolerates failures, see Reliability. Formal VPN components: Endpoint, Connector, Gateway, Rendezvous Servers, and Relays

Rendezvous Servers

Formal runs a fleet of Rendezvous Servers in regions around the world. They let Endpoints reach Connectors that nothing on the internet can connect to. The Connector runs in your private network and requires no inbound ports. Instead, the Connector dials out and keeps persistent connections to several Rendezvous Servers. Every connection starts in your network. These Rendezvous Servers sit in more than one region:
  • Preferred servers are in the region closest to the Connector. New sessions try them first, so setup is fast.
  • Fallback servers are in other regions. Sessions use them when the preferred servers don’t answer.
The Connector dials out to preferred Rendezvous Servers in its nearest region and to fallback servers in two other regions See Reliability for how a Connector’s Rendezvous Servers are chosen, and how they keep it reachable during an outage.

Signaling protocol

The Endpoint starts a session the first time an application connects to a resource behind the Connector. Connection setup: the Endpoint reaches a Gateway, the Gateway opens a signaling channel to the Connector through a Rendezvous Server, both sides coordinate hole punching, then the tunnel runs end to end
  1. The Endpoint connects to the nearest Gateway, which GeoDNS selects.
  2. The Gateway opens a signaling channel to the Connector, through one of the Rendezvous Servers the Connector is connected to.
  3. Over this channel, the Endpoint and Connector coordinate hole punching. They exchange the network addresses where each side can be reached.
  4. Both sides use hole punching to open a direct path to each other. They set up the end-to-end encrypted tunnel over it, or over a Relay if no direct path is possible.
Signaling carries only connection setup data, such as network addresses, never application traffic. See Security for what each component can see.

Hole punching

A direct path between the Endpoint and Connector is always preferable. It has the lowest latency and the best chance of reaching the full available bandwidth. To open one, both sides send UDP (RFC 768) packets to each other’s public address at the same time. Your firewalls treat the incoming packets as replies to outbound traffic and let them through. Direct paths use UDP over IPv6 (RFC 8200), so networks without IPv6 always use a Relay. Both sides gather and test candidate paths with Interactive Connectivity Establishment (ICE, RFC 8445). Each side learns its public address from STUN (RFC 8489). Hole punching opens a direct path in more than 90% of cases. Some unusual network configurations make a direct path impossible, for example firewalls that drop UDP. The connection then goes through a Relay. Direct path through both firewalls, or a fallback path through a Formal Relay

Relays

Each session can use two Relays: one close to the Endpoint and one close to the Connector. A Relay close to either end sits almost on the direct route between them. The relayed path runs through one or both of them and adds little latency compared to a direct one. A session's two Relays: one close to the Endpoint and one close to the Connector, each almost on the direct route Relays are TURN servers (RFC 8656). The Endpoint reaches a Relay over UDP or TCP (RFC 9293) on port 3478, or over TLS on port 443. See Network requirements for the ports each side needs. Relays can’t look inside the packets they forward, because the tunnel is encrypted end to end.

The tunnel

Over the chosen path, the Endpoint and Connector set up a CONNECT-IP tunnel (RFC 9484) over QUIC (RFC 9000). It carries IP traffic and DNS queries for the Connector’s resources. See Security for how the tunnel is encrypted and authenticated. From here on, Gateways and Rendezvous Servers are out of the path. See Reliability for what happens when a component fails.