title: Python - Sending requests to an Internet Protocol
body: <p>Well, I recently got attacked by DoS, and need to understand some things.</p>
  
  <p>I know that if someone was launching an attack on an HTTP server, he or she would send HTTP requests to make the connection not time out, and make the server do work.
  My questions is what about DoS attackers who attack an Internet Protocol address. What kind of packets would they send? I want to see how it is done in code.</p>
  
  <pre><code>import socket
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect(("target", 80)) #Hopefully port 80 is an open port
  s.send("Some sort of packet that would request the server to do 'work'")
  </code></pre>
  
  <p>And after that question, how would the attacker, attack you if all ports are closed? (firewall) Would they instead change to a UDP protocol, and s.send through there? Because merely just using a connect packet (s.connect) will not be enough for a good DoS attack.</p>
  
  <p>My question is pretty much. How do DoS'ers fill connections on an IP server so well, and why?
  If I am confused, please show me why.</p>