In this chapter, we present techniques to defeat Denial of Service (DoS) and Distributed Denial of Service (DDoS) attacks. In the _rst part, we describe client puzzle techniques that are based on the idea of computationally exhausting a malicious user when he attempts to launch an attack. In the second part we are introducing some basic principles of game theory and we discuss how game theoretical frameworks can protect computer networks. Finally, we show techniques that combine client puzzles with game theory in order to provide DoS and DDoS resilience.