Open jonbarrow opened 3 weeks ago
For reference, this blogpost from Tailscale is great and defines all these NAT terms (eim, edm, cones, etc.) and explains why they have compatibility issues https://tailscale.com/blog/how-nat-traversal-works
We can't follow their advice on how to traverse since we don't control the clients, but the information is very good for understanding this
Checked Existing
What enhancement would you like to see?
Check players network properties to try and only match players who have compatible networks. Many users report having
118-XXXX
class errors. These are related to p2p networking issues. In a lot of cases we can't do anything about this, however it seems like in other cases we can.Any other details to share? (OPTIONAL)
Now that @DaniElectra has documented the real names of all the PIA errors, we can start to shed some light on why these errors happen.
Some of the most common errors I see people having are:
nn::pia::ResultStationConnectionFailed
)nn::pia::ResultNatTraversalFailedBothEim
)nn::pia::ResultNatTraversalFailedLocalEdmRemoteEim
)nn::pia::ResultRelayFailedRelayNumLimit
)nn::pia::ResultNatTraversalRequestTimeout
)nn::pia::ResultGameServerProcessAborted
)Errors 0502, 0521 and 0562 all seem pretty generic, likely nothing we can do there afaik. However errors 0513, 0516 and 0519 all have pretty detailed names which shed light on the underlying issue.
Taking a look at the docs for
StationURL
shows that there's 3 main things we can use for this filtering:type
- NAT device flags (bitwise). Flag 1 means the connection is behind NAT, flag 2 means the connection is publicnatm
- NAT mapping mode (enum). 1 = "Endpoint independent mapping", whereas 2 = "Endpoint dependent mapping"natf
- NAT filtering mode (enum). 1 = "Port independent filtering", whereas 2 = "Port dependent filtering"These can be used to tell us what kind of network setup a client is using, which should be roughly enough to determine if 2 clients can connect or not. The error codes also seem to support this:
ResultNatTraversalFailedBothEim
likely means that the error was caused because both clients hadnatm
set to 1 (Eim
= "Endpoint independent mapping")ResultNatTraversalFailedLocalEdmRemoteEim
likely means that the error was caused because the local user hasnatm
set to 2 and the remote user hasnatm
set to 1 (Eim
= "Endpoint independent mapping", andEdm
= "Endpoint dependent mapping")ResultRelayFailedRelayNumLimit
From what I've seen, PIA is able to connect clients in a way that uses other clients as a "relay". For example if there's 3 clients, PlayerA-C, where PlayerA can connect to both PlayerB and PlayerC, but PlayerC cannot connect to PlayerB, then PlayerC can use PlayerA as a "relay" back to PlayerB. This error is likely caused by there being something incompatible in these users' networks preventing this type of connection, which messes with the relay abilities?If we do more filtering to only match clients with compatible networks then we will almost certainly see a reduction in
118-XXXX
errors in general. https://en.wikipedia.org/wiki/Network_address_translation may also be of some use here.Some potential downsides/issues/questions to this are: