The term firewall is used in computer networks for security purpose.
A firewall acts as a wall for filtering the incoming traffic and can be used to monitor the same.
A firewall plays a very important role to filter out the data.
It can monitor the traffic and can prevent various types of attack on the network.
For example, a firewall can be used to control the dos attack.
DoS attack is denial of Service attack where an attacker sends a lot of traffic to the destination network in order to congest the resources of the network so that the network is not able to fulfill the requests of other users.
Here a user exploits the feature of TCP/IP protocol and sends SYN packet and does not complete the full process and bombards a lot of SYN packets at the destination network.
Here a firewall can stop that attack by not allowing an IP to interact with the network and hence caqn prevent the DoS attack.
In this way a lot of things can be done by firewall.