Sign in to follow this  
Rudibs

Protocols used in todays internet games

Recommended Posts

Hi,

So, what kind of protocols are being used today in internet networking games.
Is UDP and TCP still useable. And does for example Winsock2 still being used?
What are the big companies of today use for MMORPG games.
What about simple games like poker or chess-games?

If Winsock2 is being used, are there available in C# .NET,
i made winsock2 before in C++, but was quite unstable, but i like writing small games and applications
in C/C++. No Java here, because I want for example to have all the necessary graphic data and/or music on
own computer, not server.

What is your opinions around this and are there any other protocols being mentioned that i should read about.
Not that I am gonna make a game or something, but i had an idea, and maybe wanted to get
some background information on web-based networking before even thinking of making a simple
online game. Just a playful thought this is.

Share this post


Link to post
Share on other sites
First, a quick primer on protocols.
There are several layers of protocols. Networks work using layer after layer of protocols.




There is the data link protocol, which is one of many such as Ethernet, or DSL, or ISDN, or PPP. There are quite a few others depending on your equipment. This is the protocol to get data from machine to machine.

There is the network level protocol. You are probably using Internet Protocol, (IP) but there are others like X.25. Your machine will package these up and send it using the protocol above. It consists of Internet addresses and connectivity between them. This routes from your local computer through many routers to find a computer in a distant land.

Next comes the transport protocol. This is going to be UDP or TCP, although there are others. Games use both. TCP is stream based, that is, you shove stuff in at one end and it comes out the other in the same order; it has a cost that data may take a few moments to arrive if there is a garbled network connection. UDP is packet based; it has a cost that data may arrive out of order, may arrive multiple times or may not arrive at all. Both have pros and cons.

Next up you have the operating system function calls or other libraries. (This isn't an OSI networking layer, but the interface you use in your application.) This can be WinSock, or it can be another package like enet or asio or RakNet, etc. This is the interface that you use as a programmer. Using this interface you can control options at the layers above, such as specifying that a message be sent with UDP or TCP, or use a different network protocol like X.25 instead of IP.

FINALLY comes your game application's protocol. This is the protocol your game uses. This is going to be different for every game. These are the messages are the ones you usually hear about, such as events about the game getting started, or players joining and parting, or players updating their positions or weapons or inventory.



With that in mind, we can finally address your questions:
[quote]
1) what kind of protocols are being used today in internet networking games?
2) Is UDP and TCP still useable.
3) And does for example Winsock2 still being used?
4) What are the big companies of today use for MMORPG games?
5) What about simple games like poker or chess-games?
6) If Winsock2 is being used, are there available in C# .NET, i made winsock2 before in C++, but was quite unstable, but i like writing small games and applicationsin C/C++. No Java here, because I want for example to have all the necessary graphic data and/or music onown computer, not server.What is your opinions around this and are there any other protocols being mentioned that i should read about.Not that I am gonna make a game or something, but i had an idea, and maybe wanted to getsome background information on web-based networking before even thinking of making a simpleonline game. Just a playful thought this is. [/quote]


1. There are many protocols, as shown above.

2. Yes, UDP and TCP are the transport layers. You are going to use one or both of them.

3. Yes, winsock is still being used. It serves as one interface between your app and the OS's networking system. There are others available, and it varies based on the libraries and languages you use. Java will not use winsock directly, instead use the Java networking libraries. Similarly with C# you can use their networking functionality. You can also use networking libraries that wraps it into their own interfaces.

4. For the transport layer, they typically use UDP for game data but this is not universal. They most likely use UDP for VoIP (Note the VoIP, Voice over Internet Protocol, is yet another protocol itself). They may use TCP for authentication and the lobby and the financial transactions. For the system libraries they may use WinSock directly, or they may use externally developed libraries like Massiv or RakNet, or they may use their own in-house developed libraries. Finally, for the application itself, there will be many different protocols involved. They will have protocols for authentication, protocols for lobbies, protocols for financial transactions, protocols for in-game data, protocols for VoIP, and more.

5. They are no different than question 4. A slow turn-based game is more likely to use TCP instead of UDP, but they don't have to. They can use various libraries to interface with the systems. And they will develop their own messaging system at the application level.

6. That isn't really much of a question. It sounds like you are afraid of making a decision. All of those languages have the interfaces necessary to make a networked game. Obviously the interface in Java is different than the one in C# which is different from the C-level WinSock libraries; they are written in different languages. But at the fundamental level they operate the same, wrapping messages up in UDP, then IP, then likely Ethernet, and it gets sent on its way over the wire. You can implement exactly the same networking protocols using any of those languages, you can even mix and match the languages and get the same data over the wire.

Share this post


Link to post
Share on other sites
[quote name='Rudibs' timestamp='1317323998' post='4867311']
Is UDP and TCP still useable.[/quote]
Yes. Reliable UDP in most games replaces TCP; however, for a lot of slower games TCP works perfectly well.

[quote name='Rudibs' timestamp='1317323998' post='4867311']
And does for example Winsock2 still being used?[/quote]
Yes, look into the WSA functions with overlapped IO. Personally I find Boost Asio easier to work with.

[quote name='Rudibs' timestamp='1317323998' post='4867311']
What about simple games like poker or chess-games?[/quote]
TCP works fine.

[quote name='Rudibs' timestamp='1317323998' post='4867311']
If Winsock2 is being used, are there available in C# .NET[/quote]
.NET has built in socket stuff found in System.Net. MSDN can tell you more. As for networking libraries a lot of people use [url="http://code.google.com/p/lidgren-network-gen3/"]Lidgren[/url].

[quote name='Rudibs' timestamp='1317323998' post='4867311']
No Java here, because I want for example to have all the necessary graphic data and/or music on own computer, not server.[/quote]
Java can be downloaded an ran outside of the applet.

I recommend reading [url="http://www.amazon.com/gp/product/0136079679"]this book[/url]. Covers the basic ideas behind TCP and UDP among other things.

// Edit: lol too slow. Frob beat me.

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

Sign in to follow this