Jump to content
  • Advertisement
Turbo14

Modern Network Protocols

Recommended Posts

My brother told me that modern games no longer use network protocols where you have to worry about opening ports to host games. I'm trying to figure out what he's talking about. Is there a more modern protocol I can use with C# where I don't have to worry about hosting players opening ports? I don't know a ton about this stuff but I would think games still have to open ports to host games.

Share this post


Link to post
Share on other sites
Advertisement

It's not really a protocol thing. If you're hosting a service behind a router, you either need some kind of port forwarding, or you need to perform "NAT punchthrough" between the client/server to create a connection.

For port forwarding, there's UPNP these days that lets your game ask the router to temporarily gotta port without the user having to manually configure it.

For NAT punchthrough, many platforms (e.g. Steamworks) will have a library to do that for you, and also a service to handle the failure situation where a connection can't be created. These services use a machine in the cloud as a kind of fake server, which just forwards data. When a client player can't connect to the server player for whatever reason (port forwarding / NAT punchthrough have failed), then instead, both of them connect to one of these cloud servers that then forwards their communications to each other.

Share this post


Link to post
Share on other sites

That statement is not factually correct. The games still use the same protocols. However, most modern games add additional work to make the port-opening not necessary. There are two main ways you can do this:

1) Run the game servers in the cloud. This is the model of your typical Battle Royale (Apex, PubG, etc) as well as a variety of MMO-style games. Some player may be in charge of "setting up parameters" for game instances, but the actual network server process is still a publicly addressable host:port operated by the game publisher or someone like that.

2) Let players host the servers, but have the publisher (or some intermediary, such as Steam, or Xbox Live, or whatever) do the match-making and NAT punch-through introduction. Player hosts a game on their machine, lists it on the intermdiary, and other players who want to match up go through NAT punch-through introduction to set up the session without manual port opening. Once the game is going, the matchmaker doesn't need to involve itself with actual gameplay, so those servers are cheaper to operate than full game servers.

It used to be that NAT punch-through was a "may or may not work" thing, but because there's been so many bug reports and support calls and bad reviews, most ISPs and firewall/router vendors for consumers now don't block this. There are still cases in enterprise systems where NAT punch-through may be blocked, but that's a decided explicit policy of the IT/operations/management of the enterprise, i e, they decide to not support gaming at that point.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!