Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 17:28

v1.9.0 was tagged but never published (its release run failed), so this is
the first release since v1.8.5 and also carries everything in the v1.9.0
section of CHANGELOG.md.

Security

  • The plain transports prove both ends and no longer send the token.
    tcp, tcpmux, ws, wsmux and udp used to send the tunnel token as
    it is and take the server's echo of it as proof. Something on the path
    could read the token, then pose as the Iran server — and the Iran server is
    what tells the kharej which address to dial for every connection, so the
    kharej dialled wherever it was told. Both ends now prove the token with a
    challenge and response, and every address the server sends is sealed with
    the session's key; the kharej dials no address that does not carry it.
    Traffic on these transports is still not encrypted. A v2.0.0 end still
    makes a tunnel with a v1.9 end on the old handshake, with a warning in the
    log; once the two ends have connected the new way, the old handshake is
    refused for that tunnel from then on (remembered in .<name>.peer beside
    its config, so a restart does not forget it), and a kharej made from a
    v2.0.0 Setup Link refuses it from the start (peer_auth = "required").
    A new kharej against an old Iran server takes 8–16 s more to come up while
    it finds out. See ADR 0006.

Added

  • Sponsored box on the panel's Overview. A square image with a link, beside
    the traffic card, so it is on screen without scrolling. Its content is a manifest
    ({"image", "link", "title"}) and the image it names, published on the
    developer's server, so it changes without a release. The panel fetches both
    in the background — direct, then through the tunnel relay — at most every 30
    minutes, revalidates the image with its ETag, and serves the cached copy from
    its own origin, so the browser never reaches the publishing server and the
    panel's CSP is unchanged. The image type is read from the bytes (GIF, PNG,
    JPEG or WebP only, at most 15 MB); a link that is not http(s) is dropped. A
    withdrawn manifest (404, or an empty image) removes the box; an unreachable
    server keeps the last one. A fixed 252-pixel square, so the row is the same
    height at every desktop width; still beside the traffic on a tablet, and
    straight under it on a phone.

  • The same image in the Telegram bot, every Friday. From noon Tehran time,
    each admin of the bot receives it once, with its link as a button (a GIF is
    sent as an animation, so it plays). Uploaded once and sent to the other
    admins by Telegram's file id. The monitor service keeps its own copy fresh,
    so it goes out whether or not the panel was opened that week; a Friday the
    service was down for is skipped, and a failed delivery is retried for that
    admin alone the same day.

  • GRE, the kernel's own, as a direct carrier. Next to xDi, PCK, SNI and IP
    Spoofing in Setup → Direct and on the panel's Add form. It is plain kernel GRE
    and not encrypted: it travels as bare IP protocol 47, and whatever crosses
    it is in the clear unless it is encrypted itself — the wizard, the panel, the
    file and the health screen all say so. Where a route passes it, it is the
    cheapest tunnel there is: the kernel encapsulates, with no TUN, no handshake
    and no copy through userspace (5 MB in 0.04 s between two namespaces). It is
    set up like the others — the Iran side first, one setup link for the kharej,
    forwarded ports, UDP, presets, Edit, the listing, health, the watchdog,
    metrics, the Connection Test, backup and delete — with fewer questions: no
    port, no token, no error correction. gre runs over IPv4 and ip6gre over
    IPv6, chosen from the kharej's address, and a domain can be pinned to either
    under Fine-Tune. Several GRE tunnels can share one server, to different
    kharej or more than one to the same: each gets its own interface, its own
    /30 and its own GRE key, since the kernel allows one link per pair of
    addresses and key, and the setup link carries the key so both ends match.
    The local address is the one the route to the kharej leaves from (gre_local
    overrides it); the MTU is that interface's less GRE's own 24 bytes (28 with
    the key; 44 and 48 over IPv6), then measured with don't-fragment pings across
    the link and lowered if the path carries less. The engine pings the other end
    every few seconds, which is how the panel and the watchdog know the tunnel is
    up; lets protocol 47 from the other server in through iptables while it runs;
    replaces a link a killed run left behind; and takes its link down when it
    stops. A missing ip_gre / ip6_gre module is named with the modprobe that
    fixes it. Needs root.

Changed

  • PCK Aggressive doubles its ceiling: 8192-packet windows and 8 MiB a
    stream
    (Turbo's 4096 and 4 MiB before). Through the Connection Test
    between two namespaces: the same on a clean 70 ms path, 1050/980 → 1470/1330
    Mbit/s on a clean 150 ms one, 594/715 → 611/816 at 1% loss, and 84/84 →
    103/87 through a 100 Mbit/s policer, where Turbo carries 64/59 and GRE
    44/50. A session may hold twice the receive window (11 MB), still capped by
    its 16 MiB smux buffer.

  • PCK is a new engine: port forwarding over KCP, on paqet. The pck
    carrier no longer carries IP packets over a TUN device. It is a port of
    paqet (MIT; the notice is in NOTICE):
    KCP for reliability, smux to carry many connections over one session, and TCP
    segments built and captured with libpcap, so a middlebox still sees an
    ordinary flow but the flow now retransmits what the path drops. Iran listens
    on the forwarded ports (TCP, and UDP with accept_udp); the kharej dials the
    target on its own 127.0.0.1. It carries ports and nothing routed. There
    is no interface, no tunnel address, no MTU and no error correction for it; for
    routed traffic use xDi, SNI Spoofing, IP Spoofing or GRE. The three presets
    map to the engine: Balance is one KCP session in fast mode with 256/512
    windows, Turbo (the default) two in fast2 with 4096, Aggressive four in
    fast3 with 4096 — and the wizard shows each with what it sets. Optional
    pck_conns, pck_kcp_mode, pck_kcp_mtu, pck_kcp_sndwnd, pck_kcp_rcvwnd
    and pck_kcp_block override them one by one, under Fine-Tune in the menu and
    a PCK fine-tune drawer on the panel. The interface, this server's address,
    the gateway's MAC and the iptables rules that keep the kernel from answering
    the tunnel's segments with RSTs are found and installed at start, which paqet
    leaves to its operator, and Health Check reads them instead of looking for an
    interface that is not there. A forwarded connection keeps its half-close: a
    client that finishes sending and waits for the reply gets it, which paqet's
    own forwarding does not allow.

    Setup is shorter than any other carrier's: the Iran wizard asks the kharej
    address, the tunnel port, the ports, UDP, a name and the preset, and nothing
    about interfaces, addresses, MTU or error correction. The token is generated
    and is the encryption key; the setup link carries it, the port, the preset
    and any tuning, and the kharej asks only for a name.

    Both servers must be updated: the wire is not the previous PCK's, and each
    end names the other when it is still on the old one. A tunnel built by v1.9.0
    or earlier keeps running as its file is: it is read, never rewritten, its TUN
    keys are ignored and said to be in the log, and the preset's engine
    parameters come from its name. Saving it from Edit writes the new format. A
    tunnel with no ports, which routed traffic, cannot go on doing that, and a PCK
    tunnel is not edited into another carrier or the reverse — add the new one on
    both servers and delete the old, as for GRE. Several kharej cannot share one
    Iran port on PCK, which needed a peer address on a TUN. The reverse
    TCP + PCK transport and sni are unchanged.

    The kharej connects only to its own services — 127.0.0.1 and its own
    addresses, what the previous PCK's TUN reached. A target on another machine
    is refused and named in the Iran log, unless the kharej's file sets
    pck_remote_targets = true. It also stops at 65 536 forwarded connections
    open at once, and dials nothing for a session that has not completed its
    hello.

    Measured on a veth pair with 25 ms of delay and 0.5% loss each way, Turbo
    downloads at 104, 170 and 168 Mb/s with 1, 4 and 16 streams where the previous
    PCK reached 4, 16 and 56. On a clean veth link Turbo moves about 670 / 1060 /
    1300 Mb/s up and 650 / 860 / 850 down at 1 / 4 / 16 streams — the previous
    PCK's upload, and more than its download — because each KCP session sends
    through a libpcap handle of its own (up to four): with paqet's single handle
    the upload stopped at about 600-740, one system call per packet, one at a
    time. If the route is clean and speed is all that matters, a TCP transport is
    still the better choice. Direct PCK.

  • PCK holds up on a congested or lossy link. A soak of the engine on a
    100 Mbit/s path (30 ms ± 10 ms, a 1000-packet queue) under a mix of 8 bulk
    transfers, 200 short connections a second, idle connections, UDP flows and a
    latency probe found Turbo carrying 14 Mbit/s with no random loss at all,
    its probe at 661 ms where the path alone gave 130, transfers stalling for up
    to 51 seconds on a lossy path, and forwarded UDP delivering 7.8% of its
    datagrams a median of 11.7 seconds late. Correctness was never in question
    (no byte differed, every connection completed, nothing restarted). Changes:

    The send window is controlled. paqet runs KCP with no congestion control, so
    the preset's window was the only brake, and a window larger than the path's
    bandwidth-delay product plus its queue sends more than the queue holds: the
    bottleneck dropped a quarter of what Turbo sent, KCP retransmitted 30% of its
    segments, and the local queue refused 280 000 a minute. A controller, one per
    tunnel, now moves the sessions' windows together between a floor and the
    preset's window (which is the ceiling now, not the operating point) by what
    it reads of the path, of its own direction only: the queue the data it sends
    meets (the round-trip time against the lowest it has seen lately, less the
    queue of the way back), and segments the local queue refuses, once they are
    1% of those sent. It does not read loss, so random loss does not shrink the
    window — a lossy path needs a window several times
    its bandwidth-delay product, and keeping that is what keeps PCK ahead of GRE
    at 3% loss and up. KCP's own congestion control was measured as the other
    option and would have collapsed there, as TCP does.

    The controller reads its own direction. It first read the round trip, which
    holds the queue of both ways, so the less loaded end cut its window for the
    other end's queue: bulk ran at about 45 Mbit/s one way and 6 the other for a
    minute at a time, then swapped. The way back is now read where the data
    arrives, from the timestamp KCP segments already carry, and taken off the
    round trip. Nothing on the wire changes (the engine revision stays 3).

    Refusals of the local queue count by share. Three refused segments in 25 ms
    cut the window and held it for 1.5 s, and a burst that overflows the queue for
    an instant refuses that many: that, not delay, was a loss of 5-30% of the top
    speed on a path with 25 ms of delay and 0.5% loss. They now count once they
    are 1% of the segments sent.

    Output is paced and the retransmit timer has a margin. Output runs at 1.5 ×
    window × packet size ÷ round trip, where unpaced full-window bursts were
    tail-dropped at the bottleneck. The retransmit timer waits 2 × slack (the
    larger of 25 ms and a third of the base round trip) plus the reverse queue
    beyond KCP's own: with no loss, 8% of segments were sent by the timer and 7.5%
    arrived twice, and now 0.1% or less. A lost fast retransmit is
    fast-retransmitted again instead of waiting for the timer.

    A fork of kcp-go. Those three need hooks KCP does not have, so kcp-go is a
    copy in internal/thirdparty/kcp-go (upstream v5.6.72, MIT, a go.mod
    replace, noted in NOTICE). It adds a retransmit-timer margin,
    fast-retransmit-again, a one-way-delay reading of received data and an output
    queue of 8192, each off unless a session turns it on. Only PCK does; the
    legacy kcp transport links the fork and is unaffected.

    KCP batches acknowledgements and small writes in every mode. paqet's fast2
    and fast3 answer every packet with one, and on a link with many short
    connections packets are what a queue counts: the same bulk load sent half the
    segments, and bulk transfers beside the short connections went from 7 and 9
    Mbit/s to 20 and 34.

    Forwarded UDP no longer rides the reliable stream. A datagram that fits one
    segment (1318 bytes) is sealed with a key of its own and sent beside KCP as a
    segment of the same flow: not retransmitted, not queued behind other streams,
    lost if the path drops it. The stream stays as the flow's control channel and
    carries the larger datagrams and the first few. At 5% loss, 90% arrive, 94 ms
    round trip; with no loss, 99.6%, 104 ms. The engine revision is 3: a peer on
    revision 2 (an earlier build of v2.0.0) is named by the hello.

    A reader no longer waits for its window update. smux sent a stream's flow
    control update from the Read that triggered it, which returned only when the
    frame had been through the session's write queue: hundreds of frames long on a
    busy session. The reader that waited was not reading, data piled up in the
    session's receive buffer, and when that ran out the session stopped reading
    everything, including the updates the other end's writers waited for. Every
    upload stopped, for up to a minute. smux is now a modified copy
    (internal/thirdparty/smux, noted in NOTICE): updates are sent from a
    goroutine of their own, and control frames go ahead of data in the write
    queue. The wire is unchanged.

    On that path Turbo now carries 40-44 / 36 Mbit/s of bulk with no loss (14 /
    15 before the work, 25.5 / 23.3 after its first round; GRE 44 / 41), with the
    probe at 163 ms median and 310 ms at the 99th percentile (243 and 598 after
    the first round), forwarded UDP at 99.6%, no stall over 3 seconds in any run
    from no loss to 10%, and every short connection completing (a path that goes
    dark is another matter: 11 seconds on the flap profile, GRE's 39). Single
    loss runs vary by about ±50%, so the sums of both directions of bulk, in
    Mbit/s, are: 1% loss about 30 (about 19 originally), 3% 26 (15), 5% 23 (13),
    10% 18 (15), which is 1.2-2.4 times the original and above GRE at every loss
    rate. Aggressive carries 40 / 41 with no loss (22 / 21 before) and 12 / 19 at
    10% (10 / 10); Balance is unchanged. Bulk transfers beside a few hundred
    short connections a second get what those leave, and on a lossy path a small
    request takes 0.5-1 s, because KCP delivers in order inside a session. Four
    sessions (pck_conns = 4, an opt-in) help on a lossy route and not on a clean
    one: at 10% loss about 13 / 15 Mbit/s against 9 / 8 and a probe median of 550
    ms against 900; at 1% about 24 / 15 against 18 / 13; with no loss no gain and
    a little less up (34.5 against 36); a path that flaps occasionally recovers
    slower. Aggressive's description now says it suits long, lossy routes and is
    slower than Turbo on a clean path; Turbo stays at two sessions, as it was.
    On a clean veth pair the speed is unchanged (Turbo 658 / 896 / 902 Mbit/s
    down with 1 / 4 / 16 streams); acknowledgement batching is turned off where
    the round trip is shorter than the KCP tick, since it would be the round trip
    there. With 25 ms of delay and 0.5% loss and nothing to fill, Turbo downloads
    at 89 / 177 / 172, where the release before the controller gave 99 / 176 / 170
    and the previous PCK 4 / 16 / 56. A policer, which drops without queueing,
    shows in neither signal, and there the window ceiling is the only limit; a
    signal from the share of segments lost was tried and removed, since it fired
    at 10% random loss and cost ten times the goodput. The numbers are in
    Direct PCK. pck_kcp_sndwnd is
    the controller's ceiling.

  • The reverse TCP + PCK transport no longer fills the path's queue. The
    presets give each pooled session a window of 512 to 2048 packets with KCP's
    own congestion control off, so a Turbo pool of eight could have 8192 packets
    in flight against a path that holds about 1500. The same soak that found it in
    direct PCK (100 Mbit/s, 30 ms ± 10 ms, a 1000-packet queue, the same load)
    measured the reverse transport at 28 / 18 Mbit/s down / up with no random
    loss
    , 31% of its segments sent by the retransmission timer, the probe at
    1.3 s, and the same figures at 10% loss as at none, so the loss was never the
    limit. The send-side machinery of direct PCK now drives the reverse
    transport, and only it (kcp and xdi share the session code and are
    unchanged): the window follows the queue the data meets, read of the
    sender's own direction; output is paced; the retransmission timer waits for a
    segment that is only queued; a lost fast retransmission is sent again after a
    round trip; and acknowledgements are batched where the round trip is longer
    than the KCP tick, whatever kcp_acknodelay says. Two things are for the
    reverse transport's pool of eight sessions, where direct PCK has two: the
    window is a budget for the pool, divided among the sessions that have
    something to send (given to each of eight alike, the two that carried a
    transfer had a quarter of the path, and which direction it was changed from
    run to run), and a session that has received nothing does not vote on the
    queue of the way back. The controller moved to internal/pathctl, shared with
    the direct engine, whose behaviour is unchanged. Nothing on the wire
    changes
    : every part is on the sending side, so a v2.0.0 end works with a
    v1.9.0 end, in either role, and each end's sending improves on its own. Next
    to an end that does not run the control, whose direction fills the bottleneck
    queue and makes the round trip swing by hundreds of milliseconds, the control
    tolerates half the queue it reads on the way back on top of its slack (it
    otherwise cut to its floor and carried a third of what the old end did).
    Measured at 1% loss, down / up: a new kharej with a v1.9.0 Iran 22.0 / 24.2
    (two v1.9.0 ends 28.7 / 18.5), a new Iran with a v1.9.0 kharej 55.8 / 10.6.
    Measured on that path, Turbo, 300 s, single runs: no loss 61.0 / 15.4 and
    59.6 / 20.0 (28.4 / 17.9 and 28.8 / 19.1 before), 1% 53.7 / 24.1 and 55.2 /
    24.4 (28.7 / 18.5, 30.4 / 19.2), 3% 60.4 / 20.4 (29.1 / 19.0), 5% 45.1 / 28.6
    (29.5 / 18.3), 10% 23 / 25 over five runs, 17 to 28 down (28.7 / 17.8); the
    probe's median 110-215 ms (0.9-1.5 s), segments sent by the timer under 1%
    (31%), and the engines' CPU about 90% of a core each where it was 130-160%.
    Upload stays near 15-28 Mbit/s, and at 10% loss the two directions trade, so
    their sum is what it was. A stream could stall for 3-6 s and forwarded UDP came back
    at 53-89% under that load (74-96% before), both fixed in this release without
    touching the wire. Forwarded UDP: the relay wrote one datagram per stream
    write and each write waits for the session's write queue, so a flow was held to
    one datagram per write latency, the queue in front of it stood at its 256 and
    dropped, and the rest waited behind a frame of every stream on the session.
    Datagrams already queued now go in one write (the Iran-side flow, and the
    kharej-side backend reader, which also has its own queue), a full queue drops
    its oldest, and the smux fork has an opt-in per-stream priority (a bounded
    burst, control frames still first) that forwarded-UDP streams use on pck
    only. Measured, 300 s: 99.9-100% of the UDP at 0, 1, 3, 5 and 10% loss,
    reordering, duplication and 10% on one direction, median 150-210 ms, 99th
    percentile 340-740 ms
    (56-81% and 0.6-2.9 s median, 8-27 s tail, before);
    bulk unchanged. No datagram lane was needed, so nothing on the wire changed.
    A smux frame of 16 KB moved the UDP median 15% and was left out; 8 KB had cost
    upload. Stalls: the 3-6 s were a new download's wait for its first byte:
    each session sent a connection's backend name and waited for it to leave the
    write queue before pairing the next, so under 200 new connections a second the
    pairing queue reached the 3 s a waiting connection is allowed. The name is sent
    from the connection's own goroutine now; the longest stream stall is 1-3 s in
    the final runs (3-6 s before); seven of the 11 final runs had no first byte
    over 2.5 s and the rest 17 between them, the longest 3.2 s (5 to 15 per run
    before). The
    controller's pace is also bounded: one session reading a round trip of seconds
    had slowed all of them, once stopping a 10%-loss run for 27 s. Next to a v1.9.0
    end at 1% loss: v2.0.0 Iran with v1.9.0 kharej 55.8 down / 7.8 up and 99.7% UDP,
    v1.9.0 Iran with v2.0.0 kharej 12.8 / 25.9, nothing lost or corrupted. The
    test's short connections half-close and wait for a reply, which the reverse
    relay has never carried, so they read 0% before and after.
    TCP + PCK.

  • The reverse kcp and xdi transports get the same send-side control.
    They share the session code with reverse pck, and ran without the
    controller, so a pool of eight sessions with KCP's congestion control off kept
    the bottleneck queue full under load. On a new soak path (100 Mbit/s each way,
    30 ± 10 ms, 1000-packet queue; Turbo as the wizard writes it; four bulk
    streams each way, 200 new connections a second, UDP and a latency probe; 300 s
    single runs), without → with, down / up Mbit/s, new connections made, probe
    median: kcp at no loss 52.9 / 54.5, 31.5%, 766 ms → 68.2 / 61.4, 100%, 80 ms;
    at 3% 52.4 / 54.2, 38%, 244 ms → 69.0 / 58.3, 100%, 77 ms; at 10% 53.6 / 54.2,
    35%, 410 ms → 67.1 / 52.8, 100%, 80 ms; xdi alike (51.2 / 53.6, 31%, 729 ms →
    67.7 / 66.0, 100%, 79 ms at no loss; 52.5 / 53.9 → 67.2 / 58.7 at 10%). On an
    unshaped 25 ms path with 0.5% loss kcp carried 144.6 / 133.5 → 554.3 / 382.1
    and xdi 142.0 / 79.8 → 418.3 / 318.8, the probe there 30 → 65-70 ms with the
    link full. CPU was lower on the shaped path (130-147% → 77-100% of a core per
    end). UDP and ICMP sockets do not report a full transmit queue, so for them
    the window follows the delay alone. Send side only; nothing on the wire
    changes, and an end without it works as before.

  • Release builds link libpcap, statically. PCK's capture needs it, so the
    release binaries are built with cgo and libpcap, which is linked in rather than
    installed: nothing changes on the server. A binary built without it runs
    everything else, and refuses a PCK tunnel by saying so (the health screen and
    the wizard name it too).

  • Connection Test reports the most each tunnel can carry. The speed test
    measured each direction once, with four connections, and showed the average.
    It now measures with four connections and again with sixteen — enough to fill
    a fast link on a long round trip, where a few TCP windows cannot — and keeps
    the better sustained rate, beside a max: the best whole second either
    stage carried. A burst shorter than a second is not reported as the maximum.
    A carrier that will not open sixteen connections keeps its four-connection
    figures rather than failing. Shown on every row, in the best-path table
    (CLI and panel) and in the menu's board; about twelve seconds longer per
    healthy tunnel. The far end is unchanged, so an older kharej is measured the
    same way.

  • The web panel is one width on every desktop. At most 1100 pixels wide and
    centred, so a laptop and an ultrawide monitor show the same page at the same
    size instead of stretching the cards across the whole window. On a tablet or
    a phone it still fills the screen. Every section follows, since the limit is
    on the panel itself.

  • A direct tunnel's carrier can be changed after it is built. Manage →
    Manage Tunnels → the tunnel → Edit → Carrier in the menu, and a Carrier menu
    on the panel's Edit form, ask the same questions Setup does (the SNI domain,
    the spoof screen) and keep every other setting. Both ends must match, and
    both screens say to change the other server too. It is how a tunnel left on
    a removed carrier (below) is brought back.

Removed

  • Clients older than v1.7.0 on tcp and tcpmux. Their handshake had no
    pool nonce, so the server admitted their pool connections by source address,
    and the newer client fell back to it after two closed attempts — a way for
    something on the path to make two current ends use it. Such a client is now
    refused, and told it is too old.

  • The udp and quic carriers of the direct tunnel. A direct tunnel now
    travels over pck, sni (pck with a TLS ClientHello), xdi or spoof — all raw
    sockets, Linux only, root on both servers. There is no migration: an [l3]
    tunnel that names udp or quic, or names no carrier at all (which meant
    udp), is refused at start, reload and backpack check with the reason and
    the way out, rather than moved onto another carrier behind the operator's
    back where the far end would not match. The menu, the health screen and the
    panel's card list it as unable to run and say why. Fix it with Edit →
    Carrier on both servers, or carrier = "pck" in the file. The reverse
    tunnel's own udp and quic transports are untouched.

  • paths, the udp carrier's multi-socket spread, with the carrier: the key
    is ignored, the panel's Sockets field and the setup link's socket count are
    gone, and so is the kharej's check for two tunnels sharing a UDP port, which
    only the udp carriers could hit. An older setup link that still carries the
    count decodes, and is refused for the carrier it names.

  • The [direct] stream tunnel. The layer-4 port forwarder over tcp,
    stealth, ws or wss, which Setup stopped building in v1.7.3, is gone with its
    engine. A file with a [direct] table is still recognised: it is listed with
    the reason, can be deleted, and is refused at start by name ("the [direct]
    stream tunnel (tcp, stealth, ws, wss) was removed in Backpack v2.0.0")
    instead of reading as a file with no tunnel in it. Rebuild it with Setup
    Iran / Setup Kharej → Direct on both servers. docs/config-reference.md now
    shows only the few keys still read from that table.

  • backpack short-https. The experimental fixed-backend relay from v1.9.0
    never reached the menu, the panel or the Connection Test. The command, its
    package and docs/short-https.md are gone; no tunnel used it.

  • /api/node/pair. The panel stopped calling it when the Add form became
    Iran-first: a tunnel is built here, the kharej end from its setup link, and
    the two are joined with Link to a server…. Linking, edits that reach both
    ends, and start/stop on both are unchanged. docs/managed-servers.md now
    describes that flow.

  • Dead code. Functions nothing called (UDPForward, ConnTestHost,
    LimitsLabel, the old 1 MB echo transfer) are gone, and helpers only tests
    used now live in the test files, out of the binary. Five screenshots no page
    linked and a stray error log are removed from the repository.

Fixed

  • Quieter logs for things that are not errors. The other end closing the
    control channel — it stopped, restarted or was killed — was an error on
    both ends ("failed to read from the control channel: EOF"), dozens of them
    in a soak of a healthy tunnel; it is now a warning that says what happened,
    and other read failures stay errors. A UDP pool socket or flow this end
    closed itself, a dial cancelled because the tunnel was stopping, and
    net/http's own "TLS handshake error" and "use of closed network connection"
    lines from the ws and wss listeners (one for every scanner that touched a
    public wss port, written outside the tunnel's log format) go to debug.

  • One busy port no longer takes a direct tunnel's other ports down. When
    a forwarded port could not be bound (something else on the Iran server held
    it), the whole port forwarder stopped and was rebuilt every 5 s — every
    other port of the tunnel, TCP and UDP, dropped and reopened every 5 s for as
    long as that one was held. Seen on a real Iran server during a soak: UDP at
    79% and connection latency past 600 ms on ports that were fine. A port that
    cannot be bound is now retried on its own every 5 s and logged, the others
    keep serving, and it comes up by itself once it is free (the same pass on
    that server: UDP 98.7%, latency 380 ms). The reverse transports already
    behaved this way.

  • A plain tcp or ws tunnel no longer refuses new connections on a busy
    link.
    Every user connection takes a pool connection, and its replacement
    is a TCP dial across the path. With the link full of transfers the path's
    queue drops a SYN now and then and that dial takes a second or three, and
    the client allowed only 32 idle-or-dialling pool connections in all (8 × 4):
    on the soak path (100 Mbit/s of bulk, 200 new connections a second) 59%
    got through, at a 3.1 s median first byte, on v1.9 as on v2. Now at least
    64 may be in flight, which serves all of them (median first byte 1.3 s on a
    pool of 8); a starved pool also grows by half its size at a time instead of
    one connection every ten seconds; and Turbo gives a new tcp / ws / wss
    tunnel a pool of 16, which serves them at 127 ms (Aggressive 32). Mux transports were not
    affected (their pool is sessions) and keep 8.

  • Direct PCK works on a server whose network device is smaller than 1402
    bytes.
    Every preset sends 1350-byte packets, 1402 on the wire, and the
    kernel refuses to send a frame larger than the device's MTU. On an Iran VPS
    whose eth0 is 1400 every full segment was refused ("message too large")
    and the sessions were lost one after another. Each end now fits its packets
    to its own device and logs it once; the other end needs no change (measured
    between that server and a kharej at 1500: all three presets, both ways).

  • A udp tunnel's server lets go of its control port before a reload goes
    on.
    Two goroutines closed the control listener. With an Accept still
    blocked on it, the second Close came back at once while the first was still
    waiting for that Accept, so the port was reported free while it was still
    listening. A reload or restart could then fail to bind its own control port
    and fall into the 2-second bind retry. On a busy machine this happened in
    about 1 stop in 15. Now one goroutine closes it and the server waits for
    that close. It turned up as a CI failure in the race step
    (TestStartDoesNotReturnUntilThePortsAreFree/udp).

  • xdi reaches its speed on a long path. Its raw ICMP socket kept the
    kernel's default buffer of about 200 KB: the preset's socket buffer never
    reached it. A loaded tunnel overflowed it, the kernel dropped the echoes, and
    the TCP inside slowed down. On a 70 ms test path that held xdi to 250 Mbit/s
    each way; it now carries 680–690. Reverse xdi gets the same buffer.

  • FEC over xdi and pck keeps batched reads and writes. The FEC layer hid
    the carrier's batch path, so every packet and every parity packet cost a
    syscall. It now batches, hands each rebuilt packet up where it was lost, and
    reuses its buffers: about 40% less CPU on the receiving end.

  • Connection Test measured direct tunnels too low. Through a TUN the
    test's own TCP crosses the path, and it ran on the system's congestion
    control (often cubic), while every reverse tunnel's sockets ask for BBR. On a
    lossy long path that held a direct tunnel to a fraction of what it carries.
    The test's sockets on both servers now ask for BBR too.

  • PCK's default preset is no longer held to a few hundred Mbit/s. Turbo's
    window ceiling was 1024 packets and its stream buffer 2 MiB, which is 280
    Mbit/s at 70 ms and 136 at 150 ms however fast the link. It is now 4096 and
    4 MiB (8 MiB session buffer): about 600 Mbit/s at 70 ms, 380–520 at 150 ms
    and 300–370 at 1% loss, and one connection carries twice what it did. On a
    link with a queue the window control holds the window where it was, and a
    100 Mbit/s path carries the same. Tunnels that did not fine-tune the windows
    get it on update.

  • Connection Test tests xDi + FEC beside xDi. On a path that loses
    packets the two can be an order of magnitude apart: at 1% loss each way on a
    70 ms test path, xDi carried about 30 Mbit/s and xDi + FEC about 560. When
    xDi + FEC is the one recommended, its FEC pair is part of the recommendation.

  • Connection Test speeds no longer depend on the order. The tunnel measured
    first had the path fresh; the last ran after minutes of load. A second pass
    now measures every tunnel again in reverse order, and each keeps its better
    figures. The rows lead with the maximum (the best second of both passes),
    with the sustained rate beside it.

  • Health check's Run again ran the checks twice. It also reopened the
    dialog, and the button called a function that does not exist. It now reloads
    the list once.

  • Editing a direct tunnel keeps the comments in its file. The menu's Edit and
    the panel's both wrote the tunnel's file again from scratch, so the header and
    every note a person had added were lost. They now patch the file as it is: a
    changed value is replaced in place (its trailing comment stays), a removed
    key's line goes, a new key is added after the key that precedes it, and
    unknown keys stay where they were. The menu's Edit also keeps unknown keys now,
    as the panel's already did. A file with inline tables, multi-line strings or
    arrays, or quoted keys is rewritten whole, as before.

  • The panel's trend badge never showed a percentage on a live card. The
    64 KiB floor that keeps a tiny baseline from printing "1486.3%" was written
    for byte totals, but the Live and 24-hour windows draw rates (bytes per
    second), so the first sample had to be 64 KiB/s — 512 kbit/s — before a
    number appeared, and a tunnel that moved 8 MB over twelve minutes never got
    there. The floor is now per unit: 64 KiB for the 7- and 30-day totals, 1 KiB/s
    for the rate windows. The arithmetic moved to js/lib/trend.js and has tests.

  • The panel opens on a sixth of what it downloaded. Its first load was 53
    files, 972 KB, 300 KB gzipped, over the route from Iran most panels are
    reached by. It is now 31 files, 175 KB, 53 KB gzipped:

    • every screen but the overview and the tunnels is fetched the first time it
      is visited — main.js imported all of them, the terminal and its 345 KB
      xterm.js among them, before drawing anything; xterm's stylesheet comes with
      the terminal too;
    • the files go out without their comments: they are the documentation of
      this front end and stay in the source, but a quarter of the CSS and a third
      of the JavaScript, gzipped, was comments every visit downloaded. Stripped
      once when a file is first served, with nothing renamed or rewritten
      (internal/webui/panelmin.go; a test checks every served file still parses
      and the panel's own tests pass against them);
    • 8 KB of CSS rules whose selectors name classes nothing uses any more;
    • preview text the screens always replaced: the Alerts dialog opened showing
      two invented alerts and a feed of events about tunnels that do not exist
      until its data arrived, and the Health dialog a list of invented checks.
      Two test-only helpers moved out of the package.
  • Every reverse transport can be added from the panel. The Add form offered
    eleven reverse transports; the CLI offers fourteen.

    • HTTPS (Naive, XHTTP, REALITY) is a fourth family on the Iran side. The
      panel builds the Iran end with the CLI wizard's own defaults: the installed
      helper, a generated user, password, UUID, path or key pair, and a private
      certificate for the address the panel was reached on. REALITY takes an
      optional cover; empty tries the suggested ones and keeps the first that
      passes a real check from this server. XHTTP asks for a TLS name when the
      panel is reached by IP. The kharej end is set up from the setup link, which
      already carried everything it needs; "Build both ends" refuses HTTPS by
      name before writing anything. Without the helpers it says how to install
      them (BP_HELPERS=naive,xray).
  • The Add form fits each transport, on both ends.

    • Settings a transport ignores are no longer offered on it: PROXY protocol
      where the engine does not support it (udp, ws, wss, HTTPS), "Forward UDP"
      on udp and HTTPS, zero-copy off plain TCP, the MSS clamp on the datagram
      transports, and the connection pool on the Iran side, which never opens
      one. The "iran only" chips are gone: the whole form is the Iran end.
    • The kharej's own settings are asked on the Iran side and travel in the
      setup link, so backpack link apply there needs nothing more: the address
      it dials (a domain behind a CDN, say), the CDN edge IP on the websocket
      transports (new link field eg), and this server's backup addresses. Only
      a link that carries an edge needs this build to read it.
  • The panel's text is short. About 170 hints, descriptions and dialog
    bodies across the screens were a sentence or three of explanation each; they
    are one short line now (the reasons stay in the source comments). The same
    goes for anything added from here on.

  • CI was red on every run since v1.9.0; each cause is fixed. Read from the
    Actions logs of all 31 runs since the v1.9.0 tag:

    • Cross-build and the release build: the ARMv5 cross compiler was
      installed with --no-install-recommends, which leaves out its C library
      (libc6-dev-armel-cross), so libpcap's configure said "C compiler cannot
      create executables". Both workflows install it now. The whole make release
      was rerun locally: seven static binaries.
    • Connection Test over an IPv6-only path: the step runs go test through
      sudo env, which dropped the cgo variables the libpcap action sets, so the
      build could not find pcap.h. They are passed through.
    • Managed HTTPS carriers: the withdrawn NaiveProxy pin (below).
    • Vulnerabilities: the toolchain and library updates (below).
    • Build and test: the packet-path budget gate failed in five runs with the
      path unchanged (3-8 µs to seal on the runner, 0.78 here) — packages run side
      by side and the heavy ones now run next to it. It is measured best of three
      beside a ChaCha20-Poly1305 calibration and scaled by it, and only counts
      allocations under coverage. And four tests that depended on timing or on
      the machine: the PCK datagram lane's (the first datagrams go by the stream
      until the server's verdict arrives — one on a fast machine, a dozen on the
      runner), QUIC over a 1280-byte path (a Path MTU probe after the handshake was
      counted as a failure; only the handshake's packets must fit), KCP's refusal
      reason (the server got 700 ms to bind; the dial now retries), and an ACME
      test whose background issuance wrote into its directory during cleanup (and
      contacted Let's Encrypt; it no longer starts one). Plus the two from the
      wizard test that wrote /etc/backpack and the GRE token check as root.
    • The v1.9.0 release run itself failed its tests: release.yml never made
      the /etc/backpack the configuration tests use, as ci.yml does. It does now.
    • actions/cache moves to v5 (Node 24; v4 ran on the deprecated Node 20), and
      softprops/action-gh-release to v3.0.4, pinned by commit as before.
    • Dependencies: gopacket 1.7.7 (a security release for decoding untrusted
      traffic), quic-go 0.65.0, gopsutil 4.26.10, x/crypto 0.59.0, x/net 0.62.0,
      x/sys 0.50.0 — the open Dependabot group update.
    • Three that failed after that push, each in one run of two:
      • Fuzz: FuzzParsePckFrame failed with "context deadline exceeded" and
        no failing input. That is a race in Go's own fuzz coordinator when a
        -fuzztime given in seconds runs out (one run in six locally). The
        budgets are now counts of inputs, which set no deadline, sized to what the
        seconds bought on a runner.
      • Managed HTTPS carriers over IPv6: the loopback Connection Test takes
        231–243 s on a runner and had a four-minute budget. It had six then;
        the second speed pass took it to 347–357 s and one run failed at 362 s,
        so it has nine now (step -timeout 11 m, job 25 m).
      • Build and test: the churn test's next client could prove itself ready
        through the previous client's mux session still winding down, then lose
        its transfer when that generation ended. It now waits until the stopped
        client has closed every connection to the tunnel port (read from
        /proc/net) before the next one starts. The first version of this probed
        the entry port instead, and the server holds a probe while it pairs it, so
        the probes counted as leaked open files on the tcp run under coverage.
  • The pinned NaiveProxy release had been withdrawn. v154.0.8037.49-4 has
    no assets on GitHub any more, so BP_HELPERS=naive bash install.sh failed on
    every server. The installer, the wizard's suggested path and the docs now pin
    v154.0.8037.49-5, with the digests GitHub publishes for it (amd64 and
    arm64); sing-box v1.14.2 and Xray v26.3.27 are unchanged and still verify.

  • Naive / HTTP2 is 20 times faster one way. The Naive client ran every
    pooled reverse connection as a stream of ONE HTTP/2 connection, so one
    flow-control window per round trip was the tunnel's speed: the Connection
    Test measured 22.5 Mbit/s down and 378 up on a 70 ms path between two
    namespaces. It now opens four (NaiveProxy's insecure-concurrency; new
    client.naive.connections, 1-16, unset = 4, 1 for a single connection):
    467 / 1056 on the same path. Without the tunnel the helper pair went from
    401 / 120 to 1073 / 475; at 1% loss and 100 Mbit/s, 2.1 to 9 Mbit/s.

  • XHTTP / TLS gives each pooled connection its own HTTP/2 connection.
    Xray's xmux maxConcurrency 1 on the outside client: the slower direction
    went from 518-599 to 713-864 Mbit/s in the Connection Test (two runs each),
    the other stayed 1140-1840. REALITY / Vision needed nothing: 2329 / 1411
    through the tunnel, with a TCP connection per pooled connection already.

  • A v2.0.0 end next to a v1.9.0 one no longer starves its own direction.
    The old end fills the bottleneck queue of its direction and never lets it
    drain, so the queue stood under every reading the new end's control took: its
    lowest round trip crept up with it, and the swing of a queue it does not
    drive was read as its own. A v2.0.0 kharej beside a v1.9.0 Iran was cut to its
    floor and carried 12.8-16.5 Mbit/s down where two v1.9.0 ends carry 47-48.
    Like Copa's competitive mode, the reverse transports' control now stops
    reading delay as its signal when its window sits at the floor and the round
    trip has not come near the low of the last two minutes for ten seconds; the
    window grows and only the local queue overflowing cuts it, until a reading is
    back near the low that held when the mode began. Measured, 300 s: that kharej
    54.6-55.9 down over four runs at 1% loss and 54.0 at 10% (reverse kcp 48.8
    beside 53.2 for two v1.9.0 ends), and two v2.0.0 ends never entered the mode
    (0 of 300 seconds, at 0, 1, 3 and 10% loss; their numbers unchanged). Still
    short: a v2.0.0 Iran beside a v1.9.0 kharej sends 23-34 Mbit/s up (two v1.9.0
    ends ~50) — its window swings rather than sitting at the floor, so the mode
    does not engage. Update both ends.

  • A data race between a new pooled KCP session and the idle governor. A
    session under the path control was handed to the governor, whose sweep runs on
    its own goroutine and reads the session's path control, before that field was
    set. Reverse pck had it from the start, but its tests need root and never ran
    under the race detector; with kcp under the same control the e2e suite caught
    it under -race (one run in three). The field is now set before the hand-over.

  • Built with Go 1.26.11, and two compression libraries updated.
    govulncheck found four vulnerabilities this code reaches: in the standard
    library net/http (fixed in 1.26.11) and crypto/x509 (1.26.10), and in
    github.com/andybalholm/brotli 1.0.6 and github.com/klauspost/compress
    1.18.0, which uTLS pulls in (now 1.2.7 and 1.20.2). After the update it
    reports none. The installer's build-from-source fallback pins 1.26.11 with
    the official checksums.

  • Tests no longer write a real tunnel into /etc/backpack. One wizard test
    answered the PCK kharej questions out of step, so "Create This Tunnel" took
    its default and wrote /etc/backpack/the-iran-token.toml wherever that
    directory is writable — as it is in CI — and two later tests found port 9000
    taken. A Connection Test test also counted the tokenless GRE case, offered
    only when the tests run as root, as a token leak. Both fixed; the whole
    manage package passes with a writable /etc. And a staticcheck finding
    (SA4000) in a health test.

  • A scheduled restart every 23 hours restarted twice in an hour. The timer
    counts hours from midnight UTC, as cron does, which is what keeps the two
    servers in step — so an interval that does not divide a day broke at
    midnight: every 7 hours fired at 00, 07, 14, 21 and 00 again three hours
    later, every 23 hours at 23:00 and 00:00. An interval under a day is now the
    largest that divides it (5 → 4, 7 → 6, 13-23 → 12), on both servers, and the
    screens show that interval. Checked with systemd-analyze calendar.

  • Connection Test said nothing about an old kharej. Next to a kharej on
    v1.9.0, everything passed but direct PCK and GRE, which read only "never
    carried traffic". Both are new in v2.0.0 (PCK's wire changed, GRE did not
    exist), and nothing on the wire says which release the kharej runs, so those
    two rows now add that a kharej older than v2.0.0 has to be updated. Checked
    both ways in two namespaces: v2.0.0 Iran with a v1.9.0 kharej, and v1.9.0 Iran
    with a v2.0.0 kharej; every other tunnel passed in both.

  • A pck carrier never came back after its network interface was deleted and
    created again
    — a veth, ppp or wg device recreated, a NIC replugged. Its
    sockets stay bound to the old interface index, which no longer exists: the
    receive socket never heard another packet, and every send failed with ENXIO,
    which KCP took for the end of its session. The carrier (reverse pck, and the
    sni direct carrier) now notices the interface is gone, reopens its sockets on
    the interface that comes back under the same name, and carries on without a
    restart; KCP sees only the packets lost in between. It waits for the interface
    as long as it takes, with no busy loop, and logs once when it is gone and once
    when it is back. The new interface must have the same address. A new test,
    TestACarrierReopensOnARecreatedInterface, deletes and recreates a veth under
    a live carrier.

  • A pck tunnel never came back after its network interface went down and up.
    The packet socket a pck carrier reads from reports ENETDOWN once when its
    interface goes down, and kcp-go's listener ends its read loop for good on the
    first error from the carrier — so a reverse pck server kept running but heard
    no client again. The same event failed the carrier's send (ENETDOWN on a
    packet socket, ENETUNREACH on the raw one, whose route goes with the link),
    which KCP reads as the end of the session. A reverse pck server now reads on
    through the error, waiting longer between repeats up to a second, and a send
    that fails because the path is down counts as a lost segment, as a full
    transmit queue already did. In a run with the Iran interface down for 10
    seconds the tunnel used to stay dead for the rest of the run; it now carries
    traffic again within a second of the link coming back. A new live test,
    TestReversePckOverARealPath, checks it across two namespaces.

  • Connection Test under-reported upload. The far end acknowledged every
    32 KB it received, so the upload stage spent much of its time waiting on its
    own acknowledgements and measured that rather than the tunnel. It now
    reports its running count every 5 ms, and the final count at the end; on a
    fast path upload figures rise accordingly (on loopback, four streams went
    from 25.6 to 50.5 Gb/s). The far end changed too, so a kharej on an older
    version still reports the old way.

  • Editing a direct tunnel in the web panel rewrote its file. The panel
    decoded the file and wrote it back out whole, which dropped its header and
    comments and added keys the file never had. It now writes the same file Edit
    in the menu does, and carries over any keys the engine does not know.

  • Smaller fixes. The MSS clamp is logged once per address family instead
    of once per chain. The panel and the kharej now give the same, correct
    length for the speed stage of the Connection Test (about 16–25 seconds per
    healthy tunnel), long transport names in its rows wrap instead of being cut,
    and a tunnel card's change badge no longer shows a percentage of a near-zero
    baseline.

  • A path outage during the MTU search could lower a tunnel's MTU for
    good.
    The search reads a lost probe as a size that does not fit, so a path
    that went dark for a few seconds partway through walked it down towards the
    floor — and a GRE link is never raised again. A result below the
    interface's current MTU is now checked against the smallest size and the
    current one first: if the smallest no longer crosses the path is down and
    nothing changes, and if the current one crosses the path never shrank. This
    applies to GRE and to the TUN carriers' probe.

  • The web panel. Typing an address over an open Edit dialog lands on that
    address instead of the overview. A tunnel still on the removed udp carrier
    shows "UDP (removed)" in its carrier menu instead of the raw name, and a
    refused carrier change reads "a tunnel on the xDi carrier cannot be changed
    onto the PCK carrier" instead of "a xDi tunnel".