News for hackers. Stuff that matters.
Re:UDP for games – encryption and DDoS protection by supernintendo on Thursday April 28, 2016 @12:19AM (#11586538)
> ...if some artifact within your game costs $20K+ of real-world dollars – you should start thinking about [encryption] seriously. In these cases, game account becomes as important as (and for quite a few people out there – much more important than) a bank account. Which carries all the security implications of the bank, including (but not limited to) encryption.

Sorry to nitpick but UDP seems like the wrong protocol for authentication. TCP is connection oriented. It's a better choice for logging in, refreshing a server list or any transaction where reliability is more important than latency. Most online multiplayer games use both TCP and UDP for this reason.

As for encryption, of course you should always use it when transmitting sensitive data. For a game where the client has no control over the state of the world and all packets are at the discretion of the server (`move here`, `click that`, etc.), encryption might be overkill. The source port value (first 16 bits of a UDP packet) can be used to identify the source of a packet and associate it with a client's server side session. But I'm not saying that encryption is a bad idea (it never is); it just depends on how much you can afford.

[1] https://en.wikipedia.org/wiki/Datagram_Transport_Layer_Secur...

Re:UDP for games – encryption and DDoS protection by zamalek on Thursday April 28, 2016 @05:12AM (#11587402)
TCP and UDP occurring over the same route on a WAN can wreak havoc with UDP packet loss.[1] Using both is only a good idea up until you dig deep into socket performance. A network is not a piece of software where you can isolate things and expect them to behave in an isolated way, everything you push over it interacts with everything else that you are pushing over it. This "use UDP and TCP" is a dangerous anti-pattern because it seems to be an obvious solution from a software perspective, but is in reality a problem from the electron perspective. To paraphrase a famous quote:

> Some game developers, when confronted with a TCP problem, think "I know, I'll add UDP." Now they have two problems.

Games that implement their own protocol over UDP typically have packet modes (frequently a "channel" akin to WebSocket channels): reliable, ordered delivery or neither or either. There is almost always the notion of a connection, where appropriate. This is the correct way to do things, and with Raknet now being free you really have no excuse to do it any other way.

For authentication you could just use the reliable/ordered channel and carry on as though you were using TCP - which somewhat defeats the purpose of this article.

[1]: https://www.isoc.org/inet97/proceedings/F3/F3_1.HTM

Re:UDP for games – encryption and DDoS protection by supernintendo on Thursday April 28, 2016 @12:05PM (#11589853)
With my example for login, my assumption was that one would use short-lived TCP connections (i.e. server receives login packet, sends success/fail and finally closes the connection), not a simultaneous, persistent connection where TCP congestion (and thus UDP packet loss) becomes an issue. But maybe I'm wrong on this one.

Thanks for sharing by the way, great article (although as an aside, some of those graphs are really hard to read).

Re:UDP for games – encryption and DDoS protection by zamalek on Thursday April 28, 2016 @01:16PM (#11590427)
> some of those graphs are really hard to read

I have to admit that I had to squint a bit while reading it myself.

Re:UDP for games – encryption and DDoS protection by MichaelGG on Thursday April 28, 2016 @12:47AM (#11586606)
I took it to mean that you might use UDP for doing stuff in game that might result in losing items. Like, I dunno, maybe an attacker on campus or on WiFi proxies your connection then makes you lose or drop expensive items.

I'm not sure how realistic a threat this is. Most likely crypto just helps obfuscate the game to make cheating/RE a bit harder.

Re:UDP for games – encryption and DDoS protection by c22 on Thursday April 28, 2016 @01:53AM (#11586768)
When I used to play games like this the popular technique was to dos your connection, then just kill you and take your stuff while you're trying to reconnect.
Re:UDP for games – encryption and DDoS protection by supernintendo on Thursday April 28, 2016 @12:40PM (#11590119)
This was pretty common in the early days of Ultima Online, since your character persisted for about three minutes after you logged out (unless you were in your house or an inn).
Re:UDP for games – encryption and DDoS protection by ComputerGuru on Thursday April 28, 2016 @12:31AM (#11586563)
I don't understand - DTLS is covered in depth in the article (as are your or concerns)
Re:UDP for games – encryption and DDoS protection by no-bugs on Thursday April 28, 2016 @04:44AM (#11587312)
> Sorry to nitpick but UDP seems like the wrong protocol for authentication.

While authentication over UDP is indeed a bit more difficult if implementing it yourself, fortunately there is DTLS which is a very official and well-recognised way to implement authentication over UDP (very briefly - DTLS does make a handshake, and it does have a session, but this session operates in a packet-oriented mode which supports reordering and packet loss).