Deep packet inspection (DPI) is a way for a network device to examine the data inside packets, not only the addressing information in their headers. A basic firewall decides from IP addresses and ports; DPI also looks at the payload, so it can recognise an application, a protocol violation or a known attack pattern.
What deep packet inspection does
Every packet has a header and a payload. The header carries the source and destination addresses, the protocol and, for TCP and UDP, the port numbers. The payload is the data the application is sending, for example part of an HTTP request.
RFC 3234, the IETF's taxonomy of middleboxes, describes the simplest firewall as "a router that screens and rejects packets based purely on fields in the IP and Transport headers." DPI goes past that point. The device reads into the application data and makes its decision from what it finds there.
"Deep packet inspection" is an industry term, not an IETF standard, so products differ in what they mean by it. What they share is the idea of looking beyond layers 3 and 4 (IP and TCP/UDP).
Header filtering vs deep packet inspection
| Header (packet) filtering | Deep packet inspection | |
|---|---|---|
| Looks at | IP addresses, protocol, ports | Headers plus payload content |
| Example rule | Block inbound TCP port 23 | Block HTTP requests that contain a specific pattern, on any port |
| Identifies an application by | Its usual port number | The content of the traffic itself |
| Sees inside TLS-encrypted data | Not applicable | No, unless it decrypts the session |
| Cost per packet | Low | Higher: more data to read, often connection state to track |
The port-versus-content difference matters because a port number is only a convention. Traffic on port 443 is usually HTTPS, but nothing in the header guarantees it. See common port numbers for the conventions, and what a firewall is for the header-based baseline.
Where DPI runs
DPI is not a separate kind of network. It is a capability of a middlebox, which RFC 3234 defines as "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." The feature typically appears in:
- Next-generation firewalls, which combine port-based rules with application identification.
- Intrusion detection and prevention systems, which compare traffic to signatures of known attacks.
- Secure web gateways and proxies, which filter web content for a company or school network.
- Traffic-management equipment, used by networks that shape or prioritise traffic by application.
RFC 3234 separately describes application-level firewalls. These "act as a protocol end point and relay", such as a web proxy, and may perform "extensive protocol validity checks". That is a different design from a device that watches packets pass through: a proxy terminates the connection itself and opens a second one to the destination.
What deep packet inspection can and cannot see over HTTPS
Most web traffic is now encrypted, which limits what a passive DPI device can read. The details come from TLS 1.3 (RFC 8446).
What stays readable
- IP addresses and ports. They are needed to route the packets, so they are always visible.
- The ClientHello. RFC 8446 section 2 says the key exchange phase covers the ClientHello and ServerHello, and that "Everything after this phase is encrypted." The ClientHello is sent before any keys exist, so it is plaintext.
- The server name (SNI). A client can include a
server_nameextension in its ClientHello. RFC 6066 says it carries the hostname of the server the client is contacting, and it exists to help servers that host several virtual servers on one IP address pick the right certificate. RFC 9849 states that in TLS 1.3 this plaintext SNI "leaks the target domain."
So a passive device can tell that you are connecting to example.com, even though it cannot read the page you request from it.
What TLS 1.3 hides
RFC 8446 section 1.2: "All handshake messages after the ServerHello are now encrypted." That includes the server's certificate, which is sent in a protected Certificate message. The application data (the HTTP requests and responses) is encrypted under keys the on-path device does not have. DPI on the wire can measure sizes and timing, but not read the content.
What Encrypted Client Hello changes
RFC 9849 defines Encrypted Client Hello (ECH), "a mechanism in Transport Layer Security (TLS) for encrypting a ClientHello message under a server public key." When a client and server both use it, the real ClientHello, including the true SNI, travels encrypted inside an outer ClientHello. An observer sees the outer one. The hostname leak that SNI-based filtering relies on is closed, which is why ECH matters to anyone who filters by domain. It also depends on the server publishing the needed key, so it is not on for every site. A related protection for name lookups is covered in DNS over HTTPS.
How a network reads encrypted traffic anyway
A device that must see inside HTTPS has to stop being a passive observer. It acts as a TLS endpoint: it accepts the client's connection, presents its own certificate for the site, opens a separate TLS connection to the real server, and inspects the plaintext in between. This is often called TLS interception or an SSL proxy, and it matches the RFC 3234 description of a device that is a protocol endpoint and relay.
It only works if the client trusts the certificate the device presents. In practice, an organisation installs its own certificate authority on the devices it manages. How that trust is established is explained in certificate authorities. Without that installed trust, the browser shows a certificate warning, which is the intended outcome of the design.
The cost is that the interception point sees everything in the clear, including passwords and personal data, so it becomes a sensitive system itself. It also breaks end-to-end encryption by definition: the device is one of the ends.
How to tell whether your connection is being inspected
For HTTPS interception, look at the certificate your browser receives for a site. In most browsers, click the padlock or site-information icon in the address bar and open the certificate details. If the issuer is your employer's or school's name instead of a public certificate authority, the connection is being decrypted and re-encrypted on the way. Example of what you might see:
Issued to: example.com
Issued by: Example Corp Network Inspection CA
That is example output, not from a real network. A public certificate for the same site would normally name a public CA as issuer. On a network you do not manage, an unexpected private issuer is a reason to stop and not enter passwords.
You cannot detect passive DPI this way. A device that only reads headers and the ClientHello leaves no trace in the certificate.
Limits and trade-offs
- Encryption narrows it. Without interception, DPI of TLS 1.3 traffic is limited to metadata: addresses, ports, the SNI where it is plaintext, sizes and timing.
- Interception moves the risk. The decrypting device holds the plaintext of every inspected session.
- Signatures only catch what they describe. A rule written for a known pattern does not match a new one, and attackers can change the form of their traffic.
- Privacy depends on who runs it. A company inspecting its own network is a different situation from a network operator inspecting customers, and laws on this differ by country. This article does not give legal advice.
Frequently asked questions
- Is deep packet inspection the same as a firewall?
- No. A basic firewall decides using header fields such as IP addresses, protocol and port numbers. Deep packet inspection also examines the data a packet carries. Many modern firewalls include DPI as one feature, so the two often live in the same product.
- Can deep packet inspection read HTTPS traffic?
- Not by itself. With TLS 1.3, everything after the ServerHello is encrypted, so an on-path device sees only the handshake's plaintext parts, such as the server name in the ClientHello. To read the content, the device must act as a TLS endpoint, which means the client has to trust its certificate authority.
- Can a VPN stop deep packet inspection?
- A VPN encrypts the traffic between you and the VPN server, so a network on your side of it cannot read the payload. It can still see that you are sending VPN traffic, and the VPN provider or the destination network can inspect what leaves the tunnel.
- Does deep packet inspection slow the network down?
- It adds work per packet or per connection, because the device reads more data and often tracks connection state. The cost depends on the product, its rules and its hardware, so there is no single figure. Vendors publish throughput numbers with inspection on and off.