Every firewall answers one of three questions about the traffic in front of it. A stateless packet filter asks whether this packet, on its own, is allowed. Stateful packet inspection (SPI) asks whether the packet belongs to a conversation the policy already allowed. Deep packet inspection (DPI) asks what the conversation is actually carrying. The history of how the industry moved from the first question to the third, and who argued for what, is told in The Firewall: Birth, Generations, and What Comes After the Perimeter; what carriers do with DPI and how the law constrains it is in Net neutrality in the network and in the companion blog post on the rules. This article is about the mechanics. It walks a Transmission Control Protocol (TCP) connection through a stateful firewall one packet at a time, shows what the connection table holds and when it forgets, follows the User Datagram Protocol (UDP) and the Internet Control Message Protocol (), the error and diagnostic companion of the Internet Protocol (IP), through the same table, and then opens the deep inspection engine: reassembly, decoders, signatures, application identification and the limits encryption sets. After it you should be able to read a session table on Linux, FortiGate, -OS, Check Point or BIG-IP, predict what an idle timeout will do to a long-lived connection, and say precisely what a DPI engine can know about a connection protected by Transport Layer Security (TLS) 1.3, the protocol still often called by the name of its predecessor, the Secure Sockets Layer (SSL). The byte-level companion, a TLS 1.3 handshake read the way an inspection engine reads it, is What a firewall still sees in an encrypted connection.
Three questions, and the vocabulary for them
The standards bodies never standardized firewalls, but they did describe them. (Request for Comments) 2979, written by Ned Freed and published by the Internet Engineering Task Force () in October 2000, defines a firewall as "an agent which screens network traffic in some way, blocking traffic it believes to be inappropriate, dangerous, or both", and says firewalls act either as a protocol end point and relay, such as an (Simple Mail Transfer Protocol) server or a web proxy, or as a packet filter that is not visible as an end point and that passes each packet unchanged, drops it, or handles it itself. RFC 3234, by Brian Carpenter and Scott Brim (February 2002), puts firewalls in a larger family: a middlebox, a phrase it credits to Lixia Zhang, is "any intermediary device performing functions other than the normal, standard functions of an IP router on the datagram path between a source host and destination host". It describes the simplest firewall as a router that rejects packets "based purely on fields in the IP and Transport headers", and an application firewall as one that acts as a protocol end point and may implement a safe subset of the protocol or perform extensive validity checks. RFC 3234 also sorts middleboxes by facets, and two of them matter throughout this article: hard state against soft state (does the session fail if the box loses its memory?) and in-line against call-out.
The United States National Institute of Standards and Technology () gives the three generations their usual names in Special Publication (SP) 800-41 Revision 1, by Karen Scarfone and Paul Hoffman (September 2009): packet filtering, stateful inspection, and application firewalls that add "stateful protocol analysis, referred to by some vendors as deep packet inspection". Its companion on intrusion detection, SP 800-94 (February 2007), adds a warning worth keeping in mind: it prefers "stateful protocol analysis" because "historically there has not been consensus in the security community as to the meaning of 'deep packet inspection'". The International Telecommunication Union's Telecommunication Standardization Sector (ITU-T) did publish requirements for DPI equipment in networks, Recommendation Y.2770 of November 2012, and RFC 8404 (July 2018), written for operators, describes DPI as what "allows identification of applications based on payload signatures, in contrast to trusting well-known port numbers". Those are the working definitions here.
RFC 2979 also states the rule every inspection method below is measured against, the transparency rule: "The introduction of a firewall and any associated tunneling or access negotiation facilities MUST NOT cause unintended failures of legitimate and standards-compliant usage that would work were the firewall not present." A firewall may block whatever its owner deems illegitimate; what it may not do is break legitimate traffic by accident. Most of the operational trouble in this article, from silent idle drops to TLS 1.3 handshakes that failed through old middleboxes, is a breach of that rule.
Stateless filtering: each packet judged alone
A stateless filter keeps no memory. Each packet is compared with an ordered list of rules on what the packet itself carries: source and destination addresses, protocol, ports, TCP flags, the interface and the direction. The glossary entry on the packet filter covers how vendors evaluate those lists (first match on Cisco and in RFC 8519's model, last match unless quick in OpenBSD's Packet Filter (PF), an implicit deny or an implicit accept depending on the platform), and the article on access control lists on switches and routers shows the rules on real devices. What matters here is the one thing a stateless filter cannot do: tell a reply from an unsolicited packet.
Take a policy that should let an internal client at 192.0.2.10 browse a web server at 203.0.113.80 on port 443, and nothing else. A stateless filter needs two rules, one per direction:
| Rule | Direction | Source | Destination | Protocol and ports | Action |
|---|---|---|---|---|---|
| 1 | outbound | 192.0.2.10, any port | 203.0.113.80, port 443 | TCP | permit |
| 2 | inbound | 203.0.113.80, port 443 | 192.0.2.10, ports 1024 to 65535 | TCP | permit |
| 3 | any | any | any | any | deny |
Rule 2 is the problem. The client's source port is chosen at random for each connection, so the return rule has to open the whole range of ephemeral ports to anything that claims to come from port 443 of the server. Anyone who can send a packet with that source address and port reaches every high port of the client. The classic refinement, described in the packet filter entry, is to require a flag that every reply carries: Cisco's established keyword passes TCP segments with the acknowledgement (ACK) or reset (RST) bit set, which excludes a bare SYN (synchronize) that would open a new connection inwards, but any sender can set ACK on a forged segment. UDP has no flags at all, so a stateless rule for UDP replies, for example Domain Name System (DNS) answers from port 53, can only open port ranges. RFC 3234 adds a second weakness: stateless firewalls "typically allow all IP fragments through", because a non-first fragment carries no transport header to judge. RFC 1858 (October 1995) describes how a filter that judges only first fragments can be defeated by pushing TCP header fields into a second fragment, and the packet filter entry follows its later variants.
None of this makes stateless filtering obsolete. It needs no memory, so it runs in switch and router hardware at line rate and cannot be exhausted; ingress filtering (RFC 2827, Best Current Practice 38, of May 2000) and infrastructure access lists that protect a router's control plane are better done without state. The BIG-IP packet filters and Advanced Firewall Manager (AFM) rule processing articles show the same split on one platform: a stateless filter in front, a stateful firewall behind it. The rest of this article is about the box behind.
Stateful inspection: the connection table
The idea that fixes the reply problem is to remember the request. When the first packet of a connection is allowed by policy, the firewall writes an entry describing the connection into a table; every later packet is looked up in that table first, and a packet that matches an entry in the right direction and the right state passes without the rule base being consulted again. A reply is then not "anything from port 443 to a high port" but "the reply to this specific request". NIST describes exactly that: when an internal host connects outwards and the ruleset permits it, "an entry is added to the state table that indicates a new session is being initiated", and once the three-way handshake completes "the connection state will change to 'established' and all subsequent traffic matching the entry will be allowed to pass". It adds that the simplest implementations accept any packet that "seems to be part of an open connection", while many check "attributes such as TCP sequence numbers and reject packets that are out of sequence", and that a firewall doing network address translation () "often includes NAT information in its state table".
The idea was productized by Check Point. Gil Shwed filed United States patent 5,606,668 on 15 December 1993; it was granted on 25 February 1997 and has since expired. The patent describes a packet filter module that runs compiled filter code in a small virtual machine, and two operations that are the seed of the connection table: a record operation that stores values in tables, and a lookup operation that lets the instructions of one security rule find data left by another, because the scratch memory is "initialized whenever a new security rule is processed". Its service definitions already include "the timeout in seconds of how long a connectionless session may stay inactive, that is, having no packet transmitted in either direction before assuming that the session is completed": UDP pseudo-state, with a timer, in the original filing. Check Point, founded in 1993 according to its own history page, unveiled FireWall-1 at NetWorld+ in 1994, and Shwed told CSO Online in 2014 that the stateful inspection engine and the simple graphical interface were its strong suits. Check Point's documentation still describes its kernel tables, "also known as State tables", as "a critical component of Stateful Inspection".
What a table entry holds
The entry is keyed on the five values that identify a conversation, the five-tuple: source address, destination address, protocol, source port and destination port (for ICMP the ports are replaced by other fields, as shown below). Around the key, implementations keep the same handful of things, as their own documentation shows:
- Both directions. Linux's connection tracking, conntrack, stores two "hash tuples" for every connection, "one for the original direction" and "one for the reply direction", as Pablo Neira Ayuso, a netfilter developer, explained in the USENIX magazine ;login: in June 2006; the kernel documentation adds that entries are "added to the table twice", which is why a full table has an average hash chain length of two. Check Point's
fw tab -t connectionsoutput shows the same thing as one entry with direction 0 (client to server) and a second "Link" entry with direction 1 pointing back to it. - The state. For TCP, where in the handshake or teardown the connection is; for UDP and ICMP, little more than "reply seen" or "not yet".
- The timer. How many seconds the entry survives without traffic, refreshed by each packet. Check Point prints it as remaining over maximum, "3598/3600"; FortiGate as
expireandtimeout. - The policy decision and its side effects. The rule that allowed it (Check Point's
fw ctl conntabprintsrule=2), the translated addresses if NAT applies (FortiGate'sget system session listhasSOURCE-NATandDESTINATION-NATcolumns), the counters of bytes and packets per direction, the helper module that watches it, and on hardware platforms whether the session has been offloaded.
Neira's article makes a point that holds for every : the tracking system "does not filter the packets themselves"; it classifies them, and the rules decide. In netfilter the classification is one of a few states, NEW, ESTABLISHED, RELATED or INVALID (plus untracked), which "have nothing to do with the TCP states", and the simplest stateful firewall in the nftables documentation is a drop policy followed by one rule, ct state established,related accept.
The rule base is consulted once
The table also changes the cost of a decision. Palo Alto Networks' knowledge base article on the packet flow in PAN-OS divides the work into a slow path for the first packet, where the firewall runs zone protection, TCP state checks, NAT, user identification, denial-of-service (DoS) protection and the security policy lookup before allocating a session and installing it in the flow table for both directions, and a fast path for every packet that matches an existing session, which refreshes the timeout, handles the FIN (finish) and RST timers, applies NAT and passes the data on. FortiGate's knowledge base makes the operational consequence explicit: some changes, "such as security profile changes or session helper changes, apply only to new sessions", so the session table has to be cleared for existing traffic to pick them up. A rule you just tightened does not apply to a connection that was admitted before it.
A TCP connection, packet by packet
Here is one connection through a stateful firewall, followed in the terms uses, because its state machine is published in its source code and its timeouts are documented. The client is 192.0.2.10 port 51514, the server 203.0.113.80 port 443, the policy permits the client to reach the server on 443, and there is no NAT. Sequence numbers are small for readability (real initial sequence numbers are random 32-bit values), and the windows are taken as unscaled byte counts: the client advertises 64,000 bytes, the server 65,000.
The kernel's file nf_conntrack_proto_tcp.c names ten states (NONE, SYN_SENT, SYN_RECV, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, LAST_ACK, TIME_WAIT, CLOSE and SYN_SENT2, the last for a simultaneous open) and gives each its default timeout. Its own comment explains the stance of the code: "We are the man in the middle. All the packets go through us but might get lost in transit to the destination." Each arriving segment is reduced to one of six classes, checked in this order: RST, then SYN with or without ACK, then FIN, then ACK, then none. A segment with both FIN and ACK set therefore counts as a FIN. The class, the direction and the current state index a transition table.
| # | Segment | Direction | Flags, sequence, acknowledgement | Table before | Table after | Timer |
|---|---|---|---|---|---|---|
| 1 | client opens | original | SYN, seq 1000 | no entry: rule base consulted, permit | SYN_SENT, unreplied | 120 s |
| 2 | server accepts | reply | SYN-ACK, seq 5000, ack 1001 | SYN_SENT | SYN_RECV | 60 s |
| 3 | client confirms | original | ACK, seq 1001, ack 5001 | SYN_RECV | ESTABLISHED, assured | 432,000 s |
| 4 | client sends 517 bytes | original | ACK, seq 1001, ack 5001 | ESTABLISHED | ESTABLISHED, window checked | 432,000 s |
| 5 | server answers | reply | ACK, seq 5001, ack 1518 | ESTABLISHED | ESTABLISHED | 432,000 s |
| 6 | client closes | original | FIN, ACK, seq 1518 | ESTABLISHED | FIN_WAIT | 120 s |
| 7 | server acknowledges | reply | ACK, ack 1519 | FIN_WAIT | CLOSE_WAIT | 60 s |
| 8 | server closes | reply | FIN, ACK | CLOSE_WAIT | LAST_ACK | 30 s |
| 9 | client acknowledges | original | ACK | LAST_ACK | TIME_WAIT | 120 s |
| 10 | timer runs out | TIME_WAIT | entry deleted |
Read row by row, the table is the whole mechanism:
- Row 1. There is no entry, so this is the only packet the rule base sees. The transition is "sNO -> sSS: Initialize a new connection". The kernel comment on the FIN row explains what the entry now expects: "Client might not send FIN in this state: we enforce waiting for a SYN/ACK reply first."
- Row 2. The reply direction matches the entry's reply tuple, and the transition is "sSS -> sSR: Standard open." The entry stops being unreplied. Note the sequence arithmetic: the SYN occupies one sequence number, which is why the server acknowledges 1001. RFC 9293, the current TCP specification (August 2022), says so directly: "The SYN and FIN are the only controls requiring this protection."
- Row 3. "sSR -> sES: Established state is reached." The entry is now marked assured, meaning traffic has been seen both ways, and it gets the longest timer in the kernel, five days.
- Rows 4 and 5. Nothing changes state, but every segment refreshes the timer and, unless the administrator relaxes it, is checked against the window (next section).
- Rows 6 to 9. Each FIN half-closes one direction, as in TCP itself (see The TCP Connection Lifecycle): FIN_WAIT after the first FIN, CLOSE_WAIT when it is acknowledged, LAST_ACK when the second FIN arrives ("FIN seen in both directions"), TIME_WAIT on the final ACK. If the server had sent its FIN in the same segment as its acknowledgement, the segment would be classed as a FIN and the entry would jump from FIN_WAIT straight to LAST_ACK; the table has that transition ("sFW -> sLA").
- Row 10. The entry lingers in TIME_WAIT for two minutes so that a retransmitted last ACK still matches, then disappears.
Two other endings are worth knowing. An RST from either side moves any state to CLOSE, which lasts ten seconds. And a SYN that arrives for a four-tuple in TIME_WAIT reopens the connection ("Reopened connection (RFC 1122)"), so a client that reuses a port quickly is not blocked by the memory of its previous connection.
The netfilter project's conntrack-tools manual shows what the first three rows look like as events, with conntrack -E. Rewritten for this example's addresses, in the manual's own format, the open would print:
[NEW] tcp 6 120 SYN_SENT src=192.0.2.10 dst=203.0.113.80 sport=51514 dport=443 [UNREPLIED] src=203.0.113.80 dst=192.0.2.10 sport=443 dport=51514
[UPDATE] tcp 6 60 SYN_RECV src=192.0.2.10 dst=203.0.113.80 sport=51514 dport=443 src=203.0.113.80 dst=192.0.2.10 sport=443 dport=51514
[UPDATE] tcp 6 432000 ESTABLISHED src=192.0.2.10 dst=203.0.113.80 sport=51514 dport=443 src=203.0.113.80 dst=192.0.2.10 sport=443 dport=51514 [ASSURED]
Each line carries the protocol name and number, the seconds left on the timer, the TCP state, then the original tuple and the expected reply tuple. The manual's own example has exactly this shape, with 120, 60 and 432000 as the three timers.
The same connection on four other platforms
Each vendor names the states differently and, more importantly, chooses different timers. From their own documentation:
| Moment | FortiGate (proto_state, second digit) | PAN-OS 11.2 | Check Point R81.20 | Linux conntrack |
|---|---|---|---|---|
| SYN seen | 2, SYN_SENT, timer 10 s | TCP init 5 s (SYN to SYN-ACK) | SYN_SENT | SYN_SENT, 120 s |
| SYN-ACK seen | 3, SYN and SYN/ACK, 10 s | TCP handshake 10 s (SYN-ACK to ACK) | SYN_ACK | SYN_RECV, 60 s |
| Established | 1, session-ttl 3,600 s | TCP 3,600 s | ESTABLISHED, 3,600 s | ESTABLISHED, 432,000 s |
| First FIN | 4, FIN_WAIT, half-close timer 120 s | TCP half closed 120 s | SRC_FIN or DST_FIN | FIN_WAIT, 120 s |
| Both FINs, last ACK | 5, TIME_WAIT, 1 s | TCP time wait 15 s | BOTH_FIN | TIME_WAIT, 120 s |
FortiGate's knowledge base explains its two-digit proto_state: the second digit is the client-side TCP state from the table above, and the first digit is the server side, which stays 0 unless the session goes through flow or proxy inspection; so proto_state=01 is an established session that only the firewall engine has touched. Check Point's fw ctl conntab filters on the states SYN_SENT, SYN_ACK, ESTABLISHED, SRC_FIN, DST_FIN and BOTH_FIN, and its documented examples show an (Secure Shell) connection at "3593/3600" and, in the fw tab output, a TCP entry in state "None" at "2/25". On BIG-IP, where the full proxy terminates connections, the protocol profiles carry the idle timers: F5's DevCentral table of timeouts lists 300 seconds for the tcp, fastHTTP and fastL4 profiles and 60 seconds for udp, and warns that "the shortest timeout that applies to a connection will always take effect". The FortiGate session table explainer decodes a full diagnose sys session list entry field by field.
The difference that bites in practice is the established timer: five days on Linux, one hour on FortiGate, PAN-OS and Check Point, five minutes on a BIG-IP TCP profile. A database connection or an SSH session that sits idle for longer than the firewall's timer loses its entry, and the next segment matches nothing. The stateful inspection glossary entry works through why that produces a hang rather than a refusal, and why the RFC timers for hosts (a TCP keep-alive interval that defaults to "no less than two hours", RFC 1122 of October 1989) and for NATs (no less than 2 hours 4 minutes for an established connection, RFC 5382) do not save you; RFC 6092, the recommendations edited by James Woodyatt of Apple for IPv6 home gateways (January 2011), repeats the 2 hours 4 minutes for stateful filters. The practical rule is the one Palo Alto Networks prints beside its own timers: "Setting a value too low could cause sensitivity to minor network delays", and "Setting a value too high could delay failure detection." Lengthen the timer for the specific service that needs it, or set keep-alives shorter than the firewall's timer, rather than raising it for everything.
Checking the window
A table that only follows flags would accept any segment with the right addresses, ports and flags. Following sequence numbers is what makes forging a segment into an existing connection hard. The Linux code is based, its header says, on "Real Stateful TCP Packet Filtering in IP Filter" by Guido van Rooij, with the boundaries adjusted to the TCP specification. For each direction it keeps the highest sequence number sent (td_end), the highest edge the receiver has allowed, acknowledgement plus window (td_maxend), and the largest window seen (td_maxwin), and accepts a segment only inside four bounds. The first two, in the comment's words, are:
- I. Upper bound for valid data:
seq <= sender.td_maxend - II. Lower bound for valid data:
seq + len >= sender.td_end - receiver.td_maxwin
The other two bound the acknowledgement number in the same way. Worked through for this connection:
- After row 2, the server has acknowledged 1001 and advertised 65,000 bytes, so the client may send up to sequence number 1001 + 65,000 = 66,001. That is the client's
td_maxend. - Row 4 sends 517 bytes starting at 1001. Bound I: 1001 is not above 66,001. Bound II: 1001 + 517 = 1518, which is above the client's
td_endof 1001 minus the server's window of 65,000. Both pass. - A segment forged from outside, carrying the right four values but a guessed sequence number of 900,000, fails bound I (900,000 is above 66,001) and is marked INVALID. To pass, a blind guess has to land inside a window of about 65,000 values out of 4,294,967,296 possible sequence numbers: one chance in about 66,076 per attempt for this window.
The check has costs. It needs to have seen the window scale option in the handshake, so RFC 6092 says the window invariant "MUST NOT be enforced on flows for which the filter did not detect whether the window-scale option ... was sent", which is the situation of a firewall that picks up a connection in the middle, after a failover or a reboot. Linux lets it do that by default (nf_conntrack_tcp_loose, enabled unless set to zero), and offers nf_conntrack_tcp_be_liberal, which marks only out-of-window RST segments as invalid, for paths where the strict check breaks legitimate traffic. Both are trade-offs between the transparency rule and the protection the window check gives.
UDP: state without a protocol
UDP has no handshake, no flags and no close, so the firewall invents a minimal state machine around the only thing it can observe, which is whether a reply has come back. NIST describes the result: for connectionless protocols "most firewalls with stateful inspection are only able to track the source and destination IP addresses and ports", and "a DNS response from an external source would be permitted to pass only if the firewall had previously seen a corresponding DNS query from an internal source"; since the end of the session cannot be detected, the entry "is removed from the state table after a preconfigured timeout value is reached".
A DNS lookup from 192.0.2.10 port 40001 to a resolver at 198.51.100.53 port 53 goes like this on Linux:
- The query leaves. No entry exists, the rule base permits it, and conntrack creates an entry in the state the manual prints as
[NEW] udp 17 30 ... [UNREPLIED]: thirty seconds, the defaultnf_conntrack_udp_timeout. - The answer arrives from 198.51.100.53 port 53 to 192.0.2.10 port 40001. It matches the reply tuple; the entry is no longer unreplied, and the timer is refreshed to thirty seconds.
- Nothing else happens, and thirty seconds later the entry is gone. An answer that arrives after that, or an answer from any other address or port, matches nothing.
If the flow keeps going in both directions for more than two seconds, the kernel's UDP code reads it as a stream ("Still active after two seconds? Extend timeout."), marks it assured and uses the stream timeout of 120 seconds. FortiGate keeps two UDP states, 0 for "reply not seen" and 1 for "reply seen", with a 180-second udp-idle-timer that applies either way, so, in its knowledge base's words, a flow with packets "every few seconds will cause a session to remain active indefinitely". PAN-OS defaults UDP to 30 seconds; Check Point's documented example shows a DNS entry at "20/40", a 40-second maximum; BIG-IP's udp profile uses 60.
The RFCs pull in the other direction. RFC 4787 (January 2007) says a NAT's UDP mapping must not expire in less than two minutes, except for well-known destination ports, and recommends five minutes or more; RFC 6092 says the same for IPv6 filter state, with a default of five minutes. Short UDP timers protect the table and keep a firewall from honouring a stale answer; long ones keep voice, video and (virtual private network) keep-alives from being cut. RFC 6092 also points out who may refresh the entry: refreshing on outbound packets is required, refreshing on inbound packets "can allow an attacker in the exterior or a misbehaving application to keep a state record alive indefinitely".
ICMP: queries pair, errors relate
ICMP is tracked in two different ways, because it carries two different kinds of message.
Queries are tracked like UDP, with a field playing the role of the port. RFC 792 (September 1981) gives echo requests and replies an Identifier, "an identifier to aid in matching echos and replies", and conntrack builds the tuple from it, pairing echo with echo reply. The Linux code allows only four ICMP types to create an entry, echo, timestamp, information request and address mask request, each paired with its reply; any other type "can't create new conn". The default ICMP timeout is 30 seconds on Linux and 6 seconds on PAN-OS; RFC 5508 (April 2009) asks NATs not to expire an ICMP query mapping in less than 60 seconds. FortiGate keeps no protocol state for ICMP at all: its knowledge base notes that ICMP sessions always show proto_state=00.
Errors are never the start of anything; they are about a packet that was already sent. A Destination Unreachable or a Time Exceeded message quotes the IP header and the first bytes of the offending packet, and the tracker looks up that inner header in the table. If it finds the connection, the error is classified RELATED and allowed with it. The Linux source comment describes the trap this has to avoid: a forged error whose inner header names a real connection but whose outer destination is another machine would otherwise be passed as related "even though no connection from X was ever seen", so the code checks that the outer destination matches the connection before calling it related. RFC 5508 asks the same of NATs: an ICMP error with no active mapping for its embedded packet should be silently dropped.
The error case is the one firewalls most often get wrong in the other direction, by blocking all ICMP. RFC 2979 uses it as its first example of the transparency rule: a filter that lets packets with the Don't Fragment bit out "MUST NOT block incoming ICMP Destination Unreachable / Fragmentation Needed errors sent in response", because that breaks path (maximum transmission unit) discovery and creates black holes, while blocking echo or redirects is "proper (albeit unfriendly)". RFC 6092 says the IPv6 version: forward "Packet Too Big" and "Destination Unreachable" messages that match a state record, and drop those that match none. A stateful firewall can do this precisely; a stateless one has to choose between blocking all such errors and admitting all of them.
Second channels, address translation and the table's limits
Three situations take a stateful firewall beyond the five-tuple, and each is covered in depth elsewhere, so only the mechanism is given here.
Protocols that open a second channel. The File Transfer Protocol () announces a data port inside its control connection, the Session Initiation Protocol () announces media ports, and so on. A table keyed on the control connection never matches the second one. Netfilter's answer, in Neira's description, is a helper that "searches a set of patterns in the packets", for FTP the PORT pattern, and creates an expectation, a connection "expected to happen in a period of time"; when it arrives it is related to its master and passes as RELATED. FortiOS calls the same thing session helpers (the knowledge base example shows helper=rsh on a session), and Palo Alto Networks lists "NAT traversal and dynamic pinholes for protocols such as SIP and FTP" among the jobs of its protocol decoders. RFC 3234 calls such boxes application-level gateways (ALGs) and notes that they must keep state for the sessions they handle; the glossary entry on the application-level gateway and NAT Explained cover the translation side. Note what a helper is: the first step into the payload, reading the application protocol to keep the table right. Stateful inspection and DPI were never as separate as the generations suggest.
Address translation. The NAT mapping lives in the same entry, so the reply is matched against the translated address and port, and losing the entry loses the mapping as well as the permission.
Losing the table. Because the table is hard state in RFC 3234's sense, a firewall that reboots or fails over to a peer that did not receive a copy drops every established connection that relies on it, unless it is allowed to pick connections up mid-stream; Stateful clusters compares how F5, Fortinet, Check Point, Palo Alto Networks and others synchronize it. And a firewall only sees the packets routed through it: if requests leave through one firewall and replies come back through another, each holds half a conversation and the second drops the replies as unsolicited, the asymmetric routing problem.
Filling the table. Every permitted flow costs an entry, so the table is memory outsiders can make the firewall spend. RFC 4987 (August 2007) explains the classic case, the SYN flood, which fills a host's state with half-open connections, and notes that firewalls that screen connection attempts until they complete protect the hosts but move the problem onto themselves. That is why the handshake timers above are short (5 and 10 seconds on PAN-OS, 10 on FortiGate) while the established ones are long. Linux sizes its table from memory: the hash table defaults to total memory divided by 16,384, between 1,024 and 262,144 buckets, and the maximum number of entries defaults to the number of buckets; when the table is full, Neira's article explains, the least recently used entry of a hash chain is evicted. A commercial appliance publishes the same limits as datasheet figures: Fortinet's FortiGate 120G datasheet gives 3 million concurrent TCP sessions and 140,000 new TCP sessions per second. NIST's checklist for choosing a firewall asks for exactly these numbers: "throughput, maximum simultaneous connections, connections per second, and latency".
Deep packet inspection: reading past the transport header
Stateful inspection knows that a flow is legitimate as a conversation; it knows nothing about what the conversation contains. SP 800-41 gives the examples that need more: whether an email carries a forbidden type of attachment, whether instant messaging is running over port 80, whether a user is issuing the FTP put command. Answering them means reading the application layer, and four pieces of machinery do that work in every DPI engine: reassembly, protocol decoding, signature matching and application identification.
Reassembly comes first
An application message is not a packet. A request may be split across many segments, segments may arrive out of order or twice, and fragments may overlap. Before anything can be matched, the engine has to rebuild the byte stream the receiving host will see, which means it has to keep, per connection, the sequence state and buffered data that stateful inspection only checked.
Thomas Ptacek and Timothy Newsham of Secure Networks showed in January 1998 why that is harder than it sounds, in a paper titled "Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection". An inspection device on the wire does not see what the host sees; it sees packets and has to guess which ones the host will accept. If the device accepts a packet the host will reject (because its (time to live) expires before the host, or its checksum is wrong, or its sequence number is stale), the device's copy of the stream contains bytes the host never got: an insertion. If the device rejects a packet the host accepts, the host gets bytes the device never inspected: an evasion. Their example is a request for a vulnerable script called phf, cut into one-character packets with an extra character that only the inspection device accepts, so that the device reads something like phXf and no signature for phf matches, while the server receives phf. They tested four of the most popular network intrusion detection systems () of the day and concluded: "Every IDS we examined could be completely eluded by a savvy attacker." The lesson became engine design. Making the device stricter does not help, as the paper notes, because strictness creates evasions where laxity created insertions; what helps is reassembling the way the protected host does, or, for an in-line device, normalizing the stream so that host and device see the same bytes. Snort's rule language still exposes the result: the flow option can require only_stream (match only on reassembled packets) or no_stream, only_frag or no_frag.
Protocol decoders
With the stream rebuilt, a decoder parses it as the protocol it claims to be: Hypertext Transfer Protocol (HTTP) requests and responses, the TLS handshake, DNS messages, Server Message Block () file sharing, and so on. NIST's description of stateful protocol analysis is the clearest account of what this buys. An FTP session starts unauthenticated, where only a few commands make sense; after a successful login, dozens more are normal. Tracking that state, "pairing requests with responses", and applying "reasonableness checks for individual commands, such as minimum and maximum lengths for arguments" lets the engine flag a 1,000-character argument where 20 characters is the maximum, or a command issued out of sequence. RFC 2979 has an example of a decoder that is too shallow to be transparent: when SMTP gained extension negotiation, some firewalls simply added EHLO to their list of permitted commands, but "what is necessary is for the firewall to scan the list of EHLO responses and only allow the ones the firewalls understands through", or client and server agree on an extension the firewall cannot follow.
Decoders also identify protocols without trusting ports. Suricata, the open-source engine of the Open Information Security Foundation (OISF), detects the application protocol of each flow from its content and exposes the result to rules as app-layer-protocol, which can match tls, http, ssh, unknown (not yet known) or failed. Its documentation lists when detection gives up: both sides inspected and nothing matched; one side failed and the other has no traffic (an FTP data channel, for example); or one side failed and the other has too little data to decide. It also raises an event when the two directions speak different protocols, "for example a client talking HTTP to a SSH server". Every DPI engine needs both outcomes, because a flow nobody can classify is itself information.
Signatures and the matching problem
A signature, in NIST's definition, "is a pattern that corresponds to a known threat", and signature-based detection is "the process of comparing signatures against observed events". The open rule languages show what a pattern looks like in practice. A Snort rule begins with a header of five parts, action, protocol, addresses, ports and direction, as in the documentation's example alert tcp $EXTERNAL_NET 80 -> $HOME_NET any, followed by options. The basic payload option is content, which matches text, hexadecimal bytes or both, with the documentation's examples content:"USER root"; and content:"PK|03 04|"; (the second is the start of a ZIP archive). Suricata's example rule combines a decoder with content:
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"HTTP GET Request Containing Rule in URI"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"rule"; fast_pattern; classtype:bad-unknown; sid:123; rev:1;)
Read it as the engine does. alert http asks the decoder: only flows identified as HTTP, on any port. flow:established,to_server asks the stream tracker: only client-to-server data on an established connection. http.method; content:"GET" matches in the decoded method field, not anywhere in the packet, and http.uri; content:"rule" in the decoded path, after percent-decoding. fast_pattern tells the engine which string to look for first. Each layer of this article is visible in one line: the connection table, the reassembled stream, the decoder's fields and the pattern.
NIST names the weakness of the method: signatures are "very effective at detecting known threats but largely ineffective at detecting previously unknown threats, threats disguised by the use of evasion techniques, and many variants of known threats"; a signature for freepics.exe does not match freepics2.exe. SP 800-94 sets two other methods beside it: anomaly-based detection, which compares activity against a profile of normal behaviour, and stateful protocol analysis, described above.
The other problem is speed. An engine with tens of thousands of rules cannot run each one over every byte. The standard answer is to search for all the literal strings at once with a multi-pattern algorithm and run the expensive checks, such as regular expressions, only on flows where a string matched. The authors of Hyperscan, Intel's matching library, describe the approach in their NSDI 2019 paper: the most popular multi-string algorithm is Aho-Corasick, which "runs in O(n) time complexity where n is the number of input bytes", and Snort and Suricata "specify a string pattern per each regex for prefiltering, and launch the corresponding regex matching only if the string is found", because multi-string matching "is known to outperform multi-regex matching by two orders of magnitude". They report that Hyperscan improved Snort's performance by a factor of 8.7 on a real traffic trace, and Suricata's documentation lists it as an option for multi-pattern matching on Intel processors, with Vectorscan as the replacement on . That is the fast_pattern in the rule above: the string the prefilter searches for.
Application identification
Application identification turns these pieces into one answer: not "is this an attack?" but "which application is this?", so that policy can say "allow the collaboration suite, block the file-sharing client" whatever port they use. Palo Alto Networks' is the most explicit about its order of operations. Its documentation describes a classification system that identifies applications "irrespective of port, protocol, encryption (SSH or SSL) or any other evasive tactic" by combining "application signatures, application protocol decoding, and heuristics", in sequence: the traffic is first checked against security policy on what is known so far; allowed traffic is matched against application signatures; if TLS or SSH is detected and a decryption rule applies, the session is decrypted and the signatures run again; decoders look for applications tunnelled inside known protocols; and heuristics take the evasive remainder. The packet flow article adds two facts that explain behaviour administrators see. When App-ID is inconclusive, "the content inspection module runs known protocol decoder checks and heuristics". And when the identified application changes during the session, the firewall consults the security policy again, so a session can be allowed as ssl on its first packets and blocked a few packets later as the application it turns out to be.
The same documentation explains the labels that appear when identification has nothing to work with: incomplete (a handshake took place but no data was sent before the timeout), insufficient-data (some data, but not enough to identify the application) and unknown-tcp or unknown-udp (data the signatures do not recognize, typically commercial applications not yet in the database, internal applications, or threats). It also warns against the shortcut of an application override, which "bypass[es] layer 7 application processing and threat inspection" and falls back to "stateful layer 4 inspection".
Other vendors build the same pipeline under other names. Fortinet's application control, described in FortiGate Security Profiles, matches traffic against its application database and, as that article explains, has to see enough of a session to classify it. F5's Policy Enforcement Manager, aimed at service providers, calls its engine Traffic Intelligence, which "analyzes and identifies higher level protocols and applications" in categories such as audio and video, file transfer, instant messaging, mail, and web, with signature files F5 publishes and the system can update on a schedule. Extreme Networks runs a "flow-based Deep-Packet Inspection (DPI) engine" on its access points that is "the same engine used with ExtremeControl and ExtremeAnalytics", with an application database "containing over 3300 fingerprints and identifying over 2,000 distinct applications" according to its ExtremeCloud documentation of September 2019; ExtremeAnalytics calls each pattern a fingerprint, "a description of a pattern of network traffic which can be used to identify an application", and lets administrators add custom ones. In , ntop's nDPI is a deep packet inspection library under the LGPLv3 licence, with some dissectors, TLS and DNS among them, dual-licensed.
A worked identification, for a flow to 203.0.113.80 on port 443:
- First packet. The SYN tells the engine only the . A port-based guess says "probably web over TLS"; the policy can be checked only on addresses, zones, users and that guess.
- Handshake. The connection is admitted and enters the table.
- First data. The client's first segment is a TLS ClientHello. The decoder confirms the protocol is TLS whatever the port, and reads the cleartext fields: the server name, the list of application protocols the client offers through (Application-Layer Protocol Negotiation), the cipher suites and extensions that fingerprints such as summarize (see The Fingerprint That Broke, and the One Its Author Wrote to Replace It).
- Classification. The server name and fingerprint match a known application. The policy is looked up again with the application, and the session continues, is shaped or is reset.
- No match. If nothing matches before the engine's data budget is spent, the flow is recorded as unknown, and the policy decides whether unknown traffic may pass.
The first packets of every flow are therefore judged before the application is known. That is not a defect of a particular product; it follows from how identification works.
Flow-based and proxy-based inspection
Engines differ in how much they hold back while they inspect. Fortinet's documentation states the two models plainly. Flow-based inspection "takes a snapshot of content packets and uses pattern matching to identify security threats in the content", forwarding packets as it goes. Proxy-based inspection "reconstructs content that passes through the FortiGate": traffic is buffered so that "the packets for a file, email message, or web page will be held by the FortiGate until the entire payload is inspected", then released or replaced with a block page; to stop users timing out, "client comforting" lets small portions through while scanning continues. Some features exist only in proxy mode (Fortinet lists the explicit web proxy, (zero trust network access) and SSL offloading among them), and most proxy features are not supported on models with 2 GB of memory or less. The trade-off is general: a flow engine is faster and changes nothing it does not block; a proxy sees whole objects and can rewrite them, at the price of latency, memory and being an end point in its own right.
What encryption leaves visible
Everything in the previous section assumes the engine can read the payload. RFC 8404 states what happens when it cannot: "Encryption of packet contents at a given protocol layer usually makes DPI processing of that layer and higher layers impossible." What remains is what the Internet Architecture Board (IAB) calls the wire image in RFC 8546 (Brian Trammell and Mirja Kühlewind, April 2019): "the view of that set of protocols as observed by an entity not participating in the communication", including "the time at which each packet is observed". The RFC insists that the wire image "is not limited to merely 'the unencrypted bits in the header'", because "sequences of interpacket timing and packet sizes" can be used to infer behaviour and fingerprint implementations.
For TLS 1.3 (RFC 8446, August 2018), the dividing line is the ServerHello: "All handshake messages after the ServerHello are now encrypted", including the server's certificate. The ClientHello and ServerHello stay in the clear, and the ClientHello is where a DPI engine finds the server name, in the Server Name Indication () extension, whose use RFC 8404 reports many of Akamai's customers seeing in over 99 per cent of client connections, and the ALPN list, which RFC 8404 notes is "sent cleartext in the ClientHello" while the server's choice returns encrypted in TLS 1.3. RFC 9849, the standard of March 2026, calls the plaintext SNI "perhaps the most sensitive information left unencrypted in TLS 1.3" and encrypts the real ClientHello inside an outer one that names a public client-facing server; an observer then learns the provider, not which of its servers the client reached, although the address and any unencrypted DNS lookup may still give it away. QUIC (RFC 9000 and RFC 9001, May 2021) moves the handshake into UDP and protects even its first packets, but with keys derived from a value in the clear, so "these packets are not considered to have confidentiality or integrity protection". The companion post, What a firewall still sees in an encrypted connection, decodes a real TLS 1.3 ClientHello from RFC 8448 byte by byte and goes through QUIC and ECH field by field.
The consequences for inspection follow directly:
- Without decryption, an engine classifies on the wire image: addresses, ports, the cleartext handshake, fingerprints and the statistics of sizes and timing (encrypted traffic analysis). That supports application identification by name and fingerprint and blocking by name; it does not support signatures on content, file scanning or data loss prevention.
- With decryption, the engine becomes a party to the connection. RFC 8446 sets the condition: "A middlebox which terminates a TLS connection MUST behave as a compliant TLS server (to the original client) ... and also as a compliant TLS client (to the original server), including verifying the original server's certificate", and it must "generate its own ClientHello containing only parameters it understands". How organizations do that, with a private certificate authority on every managed device, and what breaks, is the subject of SSL Forward Proxy: How Outbound TLS Interception Works and What Breaks It, with the vendor versions in Fortinet SSL inspection modes, Check Point HTTPS (HTTP over TLS) inspection and Zscaler Internet Access (ZIA) SSL inspection. RFC 9849 is frank about ECH in that setting: in managed enterprise settings, "one approach may be to disable ECH entirely via group policy", and "another approach may be to intercept and decrypt client TLS connections".
- Badly built middleboxes slow the protocol down for everyone. RFC 8446's appendix on middlebox compatibility records that "a significant number of middleboxes misbehave when a TLS client/server pair negotiates TLS 1.3", which is why TLS 1.3 implementations may send a non-empty legacy session identifier and dummy change_cipher_spec records so that the handshake will "resemble TLS 1.2 session resumption". Section 9.3 adds that the design "does not relax the invariants. Those middleboxes continue to be non-compliant." RFC 9065 (Godred Fairhurst and Colin Perkins, July 2021) gives the other side of the argument: encrypting transport headers "helps avoid transport protocol ossification by middleboxes", at the cost of operational practices that inspected them. RFC 7258 (Stephen Farrell and Hannes Tschofenig, May 2014) is the policy background: "Pervasive monitoring is a technical attack that should be mitigated in the design of IETF protocols, where possible."
The cost of looking deeper
Each step of inspection costs work per byte, and vendors publish the cost in their datasheets. Fortinet's FortiGate 120G datasheet is a convenient example because it lists the steps separately:
| What is enabled | Throughput in the datasheet | Fraction of plain firewalling |
|---|---|---|
| Firewall only (1,518-byte UDP packets) | 39 Gbps | 1 |
| Application control | 6.7 Gbps | 0.17 |
| Intrusion prevention (), enterprise traffic mix | 5.3 Gbps | 0.14 |
| Next-generation firewall (NGFW): firewall, IPS and application control | 3.1 Gbps | 0.08 |
| Threat protection: firewall, IPS, application control and malware protection | 2.8 Gbps | 0.07 |
| SSL inspection (IPS, average HTTPS) | 3 Gbps | 0.08 |
The fractions are computed here by dividing each figure by 39; they compare figures measured under different conditions (large UDP packets for the firewall number, an "enterprise traffic mix" with logging enabled for the others), so read them as orders of magnitude, not as a prediction for any network. The order of magnitude is the point: on this box, turning on the full inspection stack divides the throughput by about 14 (39 / 2.8 = 13.9). The datasheet's footnotes define the categories: "NGFW performance is measured with Firewall, IPS and Application Control enabled", and threat protection adds malware protection. Every vendor's datasheet has the same shape, and the honest way to size a device is from the row that matches the inspection you will actually enable, with decryption, at your own traffic mix.
The next-generation firewall: a name for the bundle
By 2009 these functions were being sold in one box under one name. Gartner's analysts Greg Young and John Pescatore published "Defining the Next-Generation Firewall" that October; Palo Alto Networks, summarizing it on its blog on 16 October 2009, wrote that Gartner found first-generation firewalls "not effective in today's application and threat environment" because of "their dependence on port and protocol", and claimed that App-ID then identified "900+ applications". Gartner's Magic Quadrant for enterprise network firewalls of 15 March 2010 recorded that "firewalls have begun to incorporate deep packet inspection intrusion prevention system (IPS) features" and that in 2009 market pressures accelerated "the demand for next-generation firewall platforms that provide the capability to detect and block sophisticated attacks, as well as enforce granular security policy at the application (versus port and protocol) level". In this article's terms, a next-generation firewall (NGFW) is a stateful firewall whose rule base can be written in applications and users rather than ports, with a DPI engine doing identification and intrusion prevention on the flows the table admits. The history article tells the commercial story; Marcus Ranum's remark to CSO Online in 2014, that "the game was always at layer-7 to begin with and 'stateful inspection' was a 15-year-long digression", is the view from the proxy school, which the NGFW in a sense vindicated.
DPI in carrier networks
The same engines run in access networks for other purposes. RFC 8404 lists DPI for "differential treatment" among the operator functions affected by encryption, giving the mobile example: radio capacity varies, a 20-millisecond delay goes unnoticed on a web page but not in a video or a voice call, and "inferences of the traffic type have been used to make bearer assignments and set scheduler priority". It also places net neutrality outside its scope, as "controversial practices". F5's Policy Enforcement Manager describes itself as detecting "applications and protocols in Service Provider networks". What carriers may and may not do with that classification, in Brazil, the European Union, India and the United States, is set out in Net neutrality in the network and the blog post on the rules; the mechanics are the ones in this article.
The Brazilian angle
The best-documented Brazilian example of operator filtering is not deep inspection at all, but a stateless port filter applied nationally, and its paper trail shows how carefully even that was scoped. On 24 April 2009 the Brazilian Internet Steering Committee (, Comitê Gestor da Internet no Brasil) approved Resolution CGI.br/RES/2009/002/P, a recommendation for "port 25 management" in residential networks: email providers should offer authenticated message submission on other ports, and connectivity providers serving residential or dynamically addressed users should prevent direct delivery of mail from client machines "through the blocking of outbound traffic to port 25/TCP", while not interfering with or blocking outbound traffic to the submission ports (our translations). On 15 July 2011 CGI.br, its executive arm and the telecommunications regulator Anatel signed a cooperation agreement with operators and provider associations to implement it. The agreement cites RFC 4409, the IETF's definition of message submission, as the means of telling submission from server-to-server transport, says the measures had been under discussion in Brazil since 2005, allows exceptions for users who prove they need the port, and makes the blocking start gradually only once at least 90 per cent of the users of the participating email providers had migrated to submission or webmail. The Antispam.br page that explains it to the public gives the reason: spammers worldwide were abusing Brazilian users' computers to send mail anonymously, and the measure would keep Brazil off international lists of the countries that send the most spam.
Two later texts frame this kind of measure. The Marco Civil da Internet (Law 12,965 of 2014), article 9, paragraph 3, says that in providing connection to the internet, paid or free, and in transmission, switching or routing, it is forbidden to "block, monitor, filter or analyse the content of data packets", subject to the rest of the article (our translation); the net neutrality article sets out how that is read. Decree 8,771 of 2016, which regulates it, names among the technical requirements that justify exceptional treatment of traffic the "treatment of network security issues, such as restriction of mass messaging (spam) and control of denial-of-service attacks" (article 5, paragraph 1, item I; our translation). Port 25 management sits on the header side of the line this article has drawn: it reads the destination port, never the message.
What defenders can do
- Write policy in terms of who initiates. With a stateful firewall, permit the outbound connection and let the table admit the replies; a return rule that opens ephemeral port ranges is a stateless habit that a stateful device does not need.
- Know your timers and set them per service. List the established, half-open, UDP and ICMP timers of every stateful device on the path; where a long-lived idle connection must survive, lengthen the timer for that service or set keep-alives below the shortest timer, and leave the global defaults alone.
- Drop INVALID, and log it for a while first. Out-of-window and out-of-state packets are either attacks or a sign of asymmetric routing, a failover without synchronization or a broken middlebox; the log tells you which before the drop hides it.
- Let the right ICMP through. Permit Fragmentation Needed and Packet Too Big messages that relate to existing connections, as RFC 2979 and RFC 6092 require; block the rest if policy demands.
- Watch the table as a resource. Alert on table occupancy and new-session rates against the platform's published limits, keep handshake timers short, and use SYN protection where the platform offers it (BIG-IP SYN flood protection shows one implementation).
- Treat application identification as eventually correct. the first packets of every flow to be judged before the application is known; write rules so that the decision taken on those packets is acceptable, and treat
unknownandinsufficient-dataas findings to investigate, not noise. - Size from the right datasheet row. Use the throughput with every engine you will enable, decryption included, and keep headroom for the traffic mix you have.
- Decide about encrypted traffic explicitly. Either decrypt, with the governance the SSL forward proxy article describes, or accept classification on the wire image; and decide what to do about ECH before browsers decide for you.
What to remember
- A stateless filter judges each packet alone and cannot tell a reply from a forgery; it remains the right tool for line-rate anti-spoofing and infrastructure protection.
- Stateful inspection records each permitted connection in a table keyed on the five-tuple, consults the rule base for the first packet only, and admits later packets by lookup; Check Point's 1993 patent filing is the origin of the commercial form.
- On Linux a TCP entry goes SYN_SENT (120 s), SYN_RECV (60 s), ESTABLISHED (5 days), FIN_WAIT, CLOSE_WAIT, LAST_ACK, TIME_WAIT (120 s); FortiGate, PAN-OS and Check Point keep established sessions for 3,600 seconds and BIG-IP's TCP profile for 300, which is why idle connections die.
- Sequence-window checking is what makes forging into an existing connection hard; it needs to have seen the handshake.
- UDP state is "reply seen or not" plus a timer; ICMP queries pair on the identifier, and ICMP errors are admitted as related to the connection quoted inside them.
- DPI needs reassembly before anything else, then decoders, signatures and application identification; insertion and evasion are why reassembly must match the host.
- Encryption leaves the wire image: addresses, ports, the cleartext handshake, sizes and timing. TLS 1.3 hides everything after the ServerHello, ECH hides the real server name, and inspecting content means becoming a TLS end point.
- Full inspection costs an order of magnitude of throughput; datasheets say how much.
Sources
- N. Freed, RFC 2979, Behavior of and Requirements for Internet Firewalls, IETF, October 2000, Informational, text: the definition of a firewall, the transparency rule, the ICMP and EHLO examples (accessed 23 November 2026)
- B. Carpenter and S. Brim, RFC 3234, Middleboxes: Taxonomy and Issues, IETF, February 2002, Informational, text: the middlebox definition, the facets, IP firewalls, application firewalls and ALGs (accessed 23 November 2026)
- K. Scarfone and P. Hoffman, Guidelines on Firewalls and Firewall Policy, NIST Special Publication 800-41 Revision 1, September 2009, PDF: packet filtering, stateful inspection, Table 2-1, UDP state, application firewalls and DPI, the performance checklist (accessed 23 November 2026)
- K. Scarfone and P. Mell, Guide to Intrusion Detection and Prevention Systems (IDPS), NIST Special Publication 800-94, February 2007, PDF: signature-based and anomaly-based detection, stateful protocol analysis, the footnote on the meaning of DPI (accessed 23 November 2026)
- ITU-T, Recommendation Y.2770, Requirements for deep packet inspection in next generation networks, publication page: title and date (accessed 23 November 2026)
- K. Moriarty and A. Morton (eds.), RFC 8404, Effects of Pervasive Encryption on Operators, IETF, July 2018, Informational, text: DPI for differential treatment, the effect of encryption on DPI, SNI and ALPN (accessed 23 November 2026)
- J. Woodyatt (ed.), RFC 6092, Recommended Simple Security Capabilities in Customer Premises Equipment (CPE) for Providing Residential IPv6 Internet Service, IETF, January 2011, Informational, text: REC-10, REC-14 to REC-16, REC-19, REC-31, REC-32 and REC-35 (accessed 23 November 2026)
- W. Eddy (ed.), RFC 9293, Transmission Control Protocol (TCP), IETF, August 2022, Standards Track, text: SYN and FIN in the sequence space (accessed 23 November 2026)
- R. Braden (ed.), RFC 1122, Requirements for Internet Hosts: Communication Layers, IETF, October 1989, text: the keep-alive default (accessed 23 November 2026)
- P. Ferguson and D. Senie, RFC 2827 (BCP 38), Network Ingress Filtering, IETF, May 2000, text: ingress filtering against spoofed sources (accessed 23 November 2026)
- G. Ziemba, D. Reed and P. Traina, RFC 1858, Security Considerations for IP Fragment Filtering, IETF, October 1995, text: the tiny fragment attack (accessed 23 November 2026)
- Presidência da República, Lei nº 12.965, de 23 de abril de 2014 (Marco Civil da Internet), official text: article 9, paragraph 3 (accessed 23 November 2026)
- J. Postel, RFC 792, Internet Control Message Protocol, September 1981, text: the echo Identifier field (accessed 23 November 2026)
- P. Srisuresh, B. Ford, S. Sivakumar and S. Guha, RFC 5508 (BCP 148), NAT Behavioral Requirements for ICMP, IETF, April 2009, text: REQ-2 and REQ-4 (accessed 23 November 2026)
- F. Audet (ed.) and C. Jennings, RFC 4787 (BCP 127), NAT Behavioral Requirements for Unicast UDP, IETF, January 2007, text: REQ-5 on UDP mapping timers (accessed 23 November 2026)
- S. Guha (ed.) and others, RFC 5382 (BCP 142), NAT Behavioral Requirements for TCP, IETF, October 2008, text: REQ-5 on idle timeouts (accessed 23 November 2026)
- W. Eddy, RFC 4987, TCP SYN Flooding Attacks and Common Mitigations, IETF, August 2007, text: SYN floods and firewalls that screen connection attempts (accessed 23 November 2026)
- Linux kernel source, net/netfilter/nf_conntrack_proto_tcp.c, master branch, raw file: the TCP states and timeouts, the transition table and its comments, the window bounds after Guido van Rooij (accessed 23 November 2026)
- Linux kernel source, net/netfilter/nf_conntrack_proto_udp.c, master branch, raw file: the UDP timeouts and the stream rule (accessed 23 November 2026)
- Linux kernel source, net/netfilter/nf_conntrack_proto_icmp.c, master branch, raw file: the ICMP timeout, the types that may create an entry, RELATED errors and the outer-address check (accessed 23 November 2026)
- Linux kernel documentation, Netfilter Conntrack Sysfs variables: buckets, nf_conntrack_max, entries added twice, tcp_loose, tcp_be_liberal, UDP and ICMP timeouts (accessed 23 November 2026)
- The netfilter project, conntrack-tools user manual: the event output of conntrack -E for a TCP open and a UDP query (accessed 23 November 2026)
- Pablo Neira Ayuso, Netfilter's connection tracking system, ;login:, USENIX, vol. 31, no. 3, June 2006, PDF: states, hash tuples, helpers and expectations, eviction (accessed 23 November 2026)
- nftables wiki, Matching connection tracking stateful metainformation: ct state and the simplest stateful firewall (accessed 23 November 2026)
- Google Patents, US 5,606,668 A, System for securing inbound and outbound data packet flow in a computer network, Gil Shwed, Check Point Software Technologies, filed 15 December 1993, published 25 February 1997: the record and lookup operations, the connectionless timeout (accessed 23 November 2026)
- Check Point Software Technologies, Check Point History: founded 1993 (accessed 23 November 2026)
- Ellen Messmer, It's been 20 years since Check Point FireWall-1 made firewalls mainstream, CSO Online, 14 July 2014: NetWorld+Interop 1994, Shwed and Ranum quoted (accessed 23 November 2026)
- Check Point, R81.20 CLI Reference Guide, fw tab: kernel tables as state tables, the Connections table and its columns, the documented example (accessed 23 November 2026)
- Check Point, R81.20 CLI Reference Guide, fw ctl conntab: the state filters and the documented examples (accessed 23 November 2026)
- Fortinet Community, Troubleshooting Tip: FortiGate session table information: proto_state values and timers, UDP and ICMP, session list columns, clearing sessions (accessed 23 November 2026)
- Fortinet, FortiOS 7.6.7 Administration Guide, Inspection modes: flow-based and proxy-based definitions (accessed 23 November 2026)
- Fortinet, FortiOS 7.6.6 Administration Guide, Proxy mode inspection: buffering, client comforting, proxy-only features (accessed 23 November 2026)
- Fortinet, FortiGate 120G Series data sheet, PDF: throughput by inspection level, sessions and footnotes (accessed 23 November 2026)
- Palo Alto Networks, PAN-OS 11.0 Administrator's Guide, App-ID Overview, read as a summary of the page body: the identification sequence (accessed 23 November 2026)
- Palo Alto Networks Knowledge Base, Packet Flow Sequence in PAN-OS, read as a summary: slow path, fast path, App-ID and the policy re-lookup (accessed 23 November 2026)
- Palo Alto Networks, PAN-OS 10.2 Administrator's Guide, Manage Custom or Unknown Applications, read as a summary: incomplete, insufficient-data, unknown traffic, application override (accessed 23 November 2026)
- Palo Alto Networks, PAN-OS 11.2 web interface help, Session Timeouts, read as a summary: the default timers and the warning on values (accessed 23 November 2026)
- F5 DevCentral, LTM: Dueling Timeouts: the default idle timeouts of the protocol profiles (accessed 23 November 2026)
- F5, BIG-IP Policy Enforcement Manager: Implementations 16.1, Creating Custom Classifications: Traffic Intelligence and its categories (accessed 23 November 2026)
- F5, BIG-IP Policy Enforcement Manager: Implementations 16.1, Updating Signatures for Application Recognition (accessed 23 November 2026)
- Extreme Networks, ExtremeCloud Information Center, Layer 7 Application Control, published September 2019: the flow-based DPI engine and its database (accessed 23 November 2026)
- Extreme Networks, ExtremeCloud IQ Site Engine help, ExtremeAnalytics Fingerprints Overview: system and custom fingerprints (accessed 23 November 2026)
- ntop, nDPI README, dev branch: an open-source DPI library and its licences (accessed 23 November 2026)
- Thomas H. Ptacek and Timothy N. Newsham, Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection, Secure Networks, January 1998, HTML copy at insecure.org: insertion, evasion, the phf example, the test results (accessed 23 November 2026)
- Snort project, Snort 3 Rule Writing Guide, Rule Headers: the five parts of a header (accessed 23 November 2026)
- Snort project, Snort 3 Rule Writing Guide, content: the content option and its examples (accessed 23 November 2026)
- Snort project, Snort 3 Rule Writing Guide, flow: established, direction and stream options (accessed 23 November 2026)
- OISF, Suricata documentation, Rules format: the example rule (accessed 23 November 2026)
- OISF, Suricata documentation, Generic App Layer Keywords: app-layer-protocol, bail-out conditions, protocol detection events (accessed 23 November 2026)
- OISF, Suricata documentation, Hyperscan: multi-pattern matching, Intel and Vectorscan (accessed 23 November 2026)
- Xiang Wang, Yang Hong, Harry Chang, KyoungSoo Park, Geoff Langdale, Jiayu Hu and Heqing Zhu, Hyperscan: A Fast Multi-pattern Regex Matcher for Modern CPUs, NSDI 2019, USENIX, PDF: prefiltering, Aho-Corasick, the Snort measurement (accessed 23 November 2026)
- B. Trammell and M. Kuehlewind, RFC 8546, The Wire Image of a Network Protocol, IAB, April 2019, Informational, text: the definition and its scope (accessed 23 November 2026)
- E. Rescorla, RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3, IETF, August 2018, text: encrypted handshake, protocol invariants for middleboxes, middlebox compatibility mode (accessed 23 November 2026)
- E. Rescorla, K. Oku, N. Sullivan and C. A. Wood, RFC 9849, TLS Encrypted Client Hello, IETF, March 2026, Standards Track, text: the introduction, middleboxes and deployment impact (accessed 23 November 2026)
- M. Thomson and S. Turner (eds.), RFC 9001, Using TLS to Secure QUIC, IETF, May 2021, text: Initial packet protection (accessed 23 November 2026)
- G. Fairhurst and C. Perkins, RFC 9065, Considerations around Transport Header Confidentiality, Network Operations, and the Evolution of Internet Transport Protocols, IETF, July 2021, text: the abstract (accessed 23 November 2026)
- S. Farrell and H. Tschofenig, RFC 7258 (BCP 188), Pervasive Monitoring Is an Attack, IETF, May 2014, text: the abstract (accessed 23 November 2026)
- Palo Alto Networks blog, Next-Generation Firewall Defined By Gartner, 16 October 2009: the summary of Gartner's note and the App-ID claim (accessed 23 November 2026)
- Greg Young and John Pescatore, Magic Quadrant for Enterprise Network Firewalls, Gartner RAS Core Research Note G00174908, 15 March 2010, copy hosted by Palo Alto Networks, PDF: the market overview (accessed 23 November 2026)
- Comitê Gestor da Internet no Brasil, Resolução CGI.br/RES/2009/002/P, 24 April 2009, PDF: the recommendation for port 25 management (accessed 23 November 2026)
- CGI.br, NIC.br, Anatel and others, Acordo de Cooperação para Implementar a Recomendação da Gerência de Porta 25, São Paulo, 15 July 2011, PDF at Antispam.br: the measures, the 90 per cent condition, the exceptions (accessed 23 November 2026)
- Antispam.br, Gerência de Porta 25: the public explanation (accessed 23 November 2026)
- Presidência da República, Decreto nº 8.771, de 11 de maio de 2016, official text: article 5 (accessed 23 November 2026)