I am trying to learn some things about computer security and I want to program a project that prevents a DDoS attack.
I fully understand DDoS attacks in theory and now I want to see some action.
I just wanna ask about what language should I use and what things should I implement for saving time. But of course I want to write a lot of parts of the code because education is the main thing here.
You can program a .net Console application that listens on 'all ports' (or at least as many as you want to experiment with). The basic code to listen on multiple ports is here on MSDN https://social.msdn.microsoft.com/Forums/vstudio/en-US/09828be4-6ac4-45ec-a116-508314dab793/listen-on-multiple-ports?forum=csharpgeneral
Your program would then presumably make identical calls to the destination server having examined the packets. However this is more like a Gateway than a proper firewall, as it cannot intercept IP traffic that wasnt originally sent to it (a firewall acts like a Switch in that all IP traffic flows through it whether it is the destination or not).