A firewall manages secure network traffic flow between trusted and untrusted networks. It monitors traffic and acts as a barrier. Firewalls differ from antivirus software which protects against internal threats rather than external network attacks. Firewall types include packet filtering, stateful inspection, proxy, and next generation firewalls. A firewall's functions are to securely allow authorized network traffic while restricting unauthorized access and monitoring all network activity.