A firewall is a specific type of network security device. While all firewalls are network security devices, not all network security devices are firewalls. Firewalls primarily focus on filtering incoming and outgoing traffic based on a defined security policy. Other network security devices may include intrusion detection systems (IDS), intrusion prevention systems (IPS), and web application firewalls (WAF).