What does a stateful firewall do that a packet filtering firewall does not?

A stateful firewall collects data regarding every connection made through it. All of these data points form profiles of “safe” connections. When a subsequent connection is attempted, it is checked against the list of attributes collected by the stateful firewall. If it has the qualities of a safe connection, it is allowed to occur. If not, the data packets are discarded. Data packets contain information about the data within them. A stateful firewall performs packet inspection, which checks the contents of packets to see if they pose threats.

Stateful firewalls can also integrate additional services, such as encryption or tunnels. These boost performance because they block malicious actors from reading the contents of communications, thereby making the connection safer through access control.

TCP is one of the primary protocols the internet uses to send and receive data, allowing data to be sent and received at the same time. In addition to helping transmit information, TCP contains data that can result in a reset (RST) of the connection, stopping it completely. TCP also dictates when the transmission should end with a FIN (finish) command. It groups data into packets, and when they arrive at the destination, the packets are reassembled into data the receiver can understand. 

Stateful firewalls use TCP traffic to keep track of connections by examining the contents of the packets created in the TCP process. The three stages of a TCP connection—synchronize (SYN), synchronize-acknowledge (SYN-ACK), and acknowledge (ACK)—are used by a stateful inspection firewall to identify the parties involved in order to spot a potential threat. If signs of a bad actor are revealed as the TCP handshake takes place, the stateful firewall can discard the data.

Examine the important differences between stateful and stateless firewalls, and learn when each type of firewall should be used in an enterprise setting.

  • Share this item with your network:

By

  • Michael Heller, Senior Reporter
  • Mike Chapple, University of Notre Dame

When considering stateful vs. stateless firewalls, the distinction between the two approaches may sound minor but...

Sign in for existing members

Continue Reading This Article

Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

Step 2 of 2:

  • You forgot to provide an Email Address.

    This email address doesn’t appear to be valid.

    This email address is already registered. Please log in.

    You have exceeded the maximum character limit.

    Please provide a Corporate Email Address.

    • I agree to TechTarget’s Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

    Please check the box if you want to proceed.

    • I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.

    Please check the box if you want to proceed.

  • By submitting my Email address I confirm that I have read and accepted the Terms of Use and Declaration of Consent.

is actually quite significant.

Stateless firewalls, one of the oldest and most basic firewall architectures, were the standard at the advent of the firewall. Originally described as packet-filtering firewalls, this name is misleading because both stateless firewalls and stateful firewalls perform packet filtering, just in different ways and levels of complexity. For example, stateful firewalls inspect the packet payload, while stateless firewalls only inspect the packet protocol header.

Additionally, a stateful firewall always monitors data packets and the context of traffic on all network connections, whereas a stateless firewall does not inspect data packets and only determines the safety of a connection in isolation, based on predetermined rules, including the incoming traffic type, port number or destination address.

Stateful inspection became the norm in most environments years ago, and the majority of modern firewall systems take advantage of it.

Let's investigate the differences and how to choose which is best for your business.

Stateful firewalls

Stateful inspection systems have a constant view of all network connections and maintain a state table based on decisions made, while stateless firewalls do not. A state table enables a stateful firewall to keep track of all open connections, including context of the traffic, such as source and destination IP addresses, packet length, protocol states and port information. When traffic arrives, the system compares the traffic to the state table to determine whether it is part of an established connection.

This means a state table is made up of the sum total of connections established or blocked by the stateful firewall. Future filtering decisions take this history into account when determining if new traffic might be malicious. This also means stateful firewalls can block much larger attacks that may be happening across individual packets.

The deeper packet inspection performed by a stateful firewall can also monitor a TCP handshake between devices and recognize packets as part of existing connections.

However, all this monitoring comes at a higher cost in terms of processing power and speed. The increased processing requirements make stateful firewalls susceptible to distributed denial-of-service attacks and man-in-the-middle attacks, and the higher complexity of the internal code can result in vulnerabilities that can be attacked if software isn't up to date.

Stateless firewalls

Stateless firewalls rely on predetermined rules in access control lists (ACLs) to make decisions on individual packets. They inspect the packet header for information, including source and destination IP addresses, port number and static traffic type (TCP vs. User Datagram Protocol).

As a result, stateless firewalls are more limited in their ability to filter traffic, and because they rely on ACLs, the filtering is only as good as the rules defined by the user. Stateless firewalls are more prone to user error if ACLs aren't managed properly and cannot adapt over time.

While this relative simplicity makes stateless firewalls less resource-intensive, faster and able to handle heavy traffic, the limitations mean they can only be deployed in specific scenarios within an enterprise.

The most common implementation of a stateless firewall today is at an internet-facing router. These devices often implement a basic packet-filtering rule set to weed out obviously unwanted traffic and reduce the load on a stateful inspection firewall immediately behind the router.

Choosing between stateful and stateless firewalls

Stateless firewalls are commonly used by consumers but can also be an option for small businesses with limited budgets and less traffic. Less traffic generally means fewer threats to consider, which would make setting the rules for a stateless firewall a manageable task. Stateless firewalls may also be useful in limited scenarios on internal networks, such as between virtual LANs.

For larger enterprises with more traffic that face more threats, stateful firewalls offer more security features and capabilities. However, if an enterprise uses more modern applications that use more than one port for different services or change ports, it may be necessary to look beyond stateful firewalls to next-generation firewalls, which inspect applications rather than just network connections.

This was last published in July 2020

Related Resources

  • Tackling Mobile Security and BYOD Risks –SearchSecurity.com
  • Enforcing Endpoint Security: Creating a Network Security Policy –SearchSecurity.com
  • Desktop Admin for BYOD: Security Chapter –SearchSecurity.com
  • E-Guide: Wireless LAN access control: Managing users and their devices –SearchSecurity.com

Dig Deeper on Network security

  • What does a stateful firewall do that a packet filtering firewall does not?
    stateless app

    What does a stateful firewall do that a packet filtering firewall does not?

    By: Paul Kirvan

  • What does a stateful firewall do that a packet filtering firewall does not?
    next-generation firewall (NGFW)

    What does a stateful firewall do that a packet filtering firewall does not?

    By: Casey Clark

  • What does a stateful firewall do that a packet filtering firewall does not?
    deep packet inspection (DPI)

    What does a stateful firewall do that a packet filtering firewall does not?

    By: Rahul Awati

  • What does a stateful firewall do that a packet filtering firewall does not?
    stateful inspection

    What does a stateful firewall do that a packet filtering firewall does not?

    By: Robert Sheldon

Related Q&A from Michael Heller

Site-to-site VPN security benefits and potential risks

Not every enterprise needs the functionality of a standard VPN client. A site-to-site VPN may be a better choice for some companies, but it's not ...  Continue Reading

How to send secure email attachments

Sending sensitive information in attachments is inherently unsafe, and the main way to secure them -- encryption -- can be implemented inconsistently...  Continue Reading

Identifying and troubleshooting VPN session timeout issues

Troubleshooting VPN session timeout and lockout issues should focus first on isolating where the root of the problem lies -- be it the internet ...  Continue Reading

What is the advantage of a stateful firewall over a port filtering firewall?

Pros of Stateful Firewall The powerful memory retains key attributes of network connections. These firewalls do not need many ports open for proper communication. Stateful firewalls offer extensive logging capabilities and robust attack prevention.

What advantage does a stateful firewall have?

Stateful firewalls are smarter and responsible to monitor and detect the end-to-end traffic stream, and to defend according to the traffic pattern and flow. It filters the packets based on the full context given to the network connection. These firewalls are faster and work excellently, under heavy traffic flow.

What is the main difference between stateful and stateless packet filtering methods?

Whereas stateful firewalls filter packets based on the full context of a given network connection, stateless firewalls filter packets based on the individual packets themselves. To do so, stateless firewalls use packet filtering rules that specify certain match conditions.

What is the difference between firewall and packet filter?

All the traffic in either direction must pass through the firewall. It then decides whether the traffic is allowed to flow or not. ... Difference :.