Jump to content
  • Advertisement
Sign in to follow this  
programmer_tom

winsock and WAN

This topic is 4138 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all we have a d3d game that uses Winsock for networking. works fine for the LAN (192.168). I need details about how to make this happen for a WAN. can Winsock handle this? Are there calls in Winsock to help you resolve outside IPs? lost. thanks -programmer_tom

Share this post


Link to post
Share on other sites
Advertisement
All that should be needed is to change the address and for any intermediate hardware to be configured to allow the traffic. A listening server behind a router will need the ports forward so that machines external to the router can get through.

However if you are using multicast communication then this does not work over LANs.

Dave

Share this post


Link to post
Share on other sites

sry if i'm a bit of a n00b on network programming but...

"However if you are using multicast communication then this does not work over LANs."

-how do i know if this is the case? is this the resolution of the local 192 ips?

-what about ports? we had a guy come in and suggest port 80 so it's not blocked
by routers etc, but won't this cause conflicts? we are using some arbitrary port right now.

thanks
-programmer_tom

Share this post


Link to post
Share on other sites
The reason he recommended port 80 is because it is forwarded on routers by default, however i wouldn't use it because it is reserved for HTTP. I would use your arbitrary port and expect anyone running one of your servers to forward it.

You won't be using multicasting if you don't know what it is, don't worry about it.

Dave

Share this post


Link to post
Share on other sites
"The reason he recommended port 80 is because it is forwarded on routers by default, however i wouldn't use it because it is reserved for HTTP. I would use your arbitrary port and expect anyone running one of your servers to forward it."

ya i get that...we were just discussing whether or not it's reasonable for users to have to be able to configure their routers to play the game. what if the user is sitting in an office behind 3 or 4 routers without access to them? how would you be able to deal with that?

in our engine, the server is one of the players in the game. i'm still lost on how
he would be able to resolve players on the same LAN at a different location, as their IPs would be seen to him as routable IPs right? Somehow the local address is preserved in the communication, so 2 players can be differentiated.

thanks for the help
-programmer_tom

Share this post


Link to post
Share on other sites
Are you using TCP or UDP?

Port 80 is no longer a viable workaround for TCP online games due to a security feature present in newer NAT firewall/routers called "Stateful Packet Inspection", or SPI. SPI watches network traffic over well-known ports and discards packets that don't appear to conform to the registered protocol for that port. It may be possible to use HTTPS' port 443 as a workaround; I doubt SPI can decrypt that data stream for inspection, but it may be able to track the initial handshake. Another possibility is to just use the same port number as a well-known game such as WoW, the idea being that the routers are more likely to have already been tweaked to allow these more popular games to operate.

About differentiating players: The IP layer and the NAT router between the two endpoints are responsible for the magic that ensures proper routing of packets across the WAN/LAN boundary.

Share this post


Link to post
Share on other sites
Are you using TCP or UDP?

we're using udp.

Another possibility is to just use the same port number as a well-known game such as WoW, the idea being that the routers are more likely to have already been tweaked to allow these more popular games to operate.

not a bad idea. i like it.

About differentiating players: The IP layer and the NAT router between the two endpoints are responsible for the magic that ensures proper routing of packets across the WAN/LAN boundary.

ok, but if the server needs to send a packet to an individual player on a LAN, how is that differentiated? a friend of mine suggested different ports for different players on the LAN.

-programmer_tom

Share this post


Link to post
Share on other sites
Quote:

ok, but if the server needs to send a packet to an individual player on a LAN, how is that differentiated? a friend of mine suggested different ports for different players on the LAN.


Internet knows how to take care of that, don't worry about it.

As far as you're concerned, the client is uniquely identified with address/port pair. Beyond that, it doesn't matter where they are.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!