Skip to content

Protocols and Connections

Outcome: you can explain how a connector's traffic actually travels, why a network that strangles one protocol still passes the other, and — just as important — how to tell a transport problem from a problem that happened earlier and merely wears transport clothing. The lab's three network probes are the evidence, and they are all real.

One port, two protocols

A running cloudflared holds four connections to Cloudflare's edge, reaching two nearby data centres (the addresses are region1.v2.argotunnel.com and region2.v2.argotunnel.com). The connections leave by port 7844, and by default they speak QUIC — a modern transport carried inside UDP packets, encrypted end to end, good at surviving flaky links and quick to re-establish. The alternative is HTTP/2, the web's own workhorse protocol, carried inside ordinary TCP on the same port. You choose with a flag, or not at all:

cloudflared tunnel run --protocol http2 photos
cloudflared tunnel run --protocol quic photos
cloudflared tunnel run photos            # the default: quic

Nothing about your services, names or rules changes with the choice. It is purely a question of what the network between your machine and Cloudflare will carry — which makes the network probes below the practical core of the chapter.

The lab's three probes

Probe one: the names resolve. (transcript cloudflared-lab/transcripts/t07-edge-reachability.txt)

$ getent hosts region1.v2.argotunnel.com region2.v2.argotunnel.com
198.18.130.173  region1.v2.argotunnel.com
198.18.130.174  region2.v2.argotunnel.com

On the lab's machine DNS answers — with addresses in the 198.18.x.x range, which documentation-savvy readers will recognise as a benchmarking range, a hint that this sandbox's DNS is intercepted and its answers are synthetic. On a home machine the answers are Cloudflare's real edge addresses. Either way, some answer is the first check: no answer, no tunnel, and the fault is DNS, not cloudflared.

Probe two: TCP connects.

$ timeout 6 bash -c "exec 3<>/dev/tcp/region1.v2.argotunnel.com/7844" && echo TCP-7844-connected || echo TCP-7844-failed
TCP-7844-connected

A TCP connection to port 7844 was accepted. On the lab's intercepted network that says less than it appears to — something in the middle accepted it — and the lesson generalises: a port that "connects" through an intercepting network proves the interceptor, not the path. On an ordinary network the same test is meaningful, and a refusal or silence here, with QUIC also failing, is the signature of outbound 7844 being blocked altogether.

Probe three: UDP does not leave the building. The lab's probe program (cloudflared-lab/udp-probe.py) tried to send a single UDP packet toward the edge and did not get as far as waiting for a reply:

$ python3 udp-probe.py
send itself failed: [Errno 1] Operation not permitted

The sandbox refuses outbound UDP at the operating-system level. QUIC from this machine is not slow, not filtered downstream — it is impossible, and no cloudflared setting could have changed that. The home-network version of this probe's result is quieter — packets leave and are silently dropped by a router or an ISP that mishandles UDP — but the reading is the same: when QUIC cannot establish, the fix is not to retry it harder but to run with --protocol http2, moving the same work onto TCP.

The failure that is not a transport failure

Chapter 4's 403 now earns its keep as a diagnostic contrast. The lab forced HTTP/2 for a quick tunnel (transcript cloudflared-lab/transcripts/t09-quick-tunnel-http2.txt) and received the identical provisioning refusal — because a quick tunnel's first step is an HTTPS API call, a stage before any tunnel transport exists. Retrying a refused provisioning with a different --protocol is like repainting a car whose door will not open. The general skill this chapter is teaching is ordering: cloudflared's log lines arrive in the order the stages run — provision or authenticate, then connect, then serve — and the stage named in the last line is where the trouble is. Chapter 12 is organised by exactly that principle.

What four connections buy

Redundancy, stated concretely: with connections in two data centres, either centre can fail, restart or be routed around while the tunnel keeps answering on the survivors; a single connection dropping is a log line, not an outage. cloudflared re-opens lost connections on its own, which is why a tunnel left running for a month reads, in its logs, as a quiet diary of small recoveries. The visitor's experience of your origin restarting is different and worth keeping apart: the tunnel is up, the room is shut — requests get a 502 from cloudflared, which chapter 12 also covers.