What is stateful inspection in networking? (2024)

What is stateful inspection in networking? (1)

By

  • Robert Sheldon

What is stateful inspection in networking?

Stateful inspection, also known as dynamic packet filtering, is a firewall technology that monitors the state of active connections and uses this information to determine which network packets to allow through the firewall. Stateful inspection is commonly used in place of stateless inspection, or static packet filtering, and is well suited to Transmission Control Protocol (TCP) and similar protocols, although it can also support protocols such as User Datagram Protocol (UDP).

Stateful inspection is a network firewall technology used to filter data packets based on state and context. Check Point Software Technologies developed the technique in the early 1990s to address the limitations of stateless inspection. Stateful inspection has since emerged as an industry standard and is now one of the most common firewall technologies in use today.

What is stateful inspection in networking? (2)

Stateful inspection operates primarily at the transport and network layers of the Open Systems Interconnection (OSI) model for how applications communicate over a network, although it can also examine application layer traffic, if only to a limited degree. Packet filtering is based on the state and context information that the firewall derives from a session's packets:

  • State. The state of the connection, as it's specified in the session packets. In TCP, for example, the state is reflected in specific flags, such as SYN, ACK and FIN. The firewall stores state information in a table and updates the information regularly.
  • Context. Information such as source and destination Internet Protocol (IP) addresses and ports, sequence numbers and other types of metadata. The firewall also stores context information and updates it regularly.

By tracking both state and context information, stateful inspection can provide a greater degree of security than with earlier approaches to firewall protection. The stateful firewall inspects incoming traffic at multiple layers in the network stack, while providing more granular control over how traffic is filtered. The firewall can also compare inbound and outbound packets against the stored session data to assess communication attempts.

What are stateful and stateless inspection?

Stateful inspection has largely replaced stateless inspection, an older technology that checks only the packet headers. The stateless firewall uses predefined rules to determine whether a packet should be permitted or denied. It relies on only the most basic information, such as source and destination IP addresses and port numbers, and never looks past the packet's header, making it easier for attackers to penetrate the perimeter.

For example, an attacker could pass malicious data through the firewall simply by indicating "reply" in the header.

What is stateful inspection in networking? (3)

Stateful inspection can monitor much more information about network packets, making it possible to detect threats that a stateless firewall would miss. A stateful firewall maintains context across all its current sessions, rather than treating each packet as an isolated entity, as is the case with a stateless firewall. However, a stateful firewall requires more processing and memory resources to maintain the session data, and it's more susceptible to certain types of attacks, including denial of service.

With stateless inspection, lookup operations have much less of an impact on processor and memory resources, resulting in faster performance even if traffic is heavy. That said, a stateless firewall is more interested in classifying data packets than inspecting them, treating each packet in isolation without the session context that comes with stateful inspection. This also results in less filtering capabilities and greater vulnerability to other types of network attacks.

What is stateful inspection in networking? (4)

How does stateful inspection work?

Stateful inspection monitors communications packets over a period of time and examines both incoming and outgoing packets. The firewall tracks outgoing packets that request specific types of incoming packets and allows incoming packets to pass through only if they constitute a proper response.

A stateful firewall monitors all sessions and verifies all packets, although the process it uses can vary depending on the firewall technology and the communication protocol being used.

For example, when the protocol is TCP, the firewall captures a packet's state and context information and compares it to the existing session data. If a matching entry already exists, the packet is allowed to pass through the firewall. If no match is found, the packet must then undergo specific policy checks. At that point, if the packet meets the policy requirements, the firewall assumes that it's for a new connection and stores the session data in the appropriate tables. It then permits the packet to pass. If the packet doesn't meet the policy requirements, the packet is rejected.

The process works a little differently for UDP and similar protocols. Unlike TCP, UDP is a connectionless protocol, so the firewall cannot rely on the types of state flags inherent to TCP. Instead, it must use context information, such as IP addresses and port numbers, along with other types of data. In effect, the firewall takes a pseudo-stateful approach to approximate what it can achieve with TCP.

In a firewall that uses stateful inspection, the network administrator can set the parameters to meet specific needs. For example, an administrator might enable logging, block specific types of IP traffic or limit the number of connections to or from a single computer.

In a typical network, ports are closed unless an incoming packet requests connection to a specific port and then only that port is opened. This practice prevents port scanning, a well-known hacking technique.

This was last updated in August 2021

Continue Reading About stateful inspection

  • Top 4 firewall-as-a-service security features and benefits
  • What are the 5 types of network firewalls and how are they different?
  • The benefits of application proxy firewalls
  • Introduction to intrusion detection and prevention technologies
  • What is secure remote access in today's enterprise?

Related Terms

Pegasus malware
Pegasus malware is spyware that can hack any iOS or Android device and steal a variety of data from the infected device, ...Seecompletedefinition
SD-WAN security
SD-WAN security refers to the practices, protocols and technologies protecting data and resources transmitted across ...Seecompletedefinition
threat actor
A threat actor, also called a malicious actor or bad actor, is an entity that is partially or wholly responsible for an incident ...Seecompletedefinition

Dig Deeper on Network security

  • Stateful vs. stateless firewalls: Understanding the differencesBy: MichaelCobb
  • firewallBy: KinzaYasar
  • packet filteringBy: GavinWright
  • stateless appBy: PaulKirvan
What is stateful inspection in networking? (2024)

FAQs

What is stateful inspection in networking? ›

Stateful packet inspection is a technology used by stateful firewalls to determine which packets to allow through the firewall. It works by examining the contents of a data packet and then comparing them against data pertaining to packets that have previously passed through the firewall.

What does stateful mean in networking? ›

Stateful applications and processes allow users to store, record, and return to already established information and processes over the internet. In stateful applications, the server keeps track of the state of each user session, and maintains information about the user's interactions and past requests.

What is the difference between stateful and stateless inspection? ›

Stateful firewalls can offer more advanced application-level inspection by analyzing the content and behavior of higher-level protocols, allowing for deeper inspection and filtering at the application layer (Layer 7). Stateless firewalls typically lack advanced application-level inspection capabilities.

What best describes a stateful inspection? ›

Stateful inspection is a technology by which a deeper analysis of the information contained in the packets (up to the application layer) is performed, and subsequent filtering decisions are based on what the firewall “learned” from packets that it examined previously.

What is the difference between stateful inspection and deep packet inspection? ›

So while stateful packet inspection only evaluates packet header information, such as source IP address, destination IP address, and port number, deep packet inspection looks at a more comprehensive range of data and metadata associated with individual packets.

What is a stateful inspection in networking? ›

Stateful packet inspection is a technology used by stateful firewalls to determine which packets to allow through the firewall. It works by examining the contents of a data packet and then comparing them against data pertaining to packets that have previously passed through the firewall.

Is TCP stateful or stateless? ›

Examples of stateful protocols include the Transmission Control Protocol (TCP) and the File Transfer Protocol (FTP). Stateless protocols improve the properties of visibility, reliability, and scalability.

Is HTTP stateful or stateless? ›

The HTTP protocol is a stateless one. This means that every HTTP request the server receives is independent and does not relate to requests that came prior to it.

Is rest API stateful or stateless? ›

Stateless: REST APIs are stateless, meaning that calls can be made independently of one another, and each call contains all of the data necessary to complete itself successfully.

Which is better stateless or stateful? ›

The Stateful protocol design makes the design of server very complex and heavy. Stateless Protocols works better at the time of crash because there is no state that must be restored, a failed server can simply restart after a crash.

What are the benefits of stateful inspection? ›

Stateful firewalls can detect when illicit data is being used to infiltrate the network. A stateful inspection firewall also has the ability to log and store important aspects of network connections. Stateful firewalls have no need for many ports to be open to facilitate smooth communication.

What is DMZ in networking? ›

What is a DMZ network? In computer security, a DMZ network (sometimes referred to as a “demilitarized zone”) functions as a subnetwork containing an organization's exposed, outward-facing services. It acts as the exposed point to an untrusted network, commonly the internet.

Which generation firewall is stateful inspection? ›

A next-generation firewall (NGFW) does this, and so much more. In addition to access control, NGFWs can block modern threats such as advanced malware and application-layer attacks. According to Gartner's definition, a next-generation firewall must include: Standard firewall capabilities like stateful inspection.

What are the disadvantages of stateful inspection firewall? ›

Top Stateful Firewall Disadvantages
  • Data transfers speeds are static and generally slow.
  • More susceptible to Man-in-the-Middle (MITM) attacks.
  • Takes time to become custom-fit to the security needs of your network.
  • Doesn't operate on the application layer, or 7th layer.
Mar 7, 2023

Do SPI firewalls only do stateful packet inspection? ›

Yes. SPI firewalls are especially good at preventing hacking. Because SPI firewalls look at the context of traffic flow and not just the content of data packets, they can detect if a connection request is coming from a suspicious source.

What is an example of a stateful firewall? ›

An example of a stateful firewall would be a next-generation firewall (NGFW) that offers deep packet inspection and maintains a state table of all network connections.

What is stateful vs stateless? ›

Functions and design patterns can also be stateful or stateless. The key principle behind something that is stateful is that it has perfect memory or knowledge of previous calls or requests, while something that is stateless has no memory or knowledge of previous calls or requests.

What are examples of stateful? ›

Stateful System

Further, every new interaction with the system changes its state and produces a different output. Other examples of stateful systems include email services (like Gmail) and social media platforms.

Is A router stateful or stateless? ›

Standard access control lists configured on routers and Layer 3 switches are also stateless.

Is HTTP is stateful or stateless? ›

The HTTP protocol is a stateless one. This means that every HTTP request the server receives is independent and does not relate to requests that came prior to it.

Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 5921

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.