Raw shred feeds stick with plain UDP because Solana itself does: Turbine passes shreds between validators as UDP datagrams, each shred fits in one packet, and erasure coding recovers most losses without asking anyone to resend. TCP would make every shred wait behind any lost segment. The price is real: loss, no ordering, and firewall work.
Solana already made this choice#
The strongest argument for UDP is that the network you are reading from runs on it. In Agave, the retransmit stage that passes shreds along the Turbine tree sends them from plain UdpSockets, batched with sendmmsg. The current source also has an optional XDP sender for the same job, which is the kernel bypass route rather than a move away from datagrams. There is no connection, no handshake and no acknowledgement between a validator and the nodes it forwards to.
Solana did not pick UDP everywhere out of habit. Transactions sent to a leader go over QUIC: the Anza TPU docs describe them arriving in QUIC streams, which gives the leader a session with each sender. Block propagation stayed on datagrams, which tells you something. When the designers had a reason to want sessions, they added them. For spreading shreds fast to many peers, they did not.
A shred feed that forwards those packets over UDP keeps the same shape the data had on the way in. Wrapping them in a stream protocol adds a layer with its own behaviour, and that behaviour is mostly delay. That is the case for raw UDP in one paragraph. The rest of this post is the detail, and the bill.
One shred, one datagram#
Shreds were sized for this. The Solana SDK defines the largest packet payload as 1,232 bytes, computed in the source as 1,280, the smallest MTU IPv6 allows, less 40 bytes for the IPv6 header and 8 for a fragment header. Agave's shred code fixes the payload at 1,203 bytes for a data shred and 1,228 for a coding shred. Every shred fits in one datagram on any path that carries IPv6's minimum, with no IP fragmentation, which RFC 8085 tells UDP applications to avoid.
That gives a clean unit of loss. A lost datagram is exactly one lost shred, with its slot, index and FEC set in the header (Solana shreds, explained covers the header). The receiver knows precisely what is missing, and nothing else is damaged by the gap. Compare that with a byte stream, where a loss is a hole at some offset that the transport has to fill before anything after it means anything.
Nothing waits behind a lost packet#
This is the argument that settles it for latency-sensitive readers. TCP, as RFC 9293 puts it, gives applications a reliable, in-order byte stream. In-order is the problem. When one segment is lost, every byte after it sits in the receiver's kernel until the retransmission arrives, even though those bytes are already on your machine. That is head-of-line blocking, and the stall lasts at least one round trip to the sender, usually more while the loss is detected.
For a shred stream, the bytes stuck behind the hole are other shreds, often from other FEC sets or the next slot, that you could have used immediately. TCP holds them anyway, because it does not know they are independent.
QUIC improves this, and it is worth being precise about how much. RFC 9000 lists avoiding head-of-line blocking across streams as one of its benefits: a loss blocks only the streams with data in the lost packet. Within one stream, delivery is still ordered. A feed that put each shred on its own stream, or used the unreliable datagram extension in RFC 9221, would avoid the stall. A feed that sends everything down one ordered stream would not. HTTP/2, and so gRPC over it, is explicit that TCP head-of-line blocking is not addressed by that protocol.
No backpressure, in either direction#
Stream protocols have flow control. TCP's receive window tells the sender how much more it may send, and gRPC's flow control docs describe the framework waiting before it returns from a write when the receiver is slow. For a chat app that is courtesy. For a shared market data stream it is coupling: one slow reader can make the sender buffer, wait, or decide what to drop.
Plain UDP has none of that. The sender transmits at the rate the shreds arrive and never learns how any receiver is doing. Our UDP wire contract states it as a property, and we think it is the right one. A slow receiver drops its own packets and nobody else's, and the moment it catches up it is reading current shreds rather than a backlog of old ones. Old shreds are worth very little anyway.
The flip side is that the receiver owns the problem. If your loop stalls, you lose data, and nothing will resend it. That is why receiver tuning gets so much attention, and why we wrote separately about whether a cloud VPS can keep up.
Erasure coding does the retransmitting#
TCP retransmits because the transport has no other way to recover data. Shreds carry their own recovery. Leaders erasure-code each FEC set as 32 data shreds and 32 coding shreds, and any 32 of the 64 are enough to rebuild the missing data shreds; our FEC sets explainer walks through the arithmetic. Recovery is local math on packets you already have, with no round trip.
It is not a guarantee. The Anza Turbine docs say that when a shred group cannot be rebuilt, a validator falls back to repair, asking peers for what is missing. A feed subscriber has no repair path, so a set that loses more than half its shreds is simply incomplete. In practice that means keeping local loss low, which is a receiver problem, and detecting the rare gap honestly, which gap detection covers.
What plain UDP costs you#
The case above is strong, but it is not free, and pretending otherwise helps nobody.
Loss is final. RFC 768 promises neither delivery nor duplicate protection. Every queue between the sender and your read call can drop, and packet loss and jitter lists where.
No ordering. RFC 8085 says applications that need ordered delivery must restore it themselves. Shreds from two slots can interleave, so your code groups by slot and FEC set, not by arrival order.
No congestion control. The same RFC notes UDP has none built in. That is acceptable for a fixed-rate feed into a host sized for it, and a bad idea on a link you share with traffic you care about.
Firewalls and NAT. UDP has no connection for a stateful firewall to follow. An inbound feed needs an explicit rule, and behind NAT it needs a port forward, because a NAT only keeps a UDP mapping alive for traffic the inside started; RFC 4787 asks for mapping timers of at least two minutes, and many deployed boxes, RFC 8085 notes, use less. A destination with a public IPv4 address and an open port avoids all of this.
Fan-out is your job. One stream reaches one ip:port. If several bots need it, you copy it yourself; our post on fanning one destination out to many bots shows how.
Where QUIC and gRPC make more sense#
Some teams should not buy a raw UDP feed, and the reasons are good ones.
You cannot accept inbound UDP. A gRPC or QUIC client connects outward, so it works behind NAT, from a cloud function or through a corporate firewall. Several shred sellers also offer shreds over gRPC; the raw vs decoded comparison lists them with dated sources.
You want decoded data. A raw feed hands you packets and expects a decoder. A decoded stream hands you entries or transactions, and gRPC's guarantee of message ordering within a call is a real convenience when the messages are already assembled. The raw vs decoded comparison lists who sells which.
You need state, not shreds. Account balances and execution results come from a validator after replay, usually over Geyser gRPC; shreds vs Geyser gRPC sets the two side by side.
None of these is a worse design. They put the reassembly or the session on the provider's side and charge you some time for it. Plain UDP puts both on yours and charges you engineering instead. If you are still choosing, the feed protocol guide maps protocols to workloads. Nitride.xyz sells the raw UDP option only, from Frankfurt, for readers who decode their own shreds and want the packets with nothing decoded, reordered or buffered on the way.
Each plan has a free 2-hour trial, once per person. Email support@nitride.xyz with the IPv4 address and UDP port you want to test. We verify you receive on that address, then your 2 hours start.
Sources#
- Agave source: turbine/src/retransmit_stage.rs (shreds retransmitted from UdpSocket, or an XDP sender) (checked 2026-11-17)
- Solana SDK source: packet/src/lib.rs (PACKET_DATA_SIZE = 1280 - 40 - 8) (checked 2026-11-17)
- Agave source: ledger/src/shred.rs (payload sizes 1203 and 1228) (checked 2026-11-17)
- Agave source: shred/wire-format/src/constants.rs (32 data and 32 coding shreds per FEC set) (checked 2026-11-17)
- Anza docs: Turbine block propagation (shred groups, repair fallback) (checked 2026-11-17)
- Anza docs: TPU (transactions sent in QUIC streams) (checked 2026-11-17)
- RFC 768: User Datagram Protocol (checked 2026-11-17)
- RFC 9293: Transmission Control Protocol (reliable, in-order byte stream; receive window) (checked 2026-11-17)
- RFC 9000: QUIC, section 13 (head-of-line blocking across streams) and section 2.2 (ordered delivery within a stream) (checked 2026-11-17)
- RFC 9221: An Unreliable Datagram Extension to QUIC (checked 2026-11-17)
- RFC 9113: HTTP/2 (TCP head-of-line blocking is not addressed) (checked 2026-11-17)
- RFC 8085: UDP Usage Guidelines (no congestion control, ordering, NAT timeouts) (checked 2026-11-17)
- RFC 4787: NAT Behavioral Requirements for Unicast UDP (mapping timers, filtering) (checked 2026-11-17)
- gRPC docs: core concepts (message ordering within a call) (checked 2026-11-17)
- gRPC source: doc/PROTOCOL-HTTP2.md (gRPC carried over HTTP/2 framing) (checked 2026-11-17)
- gRPC docs: flow control (checked 2026-11-17)