
Peer-to-Peer
Peer-to-peer networking connects players directly to one another with no dedicated server between them, usually with one player's machine acting as host. It removes hosting cost entirely. In exchange the host gains a latency advantage, holds authority over game state, and takes the match down when they leave.
Also called
p2p, P2P networking
,
What Does Peer-to-Peer Mean in a Multiplayer Game?
In most games that ship it, peer-to-peer means host-client. One player's game holds the match state and acts as the server while that player plays, and everyone else connects to them. Engines often call this a listen server or host mode. A lobby or matchmaking service helps players find a host, but once the match starts, the traffic runs between players' machines.
A smaller family of games has no host at all: deterministic peer-to-peer, sometimes called true peer-to-peer. Every peer runs the full simulation and exchanges only inputs, either in lockstep, where everyone waits for everyone's input before advancing, or with rollback, where each machine predicts and re-simulates when a late input turns out different. It is a specialist design, found mostly in strategy and fighting games, and rarely what a team means when it says P2P.
Either way, the server has not disappeared. Its jobs have moved onto players' machines: connecting players to each other, deciding what happened, carrying the traffic, and keeping the match alive. The sections below take those jobs one at a time.
How Do Players Connect Without a Server?
The first job is getting two home connections to talk. Most players sit behind a router doing network address translation (NAT), which blocks traffic that nobody inside asked for. A peer asks a STUN server for its public address, then both peers send packets at the same moment to open a path through their routers. The technique is called hole punching.
It fails often enough to shape the product. Strict router settings and carrier-grade NAT, common on mobile networks and some home providers, defeat hole punching, and some providers block STUN traffic outright as a security risk. Platform holders publish troubleshooting guides for exactly this: Xbox keeps a page of NAT errors and multiplayer fixes that walks players through their router settings. The player who cannot join a friend does not blame their router. They blame the game.
The fallback is often a relay, a server that forwards packets between peers who cannot reach each other. Relays also hide players' IP addresses. But once traffic runs through a relay, a server is back in the middle, with its own cost, region and latency. A light dedicated server sits in the same place in the network and can also hold the match state, and building one is often simpler than building punch-through with a relay fallback.
Is Peer-to-Peer Gaming Safe?
Whoever holds the match state can change it. In host-client, the host can edit values in memory, lag-switch by cutting their connection for a moment so everyone else freezes while they act, or report a result that never happened. In lockstep and rollback games, every client is trusted with its own inputs. Peers also learn each other's IP addresses unless a relay hides them, which exposes players to denial-of-service attacks. Our breakdown of P2P's hidden costs covers the techniques in detail.
Relays narrow the exposure without closing it. Michal Buras of Highwire Games, evaluating options for Six Days in Fallujah, showed that lobby data on a free relay service could be read in plain text with a common debugging tool, exposing other players' private information (Live Service Game Summit talk, September 2024).
Server authority is what closes it. Bloody Bastards, a mobile game with more than 40 million downloads, ran peer-to-peer with the host trusted with match results. Its studio describes cheats as rampant, alongside physics desync and uneven ping. After moving to small headless authoritative servers, Tibith reports that no hacker has managed to cheat since version 5.0.0 (case study, Tibith Ltd, 2026).
How Many Players Can Peer-to-Peer Hold?
In a full mesh, every peer connects to every other peer. Four players need 6 connections, eight need 28, and sixteen need 120. Each player sends their updates to every other player, over a home connection where upload is usually the narrow side.
Host-client avoids the mesh by routing everything through the host. That moves the whole load onto one player: their upload carries the match, and their hardware runs the simulation while also rendering their own game. The match is as good as the worst-placed host anyone is assigned.
Then the host leaves. Without host migration, the match ends for everyone. With it, another peer has to take over the match state mid-game, and every feature in the game has to survive the handover. In the same talk, Highwire Games estimated that reworking Six Days in Fallujah for host migration would need one extra developer and one extra tester, at around $15,000 a month.
That is the part of peer-to-peer that rarely reaches the "it's free" calculation. There is no hosting bill. There is staff time, support tickets for failed connections, and players lost to matches that ended early.
A word from our sponsor (ourselves!)
A match isn't fair when one player lives next to the datacenter. Edgegap's Edge Cloud draws on up to 615+ distributed locations on demand, placing each server based on where every player in the match connects from rather than in a fixed region. In Edgegap's 1v1 study, that narrowed the fairness gap between opponents by 28%.
When Is Peer-to-Peer the Right Choice?
Peer-to-peer remains a reasonable call for small sessions among players who trust each other: co-op with friends, prototypes, and games where a cheater spoils one match rather than a ranking or an economy. Rollback fighting games have shipped on it for years.
For a commercial game, the question is what it costs in things that never reach an invoice: connections that fail, matches lost when a host quits, and exposure to cheating that grows with the player base. Even the latency case is weaker than it looks. In a 2020 analysis of 122,000 peer-to-peer matches from a 1v1 console game, routing each match through a server placed at the best location between the two players lowered average round-trip time by 23% in 70% of matches (1v1 report). The direct route is not always the shortest one.
The choice is also less final than it used to be. Networking frameworks such as Photon Fusion can run the same game with a player as host, through a cloud relay, or on dedicated servers, so a team that starts on peer-to-peer can move to servers without starting its netcode over. Photon's own documentation lists Edgegap among the hosting providers for Fusion dedicated servers.
Edgegap's Take (just our opinion, take it with a grain of salt!)
Free to Host, Paid in Other Ways
Peer-to-peer is the one architecture whose cost your players pay. No invoice arrives. It shows up instead as players who could not join a friend, matches that ended when a host's connection dropped, and a leaderboard nobody trusts.
That can be the right trade. For co-op among friends it often is. For a commercial game that ranks players, sells items or matches strangers, it usually is not, and adding a relay fixes only the first of the four jobs a server does.
Before choosing, name what does each job in your design: who connects players, who decides what happened, whose bandwidth carries the match, and what happens when someone leaves. Every answer that reads "a player" is a cost you moved, not one you removed.
,










