Hi,
i got pretty much the same problem here.
One headless "server". Runs on linux as a hosted server, no firewall whatsoever. It has a public IPv4 Address.
I have 3 different clients connection. Each each of those on different locations, networks etc. But all with LAN addresses behind a router.
Client A can connect to server an play alone -> no problem
Client B can connect to server an play alone -> no problem
Client C can connect to server an play alone -> no problem
Client A can connect to server, while Client B is already on the server and vice verca -> no problem
but now Client C:
Client C is on the server -> nobody can join
Client C can not join server if anybody else is on
I did a few packet traces and had a closer look (even if tracing UDP is a pain!)
The problem seems to be the router of Client C
Every router does port randomization on outbound NAT. So heres the working example for Client A and B:
Client A connect to server_ip:34192, while doing that it gets an outbound NAT port of 1837
So view from client A is
local_ip_A:34192 -> server_ip:34192
Server view is
server_ip:34192 -> public_ip_A:1837
This works fine, as the router handles the backconnect in the session.
-------
Now client B comes in and gets pretty much the same, but also gets the clients info of the other connected clients:
So view from client B is:
local_ip_B:34192 -> server_ip:34192
local_ip_B:34192 -> public_ip_A:1837
Server view is
server_ip:34192 -> public_ip_A:1837
server_ip:34192 -> public_ip_B:20542
And now client A:
local_ip_A:34192 -> server_ip:34192
local_ip_A:34192 -> public_ip_B:20542
In my case this still works, becourse the routers are smart engough and handle the (back)connect of multiple hosts to the same port (1837 and 20542)
----
Now Client C seems not to be that smart and does not allow a second connection to its generated port (3647)
If any client (not headless) tries to connecto to the public_ip_C:PORT it seems to get dropped (can not tell for sure, becourse of UDP)
But here comes a strange part for me: client C tries a conneciton to for example clients A puclic IP and known port, but it gets another port for outgoing. So instead of using the same outgoing port as client A and B did, it uses a different one (+1). But client A still tries to connect to the port it gets from the server:
so here the view for client C:
local_ip_C:34197 -> server_ip:34197
local_ip_C:34197 -> public_ip_A:1837
local_ip_C:34197 -> public_ip_B:20542
this should be ok, but the router does soething strange here:
public_ip_C:3647 -> server_ip:34197 (ok)
public_ip_C:3648 -> public_ip_A:1837 (differnt outgoing port, client A tries to contact him on 3647)
public_ip_C:3649 -> public_ip_B:20542
-----
I am not sure if any of this helps, or if I am totaly misleaded by any of that... I am not realy expirienced with P2P technology. But for my situation it comes down to a problem with the router of client C, as A and B work perfectly fine together. I had no possiblity to verfiy the problem, as these router do not allow outbound NAT rules (34197 always to 34197).
If you want any more details, explanation or maybe a tracefile itself just ask, would be glad to help and not only confiuse