Ducktards
  • Home
  • Behind the Scenes
  • Daily Dev
  • Server stuff

Networking protocols

4/8/2016

 
Picture
Before you build your multiplayer game, you may want to quickly brush over the different protocols. If you're new to networking, I'd recommend TCP as it's more predictable. But it would be better if you decided for yourself!




​

Picture

​An analogy

Imagine it like a private mail service. Both users must have approved initially, and if you something goes missing, it'll be recognised and sorted out. Unsurprisingly, this checking process takes time. 

Picture

• It requires approval

Before anything can be sent, a connection must be established on both sides. If the recipient doesn't respond, nothing can be transmitted. 
Picture

​
•  Everything arrives in order
It's very reliable. Any data you send will be delivered without fail, and in the same order it was sent. The only exception is if the connection fails (obviously).
Picture

•  ​But it's not the fastest
To ensure everything arrives correctly, checks are made, using additional bandwidth and time. And if something actually goes missing, everything else gets held up.






​

​

Picture

​An analogy

It’s a bit like throwing a paper message in someone’s garden. They might find it, or it might get soggy or blown away. But you didn’t need permission to throw it, and it’s a lot faster than using mail. 

Picture

•  It's connectionless
​Your recipient does not need to approve or accept you, in order to receive data. You can send data even if they're offline (But they won't receive it) .
Picture

•  Stuff can get lost
Depending on how far the data is travelling, and the amount of surrounding traffic, there’s a chance your data might not arrive at all. It can also arrive out of order.

Picture

• But it's much faster
As there’s far less verification, UDP is noticeably faster than TCP. It's great for streaming data, if you don't mind the odd packet getting lost!









​​
Remembering the difference
Picture

TCP
 stands for transmission control protocol
UDP  stands for user datagram protocol
​
I don't know about you, but knowing what the acronyms stood for didn't help me remember them at all. The way I remembered it is as follows. Please note, these are completely fictional!
​
TCP - Tethered
UDP - Unlinked


​


​Up next ➔     Multiplayer basics (soon)

​Enjoyed this article?

    Only show:

    All
    Dev
    Documentation
    Networking
    Tutorial

  • Home
  • Behind the Scenes
  • Daily Dev
  • Server stuff