Stateful vs Stateless Firewalls

On this page
  1. How do they differ?
  2. When is stateless still useful?

The difference between stateless and stateful firewalls is memory. A stateless firewall judges each packet on its own against fixed rules; a stateful firewall remembers active connections and judges packets in that context. That memory lets stateful firewalls make smarter decisions with simpler rules, which is why they became the default.

How do they differ?#

StatelessStateful
Unit of decisionSingle packetWhole connection
Memory of prior trafficNoneTracks active sessions
Return trafficNeeds explicit rulesAllowed automatically
Resource useMinimalHigher (connection table)
SpeedVery fastFast, slightly more work

The practical win of stateful inspection: when a host inside makes an outbound connection, the firewall remembers it and automatically permits the matching return packets — while rejecting unsolicited packets that merely claim to be replies. A stateless firewall needs broad, riskier rules to achieve the same, or it blocks legitimate responses.

When is stateless still useful?#

At very high throughput where per-packet simplicity matters, or as a coarse first filter in front of a stateful device. Stateless rules also underpin things like router ACLs. But for general boundary enforcement, stateful is the sensible baseline.

The stateful/stateless distinction is core firewall knowledge. More at the Network Security hub.

Frequently asked questions#

What is the difference between a stateful and stateless firewall?

A stateless firewall evaluates each packet in isolation against static rules, with no memory of prior traffic. A stateful firewall tracks the state of active connections, so it can allow return traffic for a connection it already permitted and block packets that do not belong to any known session. Stateful is smarter but uses more resources.

Why are stateful firewalls the default today?

Because tracking connection state lets them make far better decisions with simpler rules — automatically allowing legitimate return traffic while rejecting unsolicited packets that claim to be replies. This closes gaps that stateless rules struggle with, at a modest cost in memory and processing that modern hardware easily absorbs.

Sources & further reading