VPN & blocking 10 min read By KRAKOBIT

Censorship emulation: VPN protocols that pass China, Russia, Iran

KRAKOBIT's censorship emulator ran 8 VPN protocols through China, Russia and Iran filtering rules: only VLESS Reality and XHTTP got through. Here's why.

KRAKOBIT built a censorship emulator: two machines in different data centers, one of which filters traffic according to the published rules of China’s firewall, Russia’s TSPU and Iranian ISPs, while the other runs eight VPN protocols. All eight were run through the emulator, and the results were checked against real connection statistics that HopFox VPN collected on networks in China, Iran and Russia over the past week.

Here is what came out. In the lab, VLESS Reality and XHTTP passed every filtering mode, AmneziaWG survived only on the Russian mobile network, and WireGuard, OpenVPN and Shadowsocks were cut off on the very first packet. Under whitelists and internet shutdowns, no protocol got through. Real networks showed the same order: Reality and XHTTP are the best in all three countries, AmneziaWG is noticeably weaker in China and Iran and acceptable in Russia.

There is one pattern. A VPN’s fate is decided not by encryption but by the first packet of the connection: if the protocol can be identified from it, or it looks like random noise, it gets cut before any data transfer starts. The only protocols that pass are the ones that, from the first byte, look like a visit to an ordinary website with a real certificate. The single discrepancy between the lab and reality, Reality lagging behind XHTTP in Russia, points to a rule that is not yet in any public description of the censorship.

The main thing the emulator provides is repeatability. Now any change to a protocol can be run through the same rules to get before-and-after numbers, instead of waiting a week for statistics from real networks.

Why a test bench when there are connection statistics

Connection numbers from real networks, like the ones HopFox VPN cited in a previous article, answer the question “what works.” They don’t answer “why”: the failure rate mixes the filter, shutdowns, IP bans, weak mobile networks and bugs in the app itself. In Germany, where nobody blocks VPNs, Reality succeeded in 78% of attempts. So a fifth of the failures have nothing to do with censorship.

The bench separates these causes. The censor on it applies one known rule after another and logs exactly which packet it cut and why. If a protocol fails, you can see what it failed on. If it passes, you can see which rule let it through. Most importantly, the run can be repeated after any change to the protocol and the numbers compared before and after.

How the test bench works

Two virtual machines in different data centers and different networks: the client sits in the Netherlands at Serva.one, the server in Riga at NetGrid Host. Between them is the real internet with real latency, not a local network.

On the client machine, the VPN clients live in a separate Linux network namespace. Its only exit to the internet goes through the censor: an nftables and NFQUEUE setup in which a Python program parses the first packets of every connection. Real DPI systems work the same way: they judge a flow by its first bytes, then either let all of it through or cut it. The censor can do what researchers have described: tear down a TCP connection with a forged RST packet, silently drop packets, ban the server’s address and port for minutes, throttle the flow, and also probe a suspicious server itself to check what it responds with.

The server is built the way commercial services build their nodes, HopFox VPN among them. It has its own domain and a real Let’s Encrypt certificate. Port 443 runs VLESS Reality: the connection looks like a visit to that domain, and if the censor contacts the server itself, it gets an ordinary website with a valid certificate. On the same port, XHTTP runs behind nginx: to the filter it is ordinary HTTP/2 to the same domain. Separately, the server runs XHTTP over Reality, WireGuard, AmneziaWG, OpenVPN over UDP and TCP, and Shadowsocks with the AES-256-GCM cipher. A test page on the server is reachable only through the tunnels, so any successful request proves the path went through the VPN.

For each protocol, the bench measures three things: how many seconds until the first successful request through the tunnel, the speed on a 10 MB file, and whether the session stays alive for another half minute under observation.

Which censorship rules are reproduced

The bench includes only rules that are published and reproducible. Not a single guess about secret classifiers.

Profile What it does Source
China, gfw-2023 First-packet check for “fully encrypted traffic”: share of set bits, share of printable characters, long printable runs. A suspicious flow is probed further with random bytes. TLS servers are checked for a certificate matching the SNI name. WireGuard and OpenVPN handshakes are cut by signature Work by GFW Report and university groups at USENIX Security 2023
Russia, mobile network WireGuard and OpenVPN cut by handshake signature, QUIC and YouTube throttled, random-looking traffic like Shadowsocks cut, unknown UDP passes Observations of mobile operators 2023–2025, OONI reports
Russia, strict mode Same, but any unfamiliar UDP is dropped Regions with tight restrictions in 2025
Russia, whitelist Only allowed domains and DNS pass, everything else is silently dropped Ministry of Digital Development whitelist mode since September 2025
Iran, normal day WireGuard and OpenVPN signatures, almost all UDP, TLS without SNI and unfamiliar TCP are dropped, 10-minute IP bans OONI measurements, NetBlocks reports
Iran, shutdown All external traffic is dropped Shutdowns of November 2019 and June 2025

The Chinese firewall heuristic deserves a separate description, because it is what killed Shadowsocks. The filter takes the first data packet and counts the share of set bits: for an encrypted flow it is close to half, for text and TLS noticeably lower. Then it looks for signs of ordinary protocols: printable characters at the start, long readable chunks, TLS and HTTP headers. If none of these are present, the flow is suspect. Shadowsocks was designed as traffic with no identifying features, and that became its identifying feature.

What the run showed

Eight protocols across seven profiles, including a no-censorship profile as a control. A check mark means the tunnel came up, the file downloaded and the session survived to the end of observation.

Protocol China Russia, mobile Russia, strict Russia, whitelist Iran, normal Iran, shutdown
VLESS Reality ✓ ✓ ✓ ✗ ✓ ✗
XHTTP over TLS ✓ ✓ ✓ ✗ ✓ ✗
XHTTP over Reality ✓ ✓ ✓ ✗ ✓ ✗
AmneziaWG ✗ ✓ ✗ ✗ ✗ ✗
WireGuard ✗ ✗ ✗ ✗ ✗ ✗
OpenVPN UDP ✗ ✗ ✗ ✗ ✗ ✗
OpenVPN TCP ✗ ✗ ✗ ✗ ✗ ✗
Shadowsocks ✗ ✗ ✗ ✗ ✗ ✗

Where a protocol passed, it passed without loss: the Reality and XHTTP handshake took 0.65 seconds in every profile, and the 120–160 Mbit/s speed was limited by the bench itself, not the filter. Censorship under these rules does not throttle what it hasn’t recognized. It either cuts or it doesn’t.

Why WireGuard, OpenVPN and Shadowsocks fail

The censor’s log shows the same thing for every protocol: the decision is made on the first packet, before encryption of the payload begins.

WireGuard opens a connection with a packet of exactly 148 bytes, with a one in the first byte followed by three zeros. That is the signature: the bench cut it in a single packet in all five filtering profiles. OpenVPN uses its first byte to announce the message type, followed by a session ID and a packet counter that is always one for the first packet. tls-crypt protection encrypts the contents but not this header. Over TCP, OpenVPN looks the same, just with a two-byte length in front.

Shadowsocks fell to the Chinese heuristic in Russia and Iran as well: 4.0 set bits per byte, not a single printable character. To the filter this is noise, and noise almost never occurs on the ordinary internet.

AmneziaWG is more interesting. It removes the WireGuard signature: before the handshake it sends several packets of random length with random contents, and it replaces the headers of the real packets with its own. It can no longer be caught by signature, and in the Russian mobile profile it passed at 113 Mbit/s. But its junk packets look like fully encrypted UDP, and the Chinese heuristic cut it on the very first packet. In strict Russian mode and in Iran it failed for a different reason: there, all unfamiliar UDP is dropped, no matter how it is disguised. AmneziaWG’s disguise works exactly as long as the network lets unknown UDP through at all.

Why Reality and XHTTP get through

Reality and XHTTP don’t hide from the filter. They look like the most common thing on the internet: a TLS connection to an ordinary website.

In the China profile, the censor did what the real firewall has done since 2022: it connected to the server itself using the SNI name and checked the certificate. The bench server returned a real Let’s Encrypt certificate for its own name, and the connection was let through eight times out of eight. Plain TLS without a real domain can’t pass this check, and that is what killed Trojan in October 2022.

XHTTP behind nginx differs from Reality in that a single TLS connection carries real HTTP/2, many short requests instead of one long stream. To the filter this looks even more like a website. On the bench both variants passed the same way, but on real networks there is a difference between them, covered below.

One technical detail cost the bench an entire run. The Reality client mimics Chrome’s fingerprint, and since autumn 2024 Chrome adds a post-quantum key to the handshake. The first packet grew to 1.7 KB and no longer fit in a single TCP segment, so the server name sometimes slipped into the second segment. A censor judging by one segment saw “TLS without SNI” and cut it. Real DPI systems reassemble segments, so the bench had to be taught to do the same. For protocol developers this is a hint: a large handshake becomes a signature in itself.

Does the bench match reality

According to HopFox VPN data for October 27 – November 2, 2026, the share of successful connections by protocol looked like this: China 92% Reality, 91% XHTTP, 34% AmneziaWG; Iran 75%, 66%, 34%; Russia 59%, 71%, 63%. The bench doesn’t produce percentages but a “passes or not” for each rule, so only the order can be compared.

The order matched. Reality and XHTTP are the best in all three countries. AmneziaWG is lowest in China and Iran, and the bench shows why: the Chinese heuristic and the Iranian UDP ban. In Russia AmneziaWG does noticeably better, and the bench explains that too: on mobile networks without strict mode, unknown UDP passes.

There is one discrepancy, and it is a useful one. In Russia, Reality really does lag behind XHTTP, 59% versus 71%, while on the bench both pass equally. This means Russian operators have a rule against Reality that is not in any published description. The candidates are known: cutting long TLS sessions in which too much data flows in one direction, or blocking hosting providers’ address ranges. XHTTP is protected from the first by its nature: short requests. KRAKOBIT will look for this rule in monthly per-operator statistics, and as soon as it is found, it will be added to the profile.

What the bench can’t do

The bench reproduces only known rules. Russia’s real TSPU and the Chinese firewall have classifiers that no one has published, and they change. So the bench catches known blocks and regressions after protocol changes, it does not predict future ones.

The speed in the table is limited by packet parsing in user space, not by the protocols. For comparing protocols against each other, only the relative numbers matter.

The bench doesn’t know what share of a country’s networks runs in strict mode. The real percentage is made up of that share, IP bans and shutdowns, and the bench can’t predict it. What it can predict is exactly what will stop working, and why, once that mode is switched on.

What comes next

The next run will use HopFox VPN’s monthly per-operator statistics: they will show where exactly Reality sags in Russia and which rule explains it. After that, protocol changes will be tested on the bench one at a time, with before-and-after numbers. The censorship profiles in the table above are described in enough detail for anyone to build the same bench on two VPS with nftables and NFQUEUE.

The sources of these rules can be followed through open publications: GFW Report analyzes the Chinese firewall, OONI measures blocking by country, NetBlocks records shutdowns.