English
简体中文繁體中文EnglishРусскийفارسی

Home › Blog › Speed

A barrier on the road

WireGuard fine by day, slow at night or dropping? UDP may be throttled. How to tell, and what a new port, another line or a TCP wrapper does.

Compiled on

Once the bar is down, everyone waits
Once the bar is down, everyone waits Axel Hindemith, CC BY-SA 4.0

WireGuard uses UDP only. Some networks put UDP last and drop it first in the evening; others recognise the handshake and block it. The official known limitations are clear: it does not focus on obfuscation, which belongs to a layer above.

Two things are often confused. Throttling: packets pass but some are dropped; slow, blurry video. Blocking: the handshake is recognised and stopped; nothing at all, or silence after a while.

Is it UDP?

  1. TCP to the same serveriperf3 -c SERVER gives the normal speed
  2. Then UDPiperf3 -c SERVER -u -b 50M, look at the loss
  3. Another networkFine on a hotspot means it was the first line
Three steps

Over five percent UDP loss with healthy TCP means UDP is treated differently.

A toll plaza: at peak hours carriers may slow UDP on its own
A toll plaza: at peak hours carriers may slow UDP on its own Rodhullandemu, CC BY-SA 4.0

What to try

WayDoes it helpCost
Another port, such as 443If limits go by portNone
A server on a better routeMost of allMoving
udp2raw or udptunnelAgainst limits on UDP onlyMore delay, needed on both ends
Another protocolWhere protocols are recognisedSetting up again

udp2raw and udptunnel, both named on the official page, turn UDP into TCP. TCP inside TCP slows both down, so keep it as a last resort.

Better not

  • Reconnecting over and over. Limits look at traffic, not connections.
  • A tiny PersistentKeepalive, which only uses battery.
  • "Boosted" builds of unknown origin. A changed program can read your private key.
A road barrier: compare TCP and UDP speeds before calling it throttling
A road barrier: compare TCP and UDP speeds before calling it throttling Gazamp, CC BY-SA 4.0

When to take another road

For linking your own devices WireGuard is a fine choice and limits hardly matter. For browsing and video across borders it is about the line, and the protocol helps little.

AdLuoboyunChanging lines? Compare with a trial first: 1 GB for 24 hours; Alipay, WeChat and crypto accepted.Get a trial

Measure, do not guess

On the server
sudo apt install iperf3
iperf3 -s
On your computer, by day and in the evening
iperf3 -c server -t 20            # TCP up
iperf3 -c server -t 20 -R         # TCP down
iperf3 -c server -u -b 30M -t 20 -R   # UDP down

The last line of the UDP test shows lost/total. A typical result: by day TCP 80 Mbps and UDP loss 0.2%; in the evening TCP 60 and UDP loss 18%. TCP survives and UDP does not: it is treated differently. If TCP also falls to 8, the whole line is full and no protocol helps.

Why loss hurts so much

Inside the tunnel there is mostly TCP, which slows down at each loss. One percent on a long line may leave a third of the speed; five percent makes video hopeless. A calmer algorithm on the server helps when the traffic starts there, such as through a proxy, and little when it only forwards:

Server
echo -e "net.core.default_qdisc=fq\nnet.ipv4.tcp_congestion_control=bbr" | sudo tee /etc/sysctl.d/99-bbr.conf
sudo sysctl --system

Changing the port

Change ListenPort and every Endpoint, or open a second entrance:

Let 443 lead to 51820
sudo iptables -t nat -A PREROUTING -p udp --dport 443 -j REDIRECT --to-ports 51820

443 is used by HTTP/3 and rarely blocked as a whole; 53 and 123 often pass too, though some networks hijack 53.

The price of wrapping

udp2raw makes UDP look like TCP without being TCP, so there is no double retransmission, but both ends need administrator rights and phones are out. Real TCP wrapping makes loss worse. Ask first: is UDP forbidden, or is the line losing packets? Wrapping only helps the former. Start with an MTU of 1280.

The line decides

LineIn the evening
Ordinary international exit5 to 20% loss is common
Optimised routeUnder 1%
IPv6Sometimes better, worth a try

Before renting, ping the test IP two hundred times between nine and eleven in the evening.

It drops at 10 pm sharp. Am I targeted?

More likely congestion. Try another carrier's hotspot at the same time.

Do obfuscated versions work?

There are third-party forks such as AmneziaWG. Both ends need the same fork; it does not talk to the official one.

Mobile data is good, home is bad?

Two different exits. It also shows that the server is fine.

Does restarting the modem help?

Sometimes, with a new exit address, for a while.

Is the host limiting me?

See whether the traffic quota is used up; cheap machines drop to 1 Mbps.

Next letter

On the same round

Postcodes: WireGuard throttled, WireGuard slow at night, udp2raw WireGuard