Author Topic: Amazon EC2 Setup  (Read 10602 times)

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Amazon EC2 Setup
« on: June 22, 2013, 07:26:03 PM »
Hi,

I've been trying to get TNServer running on my Amazon EC2 Win Server 2008 R2 Instance, but I get the Gateway: None Found message.

I think I have sorted out the firewall and port settings OK. I used this guide as a reference to the things I might need to do, while applying the relevant TNServer port info:
http://developer.muchdifferent.com/unitypark/uLink/HostingAmazonEC2

I have also followed the advice here:
http://www.tasharen.com/forum/index.php?topic=2874.0

I am using the following command line in the shortcut for TNServer:
TNServer -name "Test" -tcp 5127 -udp 5128 -udpLobby 5129

At the moment I have the Windows firewall disabled completely as I thing amazon have their own firewall setup for EC2 (hence the port setup in the management console for EC2).

However, test clients are able to connect and play although the latency is terrible.

Any ideas? Thanks :)
« Last Edit: June 23, 2013, 09:00:59 AM by Voxel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #1 on: June 23, 2013, 10:15:28 AM »
Amazon servers don't have gateways, so that message is harmless.

Latency being terrible is expected -- Amazon EC2 micro instance (assuming that's what you use?) are not beefy at all -- which is why they are free. It's fine for everything other than FPS games though.

Voxel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Amazon EC2 Setup
« Reply #2 on: June 23, 2013, 10:30:29 AM »
Hi Aren,

Thanks for the confirmation. Are there any providers of servers (I don't mind paying) that you suggest for FPS? Or is it best for one of the players to host? There will be a max of 16 playing at anytime.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #3 on: June 23, 2013, 03:31:32 PM »
If other players host, then you don't pay for bandwidth. You can also let players host their own region-based dedicated servers for tournaments. Win win!

I can't recommend any hosting providers as I've never done any searching into the matter myself.

pyscho2day

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 74
    • View Profile
Re: Amazon EC2 Setup
« Reply #4 on: July 08, 2013, 12:15:26 AM »
@ArenMook
When others play host, does the client establish a direct connection or are they still being routed through the server on the EC2? (Just using EC2 as an example)

From what I have seen it looks to be that the traffic is routed through the EC2 server but I just want to confirm.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #5 on: July 08, 2013, 12:37:33 PM »
All clients connect to a server. If this server is on your EC2, then all traffic goes through there. If the server was started on a client's machine using TNServerInstance.Start, then the connections are P2P.

pyscho2day

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 74
    • View Profile
Re: Amazon EC2 Setup
« Reply #6 on: July 08, 2013, 04:18:21 PM »
That is good to know.  1 more question then I will stop hijacking this thread.

Is it possible (and i think it is by what i have read) to have a server in the cloud that can act as a master server that would host a list of client servers (TNServerInstance.Start) so that others could connect directly to them?  If so do you have a sample or is there one in the unity package that i have missed?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #7 on: July 08, 2013, 10:57:44 PM »
Yup. Start the TNServer.exe with only the lobby part running (-tcpLobby 5129 flag for example), and have your game servers register with it.

pyscho2day

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 74
    • View Profile
Re: Amazon EC2 Setup
« Reply #8 on: July 10, 2013, 10:35:26 AM »
Thanks Aren!  I was able to figure out what I Needed.

hippocoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: Amazon EC2 Setup
« Reply #9 on: August 09, 2013, 05:57:15 PM »
I read that EC2 will bill you after 12 months. Azure might be another option. Btw, how do you "register" a client with the EC2 "lobby master server" in order to register servers or join an existing one? Is there an example ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #10 on: August 09, 2013, 06:10:18 PM »
You don't register clients. You register servers. When you launch the TNServer.exe you get a list of options -- including the "-tcpLobby" command, with examples of how to use them.

The source code for TNServer.exe is included in the zip file with TNet.

pyscho2day

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 74
    • View Profile
Re: Amazon EC2 Setup
« Reply #11 on: August 10, 2013, 12:01:11 AM »
This is from their page:

Quote
* These free tiers are only available to new AWS customers, and are available for 12 months following your AWS sign-up date. When your free usage expires or if your application use exceeds the free usage tiers, you simply pay standard, pay-as-you-go service rates (see each service page for full pricing details). Restrictions apply; see offer terms for more details.

** These free tiers do not expire after 12 months and are available to both existing and new AWS customers indefinitely.

This is located on this page http://aws.amazon.com/free/

So as long as you stay withing the limits and if you only have one server and its set up with the ones marked free, you should never be charged.  Theoretically that is.  And for just a single master server it is more than enough.

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Re: Amazon EC2 Setup
« Reply #12 on: July 23, 2014, 06:01:42 AM »
In case anyone needs this: I wrote a tutorial about how to set everything up here.
Games: BLACKISH | Blog | Assets

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Amazon EC2 Setup
« Reply #13 on: July 23, 2014, 09:38:28 PM »
Nice writeup, Markus!

neeraj

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 38
    • View Profile
Re: Amazon EC2 Setup
« Reply #14 on: June 19, 2016, 08:15:29 AM »
In case anyone needs this: I wrote a tutorial about how to set everything up here.

Thanks a ton!  ;D