Blocking

What is DPI? How it detects VPNs and how anti-DPI VPNs work

DPI, or deep packet inspection, lets a network look beyond the addresses on your traffic and examine the connection itself: its protocol, its handshake, and the sizes and timing of its packets. Internet providers, workplaces and countries that filter traffic use it to recognise VPNs and then block or slow them. An anti-DPI VPN changes those outward signs, making its traffic look like ordinary HTTPS or random bytes, so it is harder to recognise, though no method works on every network.

Published 26 November 202610 min readBy the Phoenix VPN team

DPI (deep packet inspection) illustration: a magnifying glass examining one highlighted packet in a stream of network packets
On this page

What is DPI, and what can it see?

Every packet has a header, which says where it comes from and where it is going, and a payload, the data itself. A basic firewall reads the headers and decides by address and port. Deep packet inspection reads into the payload, follows the handshake a protocol uses to open a connection and watches the pattern of the whole flow, then compares what it finds with a library of known protocols and apps.

Take nDPI, an open-source DPI library: it has hundreds of protocol detectors, needs about ten packets to identify a TLS connection, and recognises VPNs such as WireGuard, OpenVPN and Tailscale (nDPI FAQ). Its protocol list also covers IPsec, L2TP, PPTP, Tor and many commercial VPN services.

Encryption hides what you send, not how the connection looks. HTTPS encrypts the communication between your browser and a website (MDN), yet the site’s name usually travels in readable form at the start of the handshake: the IETF document on Encrypted Client Hello calls it “perhaps the most sensitive information left unencrypted in TLS 1.3”. The network also sees IP addresses, how much data flows and when. A VPN encrypts everything inside its tunnel, but unless it is built to blend in, the tunnel itself is easy to spot.

You can run into DPI on mobile and home broadband, on office, school and hotel Wi-Fi, and in countries that filter traffic. The tools are the same whatever the aim, from security to censorship; the difference lies in the rules applied once your traffic is classified.

How DPI recognises VPN traffic

DPI systems combine several clues, and the strictest networks add rules that need no inspection at all.

Protocol signatures and handshake fingerprints

Most VPN protocols were built to be secure, not hidden, so their packets follow fixed formats. Every WireGuard message starts with a type number from 1 to 4 and three zero bytes, and its handshake messages have fixed sizes: 148 bytes to start a session, 92 to answer (wireguard-go source). nDPI’s WireGuard detector checks exactly these features, and WireGuard says it does not focus on obfuscation. More in our article on why WireGuard gets blocked.

OpenVPN is recognised by fields in its packet headers. Its tls-crypt option “makes it harder to identify OpenVPN traffic as such” (OpenVPN manual), but harder is not impossible: research presented at USENIX Security 2022 found that the pattern of message types can still give scrambled OpenVPN away, and nDPI now has a heuristic for obfuscated OpenVPN based on that work (nDPI source). Older protocols such as PPTP and L2TP/IPsec use well-known ports and can often be blocked by port alone.

TLS has fingerprints too. The ClientHello, the first message of a TLS handshake, lists the versions, ciphers and extensions the client supports, in a particular order. JA3 turns those values into a fingerprint, and its successor JA4+ extends the idea to other protocols. Software using a programming language’s default TLS library is easy to tell apart from a browser, which is why libraries such as uTLS exist to imitate browser handshakes.

Packet sizes and timing

Encryption hides the bytes, not their shape: how big each packet is, which way it travels and how quickly the next one follows. Fixed sizes betray a protocol, which is why the Shadowsocks 2022 specification requires the salt and header that open a connection to be sent in one go: separate writes “can result in predictable packet sizes, which could reveal the protocol in use”.

Tunnelling adds patterns of its own. Open an HTTPS site through a TLS-based proxy and your browser’s handshake travels inside the proxy’s connection, with a recognisable rhythm of packet sizes. The Xray documentation calls this the TLS-in-TLS signature and warns that using TLS or REALITY “does not mean that proxy traffic has the same characteristics as ordinary HTTPS traffic”. Behaviour over time counts too: one “website” that carries gigabytes for hours can look unusual.

Active probing

Some systems don’t just watch. When a server looks suspicious, they connect to it themselves with a handshake, random data or a replay of a recorded connection, and see how it reacts. A server that answers like a proxy, or closes the connection after a telling number of bytes, confirms the suspicion.

Modern protocols plan for this. Shadowsocks 2022 rejects replays and hides how many bytes the server reads before giving up, a defence against “probes that send one byte at a time”. A Hysteria2 server behaves “just like a standard HTTP/3 web server” to anyone without credentials (Hysteria protocol), and REALITY hands such connections to a real website (REALITY README).

IP addresses and hosting reputation

Sometimes no inspection is needed. Lists of VPN and hosting addresses are easy to build: one public list on GitHub combines “known VPN netblocks” with the ranges of networks owned by data centres and VPN providers (X4BNet), and nDPI also uses IP addresses as signatures (nDPI FAQ). A data-centre address is not proof of a VPN, but it adds to the other signs. Once a server’s IP is blocked, no disguise helps: the usual fix is a different server or address.

Allowlists of approved destinations

The strictest networks don’t look for VPNs at all: they allow a list of approved destinations, sometimes called a whitelist, and block everything else. You may meet this on some workplace and school networks, on hotel Wi-Fi before you sign in, and on some mobile networks during restrictions. No disguise helps there unless the server is on the list.

Method What it looks at Can obfuscation help?
Protocol signatures Fixed headers, message types and handshake sizes Yes: this is what obfuscation is designed to remove
Handshake fingerprints The ClientHello’s ciphers, extensions and their order Yes, if the client imitates a common browser
Packet sizes and timing Packet sizes and rhythm, session length and volume Partly: padding blurs patterns, but hours of heavy traffic still show
Active probing How the server answers strangers and replayed data Yes, if the server reveals nothing unusual to probes
IP and hosting reputation Who owns the server’s address; block lists No: a disguise does not change the IP
Allowlists Whether the destination is on an approved list No: only listed destinations get through

Throttling vs blocking

Once DPI has classified your traffic, blocking is only one option.

Blocking stops the connection. Packets are dropped, the connection is reset, or the handshake starts and is then cut off. In the app you see it stuck on connecting, connected with nothing loading, or dropping within seconds.

Throttling lets the connection through but slows it down, sometimes until it is useless. It may hit one protocol, all UDP traffic, or connections that last long or carry a lot of data. It is harder to recognise because it looks like a poor connection, and for the network it is a quieter tool: a slowdown draws less attention than a failure, and a wrong guess does less harm. Tools such as Wehe test whether a provider is “throttling network traffic for certain apps or ports”.

If you’re not sure which one you’re facing, our guide to a VPN blocked on Wi-Fi or mobile data walks through the checks.

How a VPN can bypass DPI

Obfuscation doesn’t add more encryption. Encryption protects the content; obfuscation changes the outward signs of the connection, so the signatures and patterns above no longer match. It takes one of two routes: look like traffic the network can’t afford to block, or look like nothing in particular.

The first route relies on collateral damage: blocking all HTTPS would break most of the web, so traffic that convincingly looks like HTTPS is costly to block. Hysteria’s developers say their HTTP/3 disguise makes the protocol “very difficult for censors to detect and block without widespread collateral damage” (Hysteria).

An ordinary VPN

  1. Your deviceConnects with a standard VPN protocol
  2. DPIRecognises a known VPN signature
  3. Blocked or slowedThe connection fails, drops or slows to a crawl

An obfuscated connection

  1. Your deviceConnects with an obfuscating protocol
  2. DPISees what looks like ordinary HTTPS
  3. Allowed throughNo known VPN signature to match
  4. InternetYour traffic goes on from here
How DPI treats two connections: a known VPN signature gets blocked or slowed, while traffic that looks like ordinary HTTPS is let through.

Looking like ordinary HTTPS

VLESS + REALITY borrows the TLS 1.3 handshake of a real website and sends a browser-like ClientHello, so the network sees what looks like a visit to that site, and probes get the real site’s answer. Our VLESS + REALITY guide covers the details.

Looking like HTTP/3

Hysteria2 runs over QUIC, the UDP-based transport behind HTTP/3 (MDN). By default it imitates HTTP/3, and its server answers strangers like a web server. It needs UDP, which some networks block or slow down. More in our Hysteria2 article.

Looking like random bytes

Shadowsocks takes the other route. With AEAD ciphers, both the data and the proxy’s control fields are protected, and the 2022 specification calls the result “indistinguishable from a random byte stream”. Hysteria2 offers this as a separate mode: with Salamander enabled, it turns packets into outwardly random data instead of imitating HTTP/3. Either way, there is no protocol to match. The catch is that randomness is a pattern too: DPI labels flows it can’t identify as unknown (nDPI does so after 15–20 packets, according to its FAQ), and a network that distrusts unknown traffic can still restrict it. More in our Shadowsocks article.

What obfuscation can’t do

Obfuscation changes what a connection looks like, not where it goes:

  • The IP stays the same. Block lists still apply, and obfuscation does not hide your exit IP from the websites you visit.
  • Each disguise has conditions. HTTP/3 imitation needs UDP, an HTTPS disguise needs HTTPS to be allowed, and no disguise gets past an allowlist.
  • Detection keeps improving. A method that works today may be recognised tomorrow, as the OpenVPN detectors show, so having several protocols to switch between matters more than any single one. VPN protocols compared sets out how the main options differ.

Anti-DPI VPN: how Phoenix VPN handles DPI

Phoenix VPN is made for networks that block VPNs. No single protocol suits every network, so you get four, all in every plan:

  • VLESS + REALITY takes on the appearance of a TLS connection to a regular website.
  • Hysteria2 imitates HTTP/3 by default, and with Salamander enabled it turns packets into outwardly random data.
  • Shadowsocks uses AEAD ciphers, so both the data and the proxy’s control fields are protected.
  • WireGuard is the fast option for open networks. Standard WireGuard isn’t designed to mask traffic from DPI — Phoenix has other approaches for that.

You don’t have to work out which one your network allows. Tap Smart Connection and the app checks which protocols get through, picks the best country and connects, with nothing to configure. You can still choose the protocol and the country yourself. None of this makes a connection undetectable, and results depend on the network and its filtering methods.

You can also build this yourself with your own server running Xray, Hysteria or Shadowsocks, which gives you full control if you enjoy maintaining servers. Here is what each route takes.

Set it up yourself Phoenix VPN
Server Rent a VPS outside the restricted network and keep it updated Phoenix’s dedicated servers with multi-gigabit links
Protocols Install and configure each one on your server VLESS + REALITY, Hysteria2, Shadowsocks and WireGuard built in
Finding what works Test protocols and settings yourself on each network you use Smart Connection checks which protocols get through, picks the best country and connects
When a method stops working Change the server’s settings, then update every device Pick another protocol or country, or let Smart Connection find what works
Apps A third-party client such as v2rayN, v2rayNG or Hiddify on each device VPN apps for Windows, Android and Android TV; iPhone/iPad and macOS coming soon

If your VPN works on one network but fails or crawls on another, DPI is a likely cause, and a protocol that looks different is often the fix. Phoenix VPN, an obfuscated VPN for networks that block VPNs, puts four protocols and Smart Connection in every plan, so you can find what gets through in one tap. The Phoenix and Inferno plans include a 3-day free trial for testing it on your own network, and you can cancel anytime. Compare plans or download Phoenix VPN.

Frequently asked questions

Can DPI detect a VPN?

Often, yes. Standard protocols such as WireGuard, OpenVPN and IPsec have recognisable packet formats and handshakes, and even open-source DPI software identifies them. Obfuscated protocols are much harder to recognise, but the server's IP address, traffic patterns and allowlists can still give a connection away, so no VPN is undetectable on every network.

Can DPI see which websites I visit through a VPN?

Not the sites inside the tunnel. With a VPN on, the network sees a connection to the VPN server: its IP address, how much data flows and when, and possibly that it is a VPN. Without a VPN, it can usually see the names and addresses of the sites you visit, though not the content of HTTPS pages.

Can DPI read encrypted traffic?

Not on its own. Without the keys, DPI cannot read the content of HTTPS or VPN traffic, so it analyses outward signs such as handshakes, packet sizes and timing instead. The exception is a managed device, such as a work laptop, where the organisation has installed its own root certificate so its firewall can decrypt HTTPS. This is usually called TLS inspection.

How can I tell if my VPN is blocked or throttled?

A blocked VPN usually never connects, or connects and drops within seconds. A throttled one connects but runs far slower than your normal connection, often only on one network or after the first few minutes. Comparing Wi-Fi with mobile data, and one protocol with another, often shows which is happening.

What is an anti-DPI VPN?

A VPN that uses obfuscating protocols to change the outward signs of its traffic, so DPI finds it harder to recognise and block. Common approaches make the connection look like ordinary HTTPS or HTTP/3, or like random bytes. It improves your chances on restrictive networks but cannot guarantee a connection everywhere.

Phoenix VPN team · Written and fact-checked by the people who build Phoenix VPN.

Skip the setup
One tap to a protocol that works

Smart Connection checks which protocols get through on your network, picks the best country and connects. Phoenix and Inferno plans come with a 3-day free trial.