A firewall is a program or device that acts as a barrier to keep destructive elements out of a network or specific computer. Firewalls are configured (in hardware, software, or both) with specific criteria to block or prevent unauthorized access to a network. They work as filters for your network traffic by blocking incoming packets of information that are seen as unsafe. In large corporations, if a firewall is not in place, thousands of computers could be vulnerable to malicious attacks. Firewalls should be placed at every connection to the internet and are also used to control outgoing web traffic as well in large organizations.
Firewalls use several strategies to control traffic flowing in and out of networks. Packet filtering is when small chunks of data (called packets) are run through a filter and analyzed. Stateful inspection is where the contents of each packet are not examined, but instead key parts of the packet are compared to a database of trusted information, letting through the packets that pass this test. Firewalls can be configured to filter by several variables: IP address, domain name, protocol, port or even specific words or phrases. Though some operating systems come with a built-in firewall, internet routers also provide very affordable firewall protection when configured properly.