Deep Packet Inspection (DPI) is a network filtering tool that detects hidden VPN traffic by looking inside the actual data packets, not just checking where the traffic is going.
When you use a standard VPN, it encrypts your data, but the encryption process itself creates a recognizable pattern, such as a specific handshake sequence or protocol signature. Advanced firewalls scan for this pattern and can flag or block the connection once identified, even though the actual content stays unreadable. Changing your settings or switching ports will not help, because the firewall reads the structure and behavior of the data itself, not just the address or port number it uses.
To get around these strict blocks, you need tools that disguise VPN traffic to resemble normal web browsing, a technique known as obfuscation.
In this guide, we will explain the basic rules these firewalls use, how they test your connection, and the specific ways modern VPNs help you stay connected.
Key Takeaways:
- Deep Packet Inspection identifies traffic by analyzing structural metadata instead of reading the decrypted payload.
- Firewalls use a technique called Active Probing to impersonate clients and test suspected servers before issuing a block.
- Standard encryption creates a uniform mathematical signature that advanced firewalls detect.
- Protocol obfuscation is required to alter traffic entropy and remain connected in restrictive network environments.
This article is for informational purposes only. Please use VPNs responsibly and legally.
1. What is Deep packet inspection (DPI)?
Deep Packet Inspection (DPI) is an advanced method of examining and managing network traffic that analyzes both the header and the core data payload of a packet to identify, classify, or block specific applications and protocols. A standard data packet consists of two distinct parts. The header contains routing information like IP addresses, while the payload holds the actual content being sent.
Traditional Packet Analysis (TPA) and Standard Stateful Packet Inspection (SPI) operate on a surface level. They only check the IP header (Layer 3) and TCP header (Layer 4) of the OSI model to approve or deny traffic based on source, destination, and port.
Deep Packet Inspection checks the same IP and TCP headers as TPA, then additionally opens the Application layer (Layer 7) payload to see what protocol or application generated the traffic. This deep analysis allows the network to understand exactly what application or protocol is being used, regardless of the designated port.
- Traditional Packet Analysis (TPA) & Stateful Packet Inspection (SPI): Evaluates simple routing rules. It looks at where data comes from and where it is going.
- Deep Packet Inspection (DPI): Opens the packet payload to verify the exact application generating the traffic.

For example, if you connect to a standard OpenVPN server on default port 1194, Layer 4 inspection only registers that data is moving through UDP port 1194. However, DPI at Layer 7 opens the packet to inspect the protocol’s specific handshake sequence. When the firewall identifies the OpenVPN cryptographic signature in the payload, it recognizes the traffic as a VPN connection and blocks it, regardless of the port number.
Because DPI looks inside the payload, simply changing a port number (like moving from port 80 to port 443) does not hide the traffic type from the network monitor. According to network policy research, governments in countries with restrictive internet policies (including China, Egypt, Iran, and Russia) mandate Internet Service Providers (ISPs) to use DPI to enforce network filtering and monitor user activity.
2. The encryption myth: Why HTTPS does not stop modern DPI
According to transparency reports from Google and Let’s Encrypt, over 80% of all internet traffic is now encrypted. Modern encryption standards like TLS 1.3 prevent DPI from reading the actual text, passwords, or emails inside the payload.
Many users assume this encryption renders network surveillance useless. In reality, modern DPI engines rely on Encrypted Traffic Intelligence (ETI). According to industry consensus and DPI vendors, these systems use machine learning and behavioral analysis to inspect metadata instead of reading the raw content.
While encryption secures the actual content being transmitted, it does not hide the exact size of the data packets, the frequency of transmission, or the specific destination IP addresses. By analyzing the size of the encrypted packets, the timing of the data flow, and the destination IP, DPI can identify the traffic as a VPN connection even without seeing the decrypted data.
3. How the Great Firewall detects invisible VPNs
There is no official, public documentation from the Chinese government detailing the exact technical operations of the Great Firewall (GFW). The following data and mechanics are derived entirely from independent academic measurement studies and network research, such as those published at the USENIX Security Symposium and the ACM Internet Measurement Conference.
According to these academic studies, standard VPN protocols (like OpenVPN or WireGuard) have distinct mathematical signatures and handshake sequences that DPI recognizes.
Research indicates the Great Firewall deploys an advanced two-step detection system. First, it passively analyzes the traffic flow to save computing power, looking for specific mathematical patterns. If the traffic looks suspicious, it moves directly to active testing.
3.1. The entropy trap: When traffic looks too random
Fully encrypted proxies (like Shadowsocks or VMess) scramble data extensively to avoid leaving a signature. This uniform structure actually creates a recognizable pattern that the firewall utilizes.
According to a 2023 academic study presented at the USENIX Security Symposium (“How the Great Firewall of China Detects and Blocks Fully Encrypted Traffic”), the GFW analyzes the fraction of set bits (1s and 0s) in the first payload. This specific metric is known as “popcount” or entropy.
The research notes that completely random encrypted data has exactly half of its bits set to 1. Traffic that scores between 3.4 and 4.6 popcount-per-byte and does not trigger any ASCII exemptions is flagged as a fully encrypted proxy and subsequently blocked.
| Traffic Exemption Rule (Allowlist) | Condition / Threshold | Exemption Status |
|---|---|---|
| Rule 1: Popcount Limit | Average popcount-per-byte is <= 3.4 or >= 4.6 | Exempted |
| Rule 2: ASCII Prefix | First 6 bytes are printable ASCII (0x20-0x7e) | Exempted |
| Rule 3: ASCII Majority | > 50% of the payload is printable ASCII | Exempted |
| Rule 4: ASCII Contiguous | > 20 contiguous bytes are printable ASCII | Exempted |
| Rule 5: Protocol Fingerprint | Matches standard TLS ([\x16-\x17]\x03[\x00-\x09]) or HTTP (GET, PUT, POST, HEAD followed by a space) | Exempted |
Normal web traffic has predictable formatting (text, spacing), which makes its mathematical structure uneven. Because standard VPNs encrypt data thoroughly, the data resembles a uniform string of random characters.
The firewall actively scans for this high level of randomness. If your traffic appears completely scrambled compared to normal website data, the firewall identifies the connection as a VPN proxy.
3.2. Traffic flow signatures and packet size analysis
Academic measurements show the GFW checks the length of the first data packet in a TCP connection. Obfuscated protocols without proper packet size shaping leave predictable length remainders that expose the connection type.
According to the 2020 ACM Internet Measurement Conference study (“How China Detects and Blocks Shadowsocks”), the lengths of certain replay probes consistently yield specific remainders when divided by 16. In testing, 72% of observed R1 probes in a specific interval left a remainder of 9, and 96% in another interval left a remainder of 2.
Because VPN encryption adds a specific amount of overhead (extra bytes) to a connection, the DPI engine can identify the VPN protocol just by looking at the total size of the first packet sent. Some obfuscated protocols process data in fixed 16-byte blocks. This structure predictably leaves a remainder of 2 or 9 when the total packet length is divided by 16, mathematically exposing the connection to the network monitor.
4. Active probing: The firewall’s secret weapon
If the passive DPI filter flags a connection as a suspected VPN, the GFW initiates Active Probing. According to multiple academic studies from UC Berkeley, Princeton University, and the University of Massachusetts Amherst, the censor acts as a fake client and sends specially crafted data payloads to the suspected VPN server.
The academic research documents that the GFW sends replay-based probes (R1-R5) that copy past legitimate traffic, as well as non-replay random probes (NR1-NR2) of varying lengths (e.g., 221 bytes). If the server responds to these probes in a predictable way (such as issuing a TCP RST, a TIMEOUT, or a FIN/ACK), the system confirms it is a circumvention tool.
Once confirmed, the GFW enacts a residual censorship penalty. It drops all subsequent TCP packets between the client and the server for exactly 120 or 180 seconds. Research shows that UDP traffic to the same server remains completely unaffected by this specific TCP block.
The firewall actively impersonates a client and sends specialized data requests to the suspected VPN server. If the server responds using a known VPN handshake, the firewall catches it and places your connection in a 120 to 180-second penalty phase. This strict timeout phase explains why users in restrictive regions experience sudden, temporary connection drops when using standard tools.
5. Defeating the censors: How open-source proxies evade DPI
Moving OpenVPN traffic to TCP Port 443 attempts to mimic regular HTTPS web traffic, but advanced DPI easily identifies the differing TLS handshake anomalies. According to network security experts, this simple port switch is frequently ineffective in heavily monitored networks.
Instead of relying on standard VPN protocols, developers behind dedicated circumvention tools like Shadowsocks, V2Ray, and Outline created specific mathematical adjustments designed directly to utilize firewall exemption rules. By intentionally manipulating the data structure, these tools alter the uniform randomness of standard encryption.
Here is how these open-source tools mathematically interact with DPI engines:
- Customizable Payload Prefixes: Developers modified proxies like Shadowsocks to add a printable ASCII prefix (at least 6 bytes) to the very first data packet. This forces the GFW to exempt the traffic under its standard HTTP/TLS rules mapped in the academic allowlist.
- Altering Popcount: To bypass the entropy trap, open-source developers introduced patches that intentionally inject extra ones or zeros into the encrypted packet. This pushes the average popcount-per-byte strictly above 4.6 or below 3.4, indicating to the firewall that the data is not entirely randomized.
- Bridge Relays: Open-source tools frequently pair mathematical obfuscation with unlisted, private server IP addresses. This prevents the firewall from blocking the connection based on known public IP blacklists.
6. Defeating the censors: How modern commercial VPNs evade DPI
While open-source proxies rely on mathematical adjustments like altering popcount, commercial VPN providers approach DPI evasion through structural protocol changes. Modern VPNs handle Deep Packet Inspection by developing specific obfuscation features and tunneling methods.
Based on their technical architecture against advanced firewalls, here is how some commercial providers actively implement obfuscation:
- NordVPN (Obfuscated Servers & NordWhisper): NordVPN addresses strict network inspection through dedicated Obfuscated Servers powered by its custom NordWhisper protocol. This proprietary technology actively masks the standard VPN fingerprint and disguises the encrypted data payload to mimic regular HTTPS web traffic. Because restrictive firewalls interpret this altered signature as normal internet browsing, the connection successfully passes through DPI filters undetected.
- ProtonVPN (Stealth Protocol): ProtonVPN engineered a specific protocol named “Stealth” to handle DPI and active probing. Instead of relying on standard UDP connections which are easily flagged, Stealth takes the WireGuard protocol and tunnels it completely inside a TLS/TCP connection. This shifts the mathematical signature of the traffic, allowing it to bypass entropy traps without triggering normal classification rules.
- ExpressVPN (Lightway Protocol): ExpressVPN built its open-source Lightway protocol as an alternative to older standards. Lightway is designed to remove the recognizable cryptographic handshakes of older protocols. When it detects restrictive networks, it automatically applies built-in obfuscation, disrupting the predictable patterns that DPI engines use to expose connections.
- Surfshark (NoBorders): Surfshark handles network restrictions using two integrated features. Selecting the OpenVPN protocol in the settings automatically obfuscates the traffic, altering its footprint to evade DPI filters. Additionally, if the application detects a restrictive firewall, its NoBorders mode activates automatically, shifting the connection to specific servers configured to operate under strict network filtering.

To understand the exact technical mechanics behind these stealth protocols, explore our comprehensive guide on how VPN Obfuscation works.
7. FAQs about deep packet inspection
Is deep packet inspection legal?
It is legally mandated in many countries for network filtering, and it is legally used globally by ISPs and enterprises for network security and compliance.
Can deep packet inspection read encrypted HTTPS traffic?
No, it cannot read the decrypted message (like passwords), but it can read the metadata (destination, packet size, timing) to identify the type of traffic.
What is the difference between TLS inspection and deep packet inspection (DPI)?
TLS inspection requires installing a root certificate to decrypt, read, and re-encrypt data (Man-in-the-Middle). DPI analyzes the payload and metadata without needing decryption keys.
What is Traditional Packet Analysis (TPA) compared to DPI?
TPA only looks at the packet headers (IP addresses and ports). DPI looks at both the headers and the inner payload to identify applications.
How do you bypass deep packet inspection?
You bypass it by using obfuscation tools, stealth protocols, and Tor bridges that scramble packet headers and alter mathematical traffic signatures.
Does a standard VPN protect against deep packet inspection?
No. Standard VPNs use default ports and predictable encryption handshakes that DPI engines easily recognize and block.
8. Conclusion
Deep Packet Inspection has evolved significantly from simply reading packet payloads to utilizing Encrypted Traffic Intelligence and Active Probing to expose hidden connections. Based on academic research, standard encryption is no longer enough to stay connected in restrictive regions.
Active protocol obfuscation is required to alter mathematical signatures and bypass entropy filters. If you are traveling to a region with heavy internet censorship, verify that your chosen privacy tool explicitly supports protocol obfuscation or stealth modes.
For a detailed breakdown of which providers successfully implement these advanced features against DPI, explore the VPN Guides section on the Safelyo homepage.