Gaming P2P Latency Test: Measure Direct Connection Lag
Gaming latency starts at the network layer before the game server even processes input. Many multiplayer games use dedicated servers, but peer-hosted sessions, game lobbies, and voice chat systems route traffic directly between players, meaning your P2P latency to another player determines your lag more than server RTT does in those contexts. Measuring that direct path requires a WebRTC-style connection, not a ping to a game server IP.
This tool establishes a WebRTC data channel between two browser instances and measures the round-trip time on that direct path continuously1. The ICE candidate type reveals whether the connection is direct (srflx) or routing through a relay server; relay routing adds 20 to 80 ms to every packet2. Running the test with a game partner in the same session shows the actual P2P latency between your two networks, which is the number that determines lag in a peer-hosted game session.
Why P2P latency differs from server ping
A game server ping measures the path from your device to a specific server IP. Peer-to-peer latency measures the path from your device through your ISP, through an internet exchange, and through the remote player's ISP to their device. These paths share some infrastructure but diverge significantly in the residential last-mile segment (the connection between the remote player's ISP and their router), which adds variable latency depending on the ISP's architecture. Consequently, a player whose server ping is 20 ms may have 90 ms P2P latency to another player whose ISP uses a different backbone, even in the same city.
How the residential last-mile adds latency to P2P paths
Game servers are typically located in well-connected datacenters with fast routes from many ISPs, which keeps server ping low for most players. Residential connections take a different path through the ISP backbone and the last-mile segment between the ISP and the home router, which adds variable latency depending on the ISP's peering arrangements and the distance between the two players' ISPs.
How NAT type affects gaming latency
Open or restricted cone NAT allows ICE hole-punching to succeed, establishing a direct connection with no relay overhead. Symmetric NAT forces traffic through a TURN relay3, adding the relay server's location-dependent latency to every packet2. Building on this, many game engines use their own relay infrastructure that behaves similarly; a relay hop adds 40 to 100 ms of purely geographic latency when the server is in a different region. Checking the ICE candidate type in this tool confirms whether a direct path is being used. Switching from relay to direct reduces latency by the full relay RTT, often the single largest latency reduction available.
Measuring latency variance for competitive gaming
Average RTT matters less than latency variance in competitive gaming. A connection with 60 ms average RTT and 1 ms jitter feels smoother than 40 ms average RTT with 20 ms jitter because the latter produces input timing inconsistencies where actions that should resolve predictably arrive at inconsistent intervals4. The sparkline in this tool shows individual probe RTTs alongside the moving average; a flat sparkline indicates consistent low-jitter delivery. Checking the max RTT column during a 60-second test identifies whether worst-case spikes exceed the average by more than 20 ms4, which is the threshold above which competitive games show input lag inconsistency.
Maximum RTT spikes and input timing consistency in competitive gaming
Average RTT describes typical packet delivery time, but competitive gaming responsiveness depends on worst-case spikes rather than averages. A first-person shooter running at 64 ticks per second generates a game state update every 15.6 ms5; if a single packet arrives 50 ms late due to a jitter spike, the game interpolates the missing state and produces a visible position jump that both players perceive as "rubberbanding." Checking the maximum RTT column during a 60-second test session identifies the worst-case spike encountered in that window.
The practical sensitivity threshold varies by genre. Competitive first-person shooters (CS2, Valorant) show registration inconsistency when maximum RTT exceeds the average by more than 20 ms. Fighting games are most sensitive: a 16 ms spike in a 60 fps game produces a one-frame registration error6. Battle royale and MMO games tolerate spikes up to 50 ms above average before players notice input inconsistency5. For each genre, the goal is a flat sparkline with maximum RTT staying close to the average across the full session, not merely a low average.
Identifying the spike source: QoS queue flushes versus ISP events
Periodic RTT spikes at regular intervals (every 8 to 15 seconds) on an otherwise stable connection indicate a router applying QoS queue flushes on a timer. Disabling or adjusting QoS settings on the gaming device, or disabling "gaming mode" on routers with aggressive queue management, often eliminates these periodic spikes7. Irregular spikes with no pattern indicate ISP-level path instability, which no router configuration can resolve independently.
Relay latency reduction through TURN server proximity
When the ICE candidate type shows "relay", the TURN server location dominates total RTT. A direct peer-to-peer path of 30 ms between two players becomes 30 ms plus twice the distance to the TURN server on a relay connection. If both players are in the same city and the TURN server is in a different country, the relay adds 100 to 200 ms to every packet8. Game developers and platform operators typically deploy TURN infrastructure in each region where their player base is concentrated, allowing relay paths to stay under 30 ms for most in-region players.
For custom WebRTC game deployments, selecting the geographically nearest TURN server from a list of candidates before initiating the peer connection reduces relay overhead significantly. The RTT measurements from this tool before a gaming session reveal which TURN endpoint produces the lowest latency. A 10 ms difference in TURN server RTT reduces total relay overhead by 20 ms (relay adds the round-trip to the server twice), a meaningful improvement in competitive gaming.
Testing relay versus direct paths with this tool
Toggling UPnP and retesting the relay path reveals the isolation directly: run the tester with UPnP enabled, then disable UPnP and retest. With UPnP disabled and no port forwarding rules, many home routers produce relay candidates due to restricted NAT failing the hole-punch. The RTT difference between relay and direct reveals exactly how much latency the relay server adds for your specific network location. Enabling UPnP or adding a port forwarding rule for the game application typically moves the ICE candidate type from "relay" to "srflx" and reduces RTT by that measured margin8.
Repeat the comparison after each router or firewall change so you can attribute any latency shift to the specific setting you adjusted. A relay path that drops from 140 ms to 18 ms the moment UPnP turns on is clear proof the NAT traversal was the bottleneck, not the ISP link. Documenting both readings side by side also helps when comparing game clients, since some titles pick relay even on a direct-capable network and others prefer the peer path automatically.
When to use this
Run this test before a gaming session with a remote partner to verify the direct P2P path, when a peer-hosted game session shows lag that a server ping does not explain, or when comparing latency between two potential game partners in different locations.
Examples
Game lobby shows 200 ms lag to a nearby player
The P2P tester shows relay ICE candidate type; the game is routing through a remote relay server. The direct WebRTC path shows 18 ms. The issue is the game's relay infrastructure routing to a distant server. The network path itself is fast.
Latency is 45 ms direct but spikes to 120 ms periodically
The sparkline shows brief RTT spikes every 8 to 10 seconds. This matches a router applying traffic shaping on QoS queue flushes. Enabling the router's gaming mode or disabling QoS for the gaming device often eliminates these periodic spikes.
- 1.
Mozilla Developer Network, "RTCIceCandidate: type property," developer.mozilla.org, accessed June 2026. https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/type
- 2.
Philipp Hancke, "Using TURN server as relay makes latency high," StackOverflow, accessed June 2026. https://stackoverflow.com/questions/56984735/
- 3.
A. Keranen, C. Holmberg, and J. Rosenberg, "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal," RFC 8445, IETF, July 2018. https://www.rfc-editor.org/rfc/rfc8445.html
- 4.
"Netcode," Wikipedia, accessed June 2026. https://en.wikipedia.org/wiki/Netcode
- 5.
"Lag (video games)," Wikipedia, accessed June 2026. https://en.wikipedia.org/wiki/Lag_(video_games)
- 6.
"Explaining how fighting games use delay-based and rollback netcode," Ars Technica, accessed June 2026. https://arstechnica.com/gaming/2019/10/explaining-how-fighting-games-use-delay-based-and-rollback-netcode/
- 7.
J. Gettys, "Bufferbloat: What's Wrong with the Internet?," ACM Queue, vol. 9, no. 11, Association for Computing Machinery, November 2011. https://dl.acm.org/doi/10.1145/2063166.2071893
- 8.
"Valve brings Dota 2's DoS-protected low-latency networking to all Steam devs," Ars Technica, accessed June 2026. https://arstechnica.com/gaming/2019/03/valve-brings-dota-2em-s-dos-protected-low-latency-networking-to-all-steam-devs/