A Firewall is basically a logical layer between the network connection and your computer which filters out the data entering and leaving your computer.
When you are using the internet, you are using a two-way traffic. Even while surfing you are both downloading and uploading data at the same time. You are never sure over the internet of the fact that whether the content you are viewing is perfectly safe or being used to open a port on your computer through which a third party might steal out your personal or crucial information. The internet is filled with hackers who are looking for opportunities like this to step into a connected computer and may leave everything intact or may harm your data or compromise some crucial information like credit card numbers and passwords. This is the point where a Firewall comes into play. It is one of the most popular measures to reduce the probability of being compromised by a wandering hacker or a website which might leak your private information.
“Technically, a firewall can be a router programmed to filter some specific type of data or a PC combination of hardware and software configured specially for monitoring incoming and outgoing traffic from the host computer.”
“Theoretically, all the data travelling over the network will pass through the firewall, so it will be monitored according to the firewall’s rules, reducing chances of unauthorized access.”
Firewalls are not gateways, but they often do work in association with gateways. Both firewalls and gateways tend to sit between networks. The gateway’s job is to translate packets as they move between different network environments; the firewall’s job is to filter the packets. Generally a gateway can be taken as the gate or path which joins together two networks that use different base protocols. Then, a firewall can be treated as a guard standing in that gate who permits or denies data packets.
There are several ways of threats through which information regarding your network can be compromised if preventive measures are not made. Some of these are; Remote Login, Application Backdoors, SMTP session hijacking, operating system bugs, Denial of Service attacks, Email bombs, Macros, Spam, Redirect bombs.
It is not necessary that a firewall detects and eliminates all of the above mentioned threats, but there is a highly reduced chance of security being compromised through these threats when you have a decent firewall at the head of your network. A firewall is usually configured to allow only specific data to be directed through the network. Although it’s always a good plan to setup anti-viruses on all your workstations, firewalls are specialized for network traffic while anti-viruses are particular for local traffic (information flowing within a single computer). Firewall can also be set on workstation which just protect that single workstation.
Watch that how a firewall works in the video below: