Advertisement

is it plausible to host your online game on your home computer/network?

Started by December 06, 2018 02:59 AM
23 comments, last by Septopus 5 years, 11 months ago

For example, if I wanted to code a server in Java for my game, and allow my friends to play the game, would it run just as well as a dedicated server would? (security, overload, etc wouldn't be a problem because I trust them not to use it maliciously and I have a very fast network, over 100 Mbps) That is, assuming the server had the same RAM, etc as my own server...

My understanding of a "server" for any large game such as COD or Overwatch, is that it's basically just one big router, so for a small game like mine, could I just use my home computer and network as a temporary host?

This depends heavily on the quality of your "upstream" bandwidth, you may be able to download at 100mb+ but uploading is going to be significantly lower on home type connections.  Your upload speed will be the full bandwidth that your friends will be sharing when downloading from your server.  That being said, for a small server to host a game for a few friends, you could probably do just fine on a standard quality broadband connection.  Though you may need to purchase a Static IP address from your ISP in order for your friends to be able to connect to you easily.  Firewalls and port-forwarding are other topics you may want to read up on if you go this route. ;)

 

Advertisement
2 minutes ago, Septopus said:

This depends heavily on the quality of your "upstream" bandwidth, you may be able to download at 100mb+ but uploading is going to be significantly lower on home type connections.  Your upload speed will be the full bandwidth that your friends will be sharing when downloading from your server.  That being said, for a small server to host a game for a few friends, you could probably do just fine on a standard quality broadband connection.  Though you may need to purchase a Static IP address from your ISP in order for your friends to be able to connect to you easily.  Firewalls and port-forwarding are other topics you may want to read up on if you go this route. ;)

 

I see what you're saying and yes, I also have a relatively high upload speed (around 30mbps) so, for maybe 10 clients at most I should be good right?

As for port forwarding and firewalls, I know the basics, that you need to have a port open and ready to have data go in and out etc. I've dabbled in servers before and actually had one successfully work... But that was about a year ago lol. If it's not too much trouble do you think you could explain what aspects of my firewall and port-forwarding processes you're referring to- that I need to "pay attention" to. A short paragraph would do, I'm just wondering what precautions I should take to ensure (relative) safety and efficiency! 

Thanks for responding so quickly too! :)

Just now, minipong said:

I see what you're saying and yes, I also have a relatively high upload speed (around 30mbps) so, for maybe 10 clients at most I should be good right?

If it's a truly stable 30mbps, then you could do a whole lot more than 10..  But in most residential connections that is a "burst" speed and the guaranteed sustained speed is gonna be a bit lower than that.  Either way, it should be fine for what you are talking about. ;)

Just now, minipong said:

As for port forwarding and firewalls, I know the basics, that you need to have a port open and ready to have data go in and out etc. I've dabbled in servers before and actually had one successfully work... But that was about a year ago lol. If it's not too much trouble do you think you could explain what aspects of my firewall and port-forwarding processes you're referring to- that I need to "pay attention" to. A short paragraph would do, I'm just wondering what precautions I should take to ensure (relative) safety and efficiency! 

Thanks for responding so quickly too! :)

This is a highly variable topic(many different options from hardware to software), so it's hard to narrow it down. 

A couple of points though.

1) You should always have a firewall that explicitly allows the traffic you want.  AND explicitly denies everything else.  I don't know what your server will be running, but if it was a web server for example, you would need to open port 80 for normal HTTP access, and port 443 for secure HTTPS access.  Every other port should be closed down unless you specifically need them to be open.

2) Port forwarding will probably be configured in your broadband router(which also usually comes equipped with some sort of firewall built into it) this is the step where you tell the broadband router to explicitly accept traffic on those ports (80 & 443 in the above example) and to forward it all to the "server" on your network.  This is where you would map the public Static IP you get from your ISP to point to your server.  All of this is going to be very specific to your hardware and the ISP you use, so you may have to contact them or look online for specifics relating to your setup.

Hope it helps! ;)

 

10 minutes ago, Septopus said:

If it's a truly stable 30mbps, then you could do a whole lot more than 10..  But in most residential connections that is a "burst" speed and the guaranteed sustained speed is gonna be a bit lower than that.  Either way, it should be fine for what you are talking about. ;)

This is a highly variable topic(many different options from hardware to software), so it's hard to narrow it down. 

A couple of points though.

1) You should always have a firewall that explicitly allows the traffic you want.  AND explicitly denies everything else.  I don't know what your server will be running, but if it was a web server for example, you would need to open port 80 for normal HTTP access, and port 443 for secure HTTPS access.  Every other port should be closed down unless you specifically need them to be open.

2) Port forwarding will probably be configured in your broadband router(which also usually comes equipped with some sort of firewall built into it) this is the step where you tell the broadband router to explicitly accept traffic on those ports (80 & 443 in the above example) and to forward it all to the "server" on your network.  This is where you would map the public Static IP you get from your ISP to point to your server.  All of this is going to be very specific to your hardware and the ISP you use, so you may have to contact them or look online for specifics relating to your setup.

Hope it helps! ;)

 

Yeah... We have fiber optic cables I'm pretty sure so I've never seen it under 10mbps upload.

Also, for the firewall or Port forward or whatever, I'm trying to make a game (gamedev.net lol) and I'm coding the server and clients both myself, so for port forwarding should I just find a port that's not commonly used (such as 3737, was what I was planning on using) to Port forward, I should be safe, yes?

So in summary I need to Port forward one port (3737) and not allow connections from other random ones, is that all I need to keep my network safe?

Edit: it would probably be easier to ask, what would be a significant security issue?

21 minutes ago, minipong said:

Yeah... We have fiber optic cables I'm pretty sure so I've never seen it under 10mbps upload.

If you have a fiber connection and the upstream isn't shared by too may customers you'll probably have no issues.  It all depends on the fine print from your ISP, so I recommend reading it if you want to do anything more serious than testing things out, and it's a good idea to do so anyhow in case there are any charges for over-use of your upstream... ;)  fine print...  It happens.

Quote

Also, for the firewall or Port forward or whatever, I'm trying to make a game (gamedev.net lol) and I'm coding the server and clients both myself, so for port forwarding should I just find a port that's not commonly used (such as 3737, was what I was planning on using) to Port forward, I should be safe, yes?

So in summary I need to Port forward one port (3737) and not allow connections from other random ones, is that all I need to keep my network safe?

https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

There's an expansive list, I don't see 3737 on there.  haha..  It's common practice though to pick something in the higher ranges 10000+ of the port spectrum to avoid unintended conflicts with other less publicly documented software, though, these days I think the odds are about the same either way you go.  If you aren't thinking long term for a possible commercial release later, then I wouldn't worry to much about what port numbers you use, and it's an easy enough detail to change later.  :D

As long as the ports you are NOT using, are ALL closed, you should have very little risk involved with hosting a test server for some friends. ;)  Making sure the ports you have open can't be exploited is up to you, the server programmer... again, for a friends only server, almost no risk..  You might get probed by some automated scanning software now and then though.. so expect some garbage data from time to time, especially if you use a port # below the 10000ish range..

Advertisement
18 minutes ago, Septopus said:

If you have a fiber connection and the upstream isn't shared by too may customers you'll probably have no issues.  It all depends on the fine print from your ISP, so I recommend reading it if you want to do anything more serious than testing things out, and it's a good idea to do so anyhow in case there are any charges for over-use of your upstream... ;)  fine print...  It happens.

https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

There's an expansive list, I don't see 3737 on there.  haha..  It's common practice though to pick something in the higher ranges 10000+ of the port spectrum to avoid unintended conflicts with other less publicly documented software, though, these days I think the odds are about the same either way you go.  If you aren't thinking long term for a possible commercial release later, then I wouldn't worry to much about what port numbers you use, and it's an easy enough detail to change later.  :D

As long as the ports you are NOT using, are ALL closed, you should have very little risk involved with hosting a test server for some friends. ;)  Making sure the ports you have open can't be exploited is up to you, the server programmer... again, for a friends only server, almost no risk..  You might get probed by some automated scanning software now and then though.. so expect some garbage data from time to time, especially if you use a port # below the 10000ish range..

Alright thanks! Honestly I don't have a problem adding a few digits to the port. It shouldn't cause any problems using 373737 right? That's not too high?

Also, for now I want to make it friends only but once it's more detailed and more like a real game I want to make it available for free download (or maybe $3 or something affordable) so it wouldn't be as huge of a target as something like Fortnite, but for future reference with something like that what safety precautions could I take? Just stuff that's reaaaally an obvious problem.

(Sorry I know I've asked a lot of stuff lol)

Lastly, you're saying that the unused ports should be closed... Doesn't your router have them closed by default? I feel like you're talking about port forwarding (only port forwarding the ONE port I need open, correct?)

65535 is the max. ;)

Look into a commercial grade service for going bigger than testing, you'll get better service and have a guaranteed level of service on your upstream.  For now, make sure you won't be charged for using too much of your upstream, there is quite possibly a quota in effect, check the fine print on your agreement.

That last point is where it gets really specific to your setup.  Every router is different, every software is different.  Don't ever trust that they will just be closed by default.  Verify, or end up with a network full of malware and botnet clients. ;)

 

Port forwarding is a traffic routing type of activity, and firewalling is a blocking or allowing activity, they can both be handled by the router(sometimes), or the router might not have a firewall component, it's hard to say.  Make sure you either have a firewall on the router, or on the server, or even better in/on both. ;)

 

3 minutes ago, Septopus said:

65535 is the max. ;)

Look into a commercial grade service for going bigger than testing, you'll get better service and have a guaranteed level of service on your upstream.  For now, make sure you won't be charged for using too much of your upstream, there is quite possibly a quota in effect, check the fine print on your agreement.

That last point is where it gets really specific to your setup.  Every router is different, every software is different.  Don't ever trust that they will just be closed by default.  Verify, or end up with a network full of malware and botnet clients. ;)

 

I totally forgot that there was a limit lol, 13737 maybe? Whatever that doesn't matter

Last thing I promise, the rest I'm pretty sure I can find elsewhere:

When it comes to using one of those dedicated services, is it like a virtual machine where I can upload the .jar file for the server and give a command to have it running on their computer, or is it more specific.... As I have it now the server as virtually identical to the client (you double click on the jar and it opens, simple as that, and will establish the server on whatever port and all that which I have it set to!). Will that same type of program (an executable) be suitable for their service?

I want to say thanks for all the help and patience :)

No worries, I was recommending a commercial grade service package from your ISP.  But putting it on a virtual server somewhere would likely be much cheaper, especially if it's a fairly simple game/server setup. 

In fact, you may want to explore that, I know Microsoft and Amazon and I think Google all have a free-tier Virtual Servers that you can setup and try out.  Limited bandwidth, limited processing power, and limited ram/storage, but usually enough for testing small server/client setups out.  And most of their paid virtual server offerings are still usually cheaper than running your own dedicated commercial grade internet connection.

Also, check out "dockers" or other "containers" these are like virtual servers, but highly customized and simplified, usually to run single applications.  You can create your own and host them with various service providers(the above 3 for example). ;)

 

This topic is closed to new replies.

Advertisement