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)
[indent=1]currently i have:
[color=DarkOliveGreen]Server starts, contacts master server via HTTP request and informs it "This is my port/ip/name/etc..."
[color=Navy]Client loads and makes an HTTP request to the master server and gets the serverlist, including our target [color=DarkOliveGreen]server.
[color=DarkOliveGreen]Server Listens on: <Server Customized>
[color=DarkOliveGreen]Server Sends To: 45,000
[color=DarkSlateBlue]Client Listens On: 45,000
[color=DarkSlateBlue]Client Sends To: <Server customized>
[color=DarkSlateBlue]Client does HTTP request to a master server to get the target server's IP and <ServerCustomized>port (working)
The [color=DarkSlateBlue]client sends UDP request to the [color=DarkOliveGreen]server join the [color=DarkOliveGreen]server targeting <ServerCustomized> port. (working)
[color=DarkOliveGreen]Server hears the [color=DarkSlateBlue]client request (working)
and replies to [color=DarkSlateBlue]client listening port 45000 "yes you may join" (NOT working - NON-UPnP routers are blocking)
as far as i can tell, the[color=DarkOliveGreen] server is sending it, but the[color=DarkSlateBlue] client doesn't hear it due to it's NAT router.
[size=1]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"
(as far as i understand, endpoint means IP:PORT )
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?
LAN IP, PORT no problem.
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