Sergey Nivens - Fotolia

Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

The 5 different types of firewalls

Learn about the similarities and differences among five basic types of firewalls, including packet filtering firewalls, application-level gateways and next-gen firewalls.

Once early internet systems administrators began to understand that they were frequently being attacked, the network firewall was inevitable. There was destined to be some sort of process that looked at network traffic for clear signs of attackers. Exactly how this was going to work was less clear.

Steven Bellovin, then a fellow at AT&T Labs Research in Florham Park, N.J., and currently a professor in the computer science department at Columbia University, is generally credited -- although not by himself -- with first using the term firewall to describe the process of filtering out unwanted network traffic, sometime around 1987. The name was a metaphor, likening the device to partitions that keep a fire from migrating from one part of a physical structure to another. In the networking case, the idea was to insert a filter of sorts between the ostensibly safe internal network and any traffic entering or leaving from that network's connection to the broader internet.

The term has grown gradually in familiar usage to the point that no casual conversation about network security can take place without at least mentioning it. Along the way, the firewall has evolved in various ways to produce different types of firewalls. This article somewhat arbitrarily argues that there are five key types of firewalls, but the exact number of options is not nearly as important as the idea that different kinds of firewall products do rather different things.

The five types of firewall are:

  1. Packet filtering firewall
  2. Circuit-level gateway
  3. Stateful inspection firewall
  4. Application-level gateway (aka proxy firewall)
  5. Next-generation firewall (NGFW)

Firewall devices and services can offer protection beyond standard firewall function -- for example, by providing intrusion detection, denial-of-service attack protection and other security services to protect servers and other devices within the private network. While some types of firewalls can work as multifunctional security devices, don't allow such offerings to distract from the key question: Does this firewall protect the private network from external threats by examining protocol data units?

How do the different types of firewalls work?

Firewalls are inserted inline across a network connection and look at all the traffic passing through that point. As they do so, they are tasked with telling which network protocol traffic is benign and which packets are part of an attack.

A computer program that can generally look at a string of computer instructions and determine its intent runs abruptly into a fundamental thesis of computer science: No computer program can perfectly predict the outcome of another computer program without running it to see what it does. By extension, it's not possible to generally look at network traffic and discern its intent.

How firewalls work

Firewalls examine packets to keep the bad ones out of enterprise networks.

It is, however, entirely possible to look for known patterns in network packet data that signal attacks that have been seen previously, and this is precisely what early packet filter network firewalls did -- and still do. Generally, whatever sort of firewall is deployed on a network, it is deployed with a constantly updated set of firewall rules that define the criteria under which a given packet -- or set of packets in a transaction -- can safely be routed forward to the intended recipient device.

Here are the five types of firewalls that continue to play significant roles as the firewall category has evolved.

Packet filtering firewall

Packet filtering firewalls operate inline at junction points where devices such as routers and switches do their work. However, these firewalls don't route packets, but rather they compare each packet received to a set of established criteria -- such as the allowed IP addresses, packet type, port number and other aspects of the packet protocol headers. Packets that are flagged as troublesome are, generally speaking, unceremoniously dropped -- that is, they are not forwarded and, thus, cease to exist.

Circuit-level gateway

Using another relatively quick way to identify malicious content, circuit-level gateways monitor TCP handshakes and other network protocol session initiation messages across the network as they are established between the local and remote hosts to determine whether the session being initiated is legitimate -- whether the remote system is considered trusted. They don't inspect the packets themselves, however.

Stateful inspection firewall

State-aware devices, on the other hand, not only examine each packet, but also keep track of whether or not that packet is part of an established TCP or other network session. This offers more security than either packet filtering or circuit monitoring alone but exacts a greater toll on network performance.

A further variant of stateful inspection is the multilayer inspection firewall, which considers the flow of transactions in process across multiple protocol layers of the seven-layer Open Systems Interconnection (OSI) model.

types of firewalls comparison

Application-level gateway

This kind of device -- technically a proxy and sometimes referred to as a proxy firewall -- combines some of the attributes of packet filtering firewalls with those of circuit-level gateways. They filter packets not only according to the service for which they are intended -- as specified by the destination port -- but also by certain other characteristics, such as the HTTP request string.

While gateways that filter at the application layer provide considerable data security, they can dramatically affect network performance.

Next-generation firewall

Next-gen firewall
A high-end, next-gen firewall from Palo Alto Networks, which was among the first vendors to offer advanced features, such as identifying the applications producing all the traffic passing through and integrating with other major network components, like Active Directory.

A typical NGFW combines packet inspection with stateful inspection and also includes some variety of deep packet inspection, as well as other network security systems, such as intrusion detection/prevention, malware filtering and antivirus.

While packet inspection in traditional firewalls looks exclusively at the protocol header of the packet, deep packet inspection looks at the actual data the packet is carrying. A deep packet inspection firewall tracks the progress of a web browsing session and is capable of noticing whether a packet payload, when assembled with other packets in an HTTP server reply, constitutes a legitimate HTML formatted response.

How to choose the right type of firewall

Choosing the right type of firewall means answering questions about what the firewall is intended to do, how it will be used, what it is intended to protect and any number of general questions about the infrastructure it is intended to protect. The right firewall for different organizations will almost invariably differ from one to another, as each private network is unique and has its own unique requirements.

Issues to consider include:

  • What are the technical objectives for the firewall, and can a simpler product work better instead of a firewall with more features and capabilities that may not be necessary?
  • How does the firewall itself fit into the organization's architecture? This means considering whether the firewall is intended to protect a low-visibility service exposed on the internet or a web application.
  • Understanding what kind of traffic inspection is necessary; some applications may require monitoring the contents of all packets, while others can be achieved simply by sorting packets based on source/destination addresses and ports.

Many firewall implementations incorporate features of different types of firewalls, so choosing a type of firewall is rarely a matter of finding one that fits neatly into any particular category. For example, an NGFW may incorporate features of packet filtering firewalls, application-level gateways or stateful inspection firewalls.

Choosing the ideal firewall begins with understanding the architecture and functions of the private network being protected but also calls for understanding the different types of firewalls and firewall policies that are most effective for the organization.

Whichever of the types of firewalls you choose, keep in mind that a misconfigured firewall can, in some ways, be worse than no firewall at all because it lends the dangerous impression of security, while providing little or none.

Peter Loshin contributed to this report.

This was last published in May 2019

Dig Deeper on Network device security: Appliances, firewalls and switches

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

Security professionals say the traditional perimeter is gone. Given that it's the firewall that creates a perimeter, does this mean the firewall's days are numbered?
What do you mean days are numbered?
It's an idiom or figure of speech, meaning that firewalls will die soon, due to them being tied to having a discrete perimeter behind which all enterprise devices are resident.

As the perimeter becomes more porous, firewalls become less effective at keeping malicious traffic out.
What do you think is the best combination of firewall types for a modern enterprise?
I think the firewall appliance heading to a new era of Machine Learning. The only thing is that the ML firewall have a hard time dealing with Zero Trust Network Access

In what ways does a machine learning firewall struggle with zero trust?

Firewalls are both software programs as well as hardware components that preserve our security and maintain safety from unauthorized access to or from the external network. They act as a vital part of a comprehensive security framework for any network. It inspects every packet that comes (inbound) and goes out (outbound) of it and used for your purpose, and it determines whether it needs to be passed or blocked. In short, firewalls defend our resources by validating access, manage and organize legitimate network traffic, acts as an intermediary as well as records and reports different events. Security analysts get specialized training to set policies and access norms for firewalls so that they can filter and monitor as well as restrict unintended data packets to pass through them.

Types of Firewalls

  • Packet Filtering Firewall: It is the first of its kind used for network security and is accountable for filtering and checking incoming data packets - which allow data from specific IP addresses, types of packets, specific port numbers, etc.
  • Circuit Level Firewall: it is used for operating at the session level. It is used to monitor TCP handshakes rather than data packets just to check whether the sessions are genuine or not.
  • Stateful Inspection Firewall: It is used for filtering both data packet as well as session filtering. It checks for active sessions and network packets whether they are legitimate or not.
  • Application Level Firewall: It functions at the application layer. Filtering of traffic is done concerning the application (or service) for which they are planned.

Benefits of Using Firewalls

  • It stops attacks on your network from external networks and agents.
  • It acts as a filter and keeps away the non-authoritative users.
  • It permits monitoring the network security and alarms its users when any malicious activity is detected.
  • IT also observes as well as records services used by WWW (World Wide Web), FTP (File Transfer Protocol), and some other commonly used protocols.
  • It also blocks or un-block those inbound and outbound packets.