BW_UPLOAD — Group 0, Code 21

The caller sends N bytes of filler and the RAIDA, which is the only side that can see when the bytes actually arrive, times the second half and answers with the rate. This is how a client or a peer measures its upload rate to this RAIDA, NAT or not.

LIVE FLEET-WIDE since 16 October 2026

Both probe commands are dispatched on every RAIDA. Type 0 must be allowed on the node (allow_type0), which is the compiled default. Verified against the server source and a live probe of the fleet on 6 November 2026.

Quick reference

Command Group0 (Status)
Command Code21 (0x15)
Server functioncmd_bw_upload in bw_probe.c; admitted at the header by bw_upload_admit
Body layoutChallenge (16) + filler (N) + terminator (2), N = 64 KiB to 8 MiB
Request headerExtended length: bytes 22–23 = FF FF, real body length as 32-bit big-endian at bytes 10–13 (the same convention as QMail 6/75)
TransportTCP only
EncryptionType 0 only, no coin, no key
AuthenticationNone
Success responseStatus 250 with a 20-byte payload

Purpose and limits

The bandwidth probe lets any RAIDA or client time a real transfer against a RAIDA instead of trusting a figure the operator typed in or a third-party speed test. There is no authentication and no encryption: the request is a plain Type 0 frame carrying only the standard challenge, so a client behind NAT needs nothing but an outbound TCP connection. Each RAIDA also runs the probe itself, 5–15 minutes after boot and then about once a day, against up to three random peers per direction, and advertises the best rate rounded to two significant figures as upload_bps and download_bps in its DRD server record. Operator-claimed figures in the node’s configuration override the measurement.

Why timed transfers, not a public speed test

No third party sees the fleet’s or the clients’ addresses, no outside service can change its terms or endpoints, and NAT does not matter: an upload is timed by the receiving RAIDA, and a download by the caller, over the second half of the transfer so that TCP slow start is excluded.

What keeps it from being a free megabyte pump is TCP only (no UDP reflection) plus these limits, refused with 251 ERROR_SERVER_BUSY:

LimitValueScope
Requests6 per 10 minutesper source IP, both commands together
Download burst4 per 10 secondsnode-wide
Uploads in flight2node-wide; the slot is taken at the header, before the body is read
Bytes3 GiB per hournode-wide, per direction

Request

The 32-byte Type 0 header with the extended-length convention: byte 5 = 21, bytes 22–23 = FF FF as a sentinel, and the full body length (16 + N + 2) as a 32-bit big-endian value at bytes 10–13. The server checks the length and takes one of its two upload slots before allocating anything, so an oversized or over-limit declaration is refused at the header. Body:

OffsetSizeFieldDescription
0–1516Challenge12 random bytes followed by their big-endian CRC32.
16+NfillerAny bytes; use incompressible data so a compressing middlebox cannot flatter the result. N from 65,536 to 8,388,608.
16+N2Terminator3E 3E.

Response

OffsetSizeFieldDescription
0–78rate_bpsBig-endian bits per second over the second half of the body as it arrived at this RAIDA. 0 if the interval was too short to time.
8–114bytes_receivedBig-endian. N as received.
12–198elapsed_usBig-endian microseconds the second half took.

Status codes

CodeSymbolMeaning
250STATUS_SUCCESSMeasurement in the payload.
218ERROR_TCP_REQUIREDSent over UDP.
198ERROR_INVALID_PARAMETERN outside 64 KiB–8 MiB, or the header sentinel and length disagree.
251ERROR_SERVER_BUSYBoth upload slots are busy or another limit was hit. Try another RAIDA or later.
16ERROR_INVALID_PACKET_LENGTHBody length does not match the declared length.
34ERROR_INVALID_ENCRYPTIONThe node does not allow Type 0.

Common mistakes

Using the 16-bit length field

Bytes 22–23 must be the FF FF sentinel; the real length lives at bytes 10–13. A plain header with a 16-bit length cannot describe a 64 KiB body.

Timing it yourself

The sender’s clock stops when the last byte leaves its socket buffer, not when it arrives. Use the rate the RAIDA reports.