Hosts behind routers
Players can often reach a server whose router doesn't forward its game port. Every listed server registers its game port with up to four master servers, every 20 seconds. When a player's game gets no quick answer from a server, it asks a master to introduce it, again every second for up to 12 seconds. The master tells each side where the other is, and both send a few small packets at once, which opens each router to the other. This is hole punching. The Server Browser's status check, joining and mod downloads all work this way.
The masters only answer STUN and make introductions: the game, voice and mods always go straight between the player and the server. There's nothing to set up for it and no port to open: servers that are listed publicly do it by themselves.
Each side learns what its router does from the answers of two or more masters (STUN), so it knows which ports to try. Which pairs connect:
| The server's side | The player's side | Joins |
|---|---|---|
| Public address, forwarded port, UPnP or PCP | Any | Yes, directly |
| An ordinary home router (cone NAT) | An ordinary home router | Yes |
| Behind the same router as the player | Behind the same router | Yes, on local addresses |
| A new port per destination (symmetric NAT) | Cone NAT, full or address-restricted | Yes |
| Symmetric NAT with ports handed out in order | Port-restricted cone NAT | Yes, usually: the player tries the likely ports |
| Port-restricted cone NAT | Symmetric NAT with ports in order | Yes, usually: the server tries the likely ports |
| Cone NAT that filters by address alone | Symmetric NAT | Yes |
| Symmetric NAT with random ports | Port-restricted cone or symmetric NAT | No |
| Port-restricted cone NAT | Symmetric NAT with random ports | No |
| Symmetric NAT | Symmetric NAT | No, at most by chance |
| UDP blocked on either side | No | |
Not every pair can connect. Two symmetric NATs, common on mobile connections and some providers' shared addresses, can't reach each other, and a pair that can't connect is told so after 12 seconds: no answer from the host: its router and yours let no direct connection through (forwarding the game's port, UPnP or IPv6 on either side would). A server anyone can reach is still the surest way to host: a public address, a forwarded port, upnp = true, or IPv6. Behind a provider's shared address, you may need to ask your provider for a public IPv4 address. Hole punching has been tested through simulated routers so far, not real ones.
upnp = trueasks the router to forward the servers' UDP ports and the master's TCP and UDP port, through UPnP, or PCP when no router answers UPnP. The mapping is renewed every 45 seconds and removed whendedicatedstops. The router's public IPv4 address then becomes the address listed, unlesspublic_addressnames one. If it fails, the log saysManual setup may be needed.- Hidden servers aren't listed and don't register, so players reach them only by Direct Connect, and only directly.
- Servers that share one public address need different game ports, as they do for forwarding.
- Masters limit requests to protect themselves and hosts.
Check from another network
If players can't find or join a server, look from a PC with the game on another network, such as a friend's or a phone's hotspot. This asks a master for its list, then asks each server the way the Server Browser does, introductions included, and prints every server that answers with its ping:
project-reclaimer --list-servers http://148.251.153.44:44340
The Server Browser shows only servers that answer this, and the list names what each server's players need, such as needs Halo 3: ODST or needs the mod "title". project-reclaimer --find-lan lists the servers on your own network the same way. A server that dedicated status shows as running, or that the masters list, can still be out of players' reach. Each server's log says how it fares with the masters:
[online] listing on http://127.0.0.1:49175, http://148.251.153.44:44340, http://75.98.127.228:44340, http://23.159.176.140:44340
[online] registering with the rendezvous at 148.251.153.44:44340
[online] registered with the server list at 148.251.153.44:44340 as 203.0.113.4:49176
[online] NAT: one address for every destination
The last line is what your router does: one address for every destination is a cone, and a new port for every destination is symmetric, with 2 apart or the like when its ports come in order and in no order when they don't.
