The UDP wire contract
What our UDP delivery promises, what it does not, and what that means for the receiver you build.
The contract at a glance#
| Property | What you can rely on |
|---|---|
| Transport | UDP over IPv4, to the one ip:port you registered for the plan |
| Origin | Frankfurt, Germany, for both plans |
| Unit | One shred per datagram, data and coding shreds alike |
| Size | Never more than 1,228 bytes of UDP payload |
| Content | The shred bytes as broadcast: not decoded, not merged, not rewritten |
| Order | Not preserved. Shreds from one slot can arrive interleaved with another's |
| Retransmission | None. A datagram your host drops is not sent again |
| Backpressure | None. We do not slow down if your receiver falls behind |
| Rate | Follows Solana's own activity; plan for peaks well above the average |
| Duplicates | Rare, but UDP permits them; key on slot, index and shred type if it matters |
Everything below follows from that table.
What does each datagram contain?#
A single shred, starting with its 83-byte common header: a 64-byte signature, one variant byte, then the slot (u64), index (u32), shred version (u16) and FEC set index (u32), all little-endian. A data or coding header follows, then the payload. Bytes 0 to 63 are binary, so a real shred never looks like text.
The variant byte says whether the shred carries data or erasure-coding parity, and describes its Merkle proof. Formats evolve with Agave releases, so production code should parse shreds with the library from the release the network runs. The Rust receiver has a field-by-field table and a short parser for commissioning.
What arrives before the shreds?#
One datagram that is not a shred: the verification token. When you register a destination, after paying or for a trial, we send a short text datagram with a one-time token to it. Your receiver should print any datagram made only of printable characters, so you can read the token and reply to support with it. The receivers in these docs all do. Delivery starts after we confirm the token; buy and activate has the full sequence.
Which address do datagrams come from?#
The verification datagram comes from our server. Support gives you the numeric address only once delivery is active, so keep the port reachable from the internet until then. Once delivery is active, support can give you the stream's source address, and you can limit your firewall to it. The rules for ufw and nftables are on command-line checks.
Why does none of this get resent?#
Solana itself sends shreds over UDP, and so do we, unchanged. There is no session to retransmit within and no acknowledgement to wait for, which is part of why shreds arrive early. The cost is that loss is final at the transport level. Two things soften it: coding shreds let your decoder rebuild many missing data shreds (see FEC sets), and a well-tuned receiver keeps local loss close to zero. Why serious Solana feeds still use plain UDP argues the trade in full.
What does my receiver need?#
Build for the worst second, not the average one:
- A large socket buffer. Ask for several megabytes with
SO_RCVBUF, and raisenet.core.rmem_maxso the kernel allows it. On Linux the kernel doubles the value you request for its own accounting, so oncermem_maxallows it, a request of 8 MiB reads back as 16 MiB. - A receive loop that only receives. Read, timestamp, hand the bytes to another thread. Decode, log and print elsewhere.
- Batched reads.
recvmmsgpulls many datagrams per system call. - A drop counter you watch.
UdpRcvbufErrorsrises when the socket buffer overflows; command-line checks shows how to read it.
sudo sysctl -w net.core.rmem_max=67108864
That sysctl lasts until reboot; put it in /etc/sysctl.d/ to keep it. The quickstart has a receiver to test with before you build your own.
Sources#
- Agave source: ledger/src/shred.rs (shred header and variants) (checked 2026-11-17)
- Linux man page udp(7) (checked 2026-11-17)