title: Managing security on UDP socket
body: <p>I am looking at developing my first multiplayer RTS game and I'm naturally going to be using UDP sockets for receiving/sending data.</p>
  
  <p>One thing that I've been trying to figure out is how to protect these ports from being flooded by fake packets in a DoS attack. Normally a firewall would protect against flood attacks but I will need to allow packets on the ports that I'm using and will have to rely on my own software to reject bogus packets. What will stop people from sniffing my  packets, observing any authentication or special structure I'm using and spamming me with similar packets? Source addresses can easily be changed to make detecting and banning offenders nearly impossible. Are there any widely accepted methods for protecting against these kind of attacks?</p>
  
  <p>I know all about the differences between UDP and TCP and so please don't turn this into a lecture about that.</p>
  
  <p>===================== EDIT =========================</p>
  
  <p>I should add that I'm also trying to work out how to protect against someone 'hacking' the game and cheating by sending packets that I believe are coming from my game. Sequencing/sync numbers or id's could easily be faked. I could use an encryption but I am worried about how much this would slow the responses of my server and this wouldn't provide protection from DoS.</p>
  
  <p>I know these are basic problems every programmer using a UDP socket must encounter, but for the life of me I cannot find any relevant documentation on methods for working around them!</p>
  
  <p>Any direction would be appreciated!</p>