Stateful Inspection: A Firewall Remembers the Conversation
Stateful inspection lets a firewall use a record of network communication when deciding whether to allow later traffic. A firewall applies rules that permit or block traffic; keeping state means remembering enough about an allowed exchange to judge what follows.
A packet is a small unit of network data. A basic packet filter considers each one separately; a firewall using stateful inspection also checks the conversation it appears to belong to.
How a Firewall Decides What Gets Through
An allowed request leaves a record
Suppose a laptop is permitted to establish a TCP connection to a server. TCP, or Transmission Control Protocol, defines rules for a connected exchange between programs.
The firewall can record the Internet Protocol (IP) addresses and port numbers at both ends, along with the connection's state. An IP address identifies a network location. A port is a number that helps distinguish the service or communication endpoint at that location.
When return traffic arrives, the firewall compares it with the record and its rules. Does it match the expected endpoints? Does it fit what is allowed at this stage of the exchange?
This is more information than an isolated source-address test can provide. The firewall can distinguish packets consistent with a tracked connection from packets that claim a place in a conversation the record doesn't support.
The National Institute of Standards and Technology's firewall guide describes this state table and the distinction from stateless packet filtering. An outgoing connection is a useful illustration, but the rules can also permit connections initiated from elsewhere; stateful inspection doesn't inherently mean all conversations must start inside.
The memory has a lifetime
TCP has defined stages for setting up, maintaining and closing a connection. Its state-machine description explains why the stage is meaningful context for the next message.
UDP, the User Datagram Protocol, works differently. It sends individual messages without TCP's connection setup. Firewalls can still track the relevant address-and-port combinations and use timeouts to decide how long to retain the record.
So “stateful” doesn't mean every protocol supplies the same state information. The firewall's tracking must fit the protocol. Records close or expire rather than creating a permanent allowance for anything that later uses a familiar address.
- Skip the install: pfSense Plus comes preloaded, so you can start writing rules right away.
- Get a firewall, router and VPN in one silent box that sips power.
- Keep receiving pfSense Plus updates for the life of the product.
Expected traffic can still carry an unwanted message
A packet can fit the recorded connection while carrying harmful application data. Recognizing the conversation doesn't establish that every instruction, file or page inside it is safe.
The firewall guide treats application inspection as additional analysis. A product may combine it with stateful tracking, but tracking a connection alone doesn't perform that content check.
Cisco Reflexive ACLs: A Temporary Rule for the Reply

TCP's Three-Way Handshake: What Those Messages Do

Next-Generation Firewalls: A Closer Look at Allowed Traffic

QUOTE:
"Amateurs hack systems, professionals hack people."
