Security Models

Hello all,

I’ve been getting my hands dirty with Unity for some time now. I have a few questions regarding networking and security models I’m hoping somebody could address.

  1. Can I operate my own server for networked games? Is there a benefit to doing this versus using a provided Unity server? Is there a provided Unity server?

  2. Are servers scalable? To the point where they can be clustered?

  3. How flexible is the network connection?

  4. What sorts of things can I access from protocol? What protocols are available? I’ve noticed TCP and UDP so far; is SSL supported?

  5. Are there restrictions for establishing a network connection? What are the restrictions for running .NET code to the client? How much information does Unity expose?

Any help that can be provided will be appreciated.

Thank you

  1. Unity does not provide any servers at all. Unity provides a basic master server setup but thats for testing only, not for production usage.
    Game Servers always have to be hosted by you and first need to be developed by you (masterserver etc don’t offer any game functionality)

  2. If you invest the time to do that. Though with unity networking it will not be easy to do so as the servers can only communicate to clients and a node can not be server and client at the same time. You would likely use something else for this purpose like Sockets or an alternative technology like Photon / SmartFoxServer Pro

  3. not flexible at all

  4. Its Mono 1.2.5 and offers TCP and UDP sockets. SSL is related to neither of them, that would be related to HTTP. Its present I think but it can not be used on webplayers which rely on system access thats a no go on the webplayer

  5. Its full Mono 1.2.5 .NET at the time and you can fully access the parts present in unity

Thank you for the quick response, that really helps me out. I do have another question about the Master Server. I guess I am just confused what it IS. Could you give me a brief rundown about what it’s capabilities are and what it is typically used for?

Appreciate it.

The master server is basically just a service that tells you what games are available.
Each server / hosting player can register his game with the master server so other users can find it.

In addition to the master server the download contains the connection tester thats used in conjunction with the connection facilitator (-> NATPunchthrough)

Also, can you give me reasons as to why the network connection is not flexible? Or why you feel that way?

Nope. SSL is actually more related to TCP/UDP than it is to HTTP.

HTTP is a protocol that (typically) runs over TCP. SSL is a layer on top of TCP/UDP. Simplified, all SSL is a PKI key exchange to then exchange a symmetric key which is then used for the actual communication (for performance reasons).

See Section 1.4 here: http://staff.science.uva.nl/~delaat/sne-2006-2007/p24/report.pdf

In other words, TCP/UDP are about actual sockets and SSL is about fiddling with the bits that are in the packets that travel through those sockets. HTTP is a protocol which goes through the sockets. In fact, HTTP is transport protocol agonistic by definition:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec1.html
“”"
HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80 [19], but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used
“”"

@thesmack:

I have yet to play with SSL sockets within Unity. So, I can’t really answer your question. However, if I do, I’ll be sure to post my results as it’s something that I’ve wondered about and have failed to find an answer to.