Any one give me suggestions for I need recreate a firewall software?
You don’t need to create your own software firewall, as it is already built-in with Windows since XP, Linux and MacOS. Software firewall in Windows since XP Service Pack 2 is enabled by default, same goes with the MacOS. Linux firewall comes under the ufw package, which can be enabled by the user anytime. We are already in a modern phase of computer history when software firewalls are part of the OS and not a separate 3rd party utility software.