1

So basically I'm creating an online game. I have one server that holds all the username / password information (login server) and then one or more servers that host the game (game servers). The Client connects to the login server which validates their credentials, check to see what game server they're on, and then tells that server to connect to the client.

I know very little about security but I figured it'd be more secure to have the client listen for a connection from it's game server instead of having the game server listening for clients. I figured that would make DDoS attacks easier to prevent at least.

The problem is I've read that if your servers are behind certain types of routers or load balancers you won't be able to easily get the ip of the client. I need that for the login server to tell the game server who to connect to... unless I can just transfer an open connection. I believe certain games have server clusters that let clients float between one or another so I figured somehow it's possible to pass a connection from one server to another. How is that generally done?

Maybe I'm way off?

ForeverNoobie
  • 531
  • 5
  • 17
  • I've never actually heard of you being able to transfer an open TcpClient before, not between two open applications. But it may be possible... – Adam K Dean Feb 19 '13 at 14:40

2 Answers2

2

One possible solution, to avoid DDoS, is for the login server to connect to the game server and ask it to open a port, which it does, the game server could then return the random port number which the login server could then send to the client.

The client would then have let's say a one minute window to connect to it's randomly assigned port before the game server could close that port.

Just an idea.

Client connects to Login Server:Standard Port
Login Server connects to Game Server:Standard Port
Game Server sends Random Port to Login Server
Login Server sends Random Port to Client
Client connects to Game Server:Random Port
Adam K Dean
  • 7,387
  • 10
  • 47
  • 68
1

You cannot transfer a connection like you think, you basically have to tell the client to create another connection to the new server.

You could respond to the client with some kind of transfer command that states the new game server IP and port you want them to connect to. It can connect to the new server and disconnect from the existing.

Lloyd
  • 29,197
  • 4
  • 84
  • 98