Look up what a DDoS attack actually is first. It's not like preventing people from invading your house and stealing your stuff, it's like trying to prevent people from walking through the beeping sensor at a store's entrance. Millions of times a minute.
