Firewalls have been one of the most popular and important tools used to secure networks since the first days of interconnected computers. The main function of a firewall is to monitor network traffic for the purposes of preventing unauthorized access between computer networks.
What makes that traffic? Applications make it. Working internally and externally on servers and workstations (and sometimes on other network machines or devices), applications are the target of all network traffic.
Firewalls are the initial line of defense between the inner network and untrusted networks like the Internet. You should think about firewalls in terms of what you really need to secure, so you will reach the right level of security for your environment.
Firewalls can run application-layer gateways, which are specifically created to understand how a specific application should function and how its traffic should be created and patterned.
The key advantage of application layer filtering is that it can “understand” some applications and protocols (such as File Transfer Protocol (FTP), Domain Name System (DNS), or Hypertext Transfer Protocol (HTTP)). This is helpful as it is able to identify if an undesired application or service is attempting to avoid the firewall using a protocol on an enabled port, or realize if a protocol is being abused in any harmful way.