NAT Traversal Relay Service - zeroKilo/GROBackendWV GitHub Wiki
Overview
For P2P games (not particularly GRO/GRP), Quazal implements UDP hole punching to establish a PRUDP connection between clients.
The process was described by Olivier Langlois (former Quazal developer and tech support) in his blog article.
The main idea is that a client which wants to join a game or lobby first requests the host's PRUDL URL from RDV, then sends a RequestProbeInitiation packet with its own PRUDP URL to RDV server and starts sending PRUDP NAT probes (NAT pings). After receiving RequestProbeInitiation
, RDV sends an RMC request to the target host client using NAT Traversal Relay Service with the joining client's endpoint. The request triggers host to start sending NAT probes to the joining client. Both clients send probes to each other at the same time so that a NAT hole is created on both routers and the packets can pass through. The external endpoints stay the same as per RFC-4787 REQ-1.
Methods
The relay methods are duplicates of NAT Traversal Service. The ones present in GRO's ubi_osdk.dll
are:
RequestProbeInitiation
InitiateProbe
(not implemented)RequestProbeInitiationExt
Both NAT Traversal and NAT Traversal Relay protocols share protocol ID 3, but have separate packet processors. NAT Traversal Relay protocol is an RMC server protocol, which means RDV sends a request and needs to ACK the response from the host on the PRUDP level.