I've also been reading up at http://www.brynosaur...pub/net/p2pnat/ but some of it is a bit fuzzy to me so maybe you guys can help.
First, the problem:
- Game Server is UPnP enabled. works perfectly.
- Client has no UPnP protocols on their router so it requires manual port settings (which kills any modern game) or NAT Punching.
- "Master Server" is just an HTTP PHP scripted web server that receives Form Submissions to add, remove, and output current Game Server IP:Port infos for clients to download and browse through. (Server Browser data for clients)
currently i have:
Server starts, contacts master server via HTTP request and informs it "This is my port/ip/name/etc..."
Client loads and makes an HTTP request to the master server and gets the serverlist, including our target server.
Server Listens on: <Server Customized>
Server Sends To: 45,000
Client Listens On: 45,000
Client Sends To: <Server customized>
Client does HTTP request to a master server to get the target server's IP and <ServerCustomized>port (working)
The client sends UDP request to the server join the server targeting <ServerCustomized> port. (working)
Server hears the client request (working)
and replies to client listening port 45000 "yes you may join" (NOT working - NON-UPnP routers are blocking)
as far as i can tell, the server is sending it, but the client doesn't hear it due to it's NAT router.
Q: OMG! Why are you doing hole punching?
A:Because i've already found 2/3 testers that DONT have upnp routers (eg: WANPPPConnection:1 and WANIPConnection:1).
From what i understand from http://www.brynosaur...pub/net/p2pnat/ , it appears that the game server won't need a 3rd negotiating machine so long as the game server is properly configured to receive connection requests from game clients - no problem. got that.
According to the document and what I've been able to scrounge up on the web it seems the game server will need to reply to the client on the end points:
- LAN.IP.xxx.xxx:MachinePort "Token #1"
- WAN.IP.xxx.xxx:RouterPort "Token #2"
- WAN.IP.xxx.xxx:MachinePort "Token #3"
The game client will reply back with a "I herd "Token #n " and the server locks in on that information to run the game connection.
Now my questions:
- Do i understand correctly?
- How do i find the external WAN port of the client?
WAN IP, no problem
WAN Port - don't know how to get it.
On a side question of the same topic:
on section 2.2 of the document http://www.brynosaur...pub/net/p2pnat/,
how do either of the machines receive the Hole Punch UDP Data Packets from the Server S if the client routers are not yet holepunched to get through the NAT?
VB.NET 2010 Ultimate
Win 7 Ultimate