Skip to content
Docs

Packet format

This page lets you recognize verification traffic, retain complete raw shred payloads, and validate service-level packet sizes.

Before you start

  • Understand that one UDP receive operation yields one datagram payload.
  • Have a receiver capable of retaining at least 1,228 payload bytes per datagram.
  • Accept service traffic only from 64.130.40.90.

Distinguish the two payload classes

shredstream.sh sends verification and stream datagrams over the same raw UDP delivery path. Both originate from ${SOURCE_IP} and target the customer-configured UDP port.

A verification payload begins with the literal string ${CHALLENGE_PREFIX}. A destination ID and token follow that prefix. The field delimiter, line structure, token length, token alphabet, and complete encoding are not currently specified. Detect the fixed prefix and display the complete payload for the operator.

Stream datagrams carry raw Solana shred data. The product contract does not document an added service envelope. Do not remove a prefix, length word, timestamp, destination ID, or sequence number from a stream payload based on an invented wrapper.

Enforce the documented maximum

The maximum documented packet payload is ${WIRE.maxPacketBytes} bytes. Allocate at least that much per receive. A larger application buffer is valid and can make truncation handling clearer.

The measured mean packet size is ${FEED.meanPacketBytes} bytes. Mean does not mean fixed. Do not require every datagram to equal ${FEED.meanPacketBytes} bytes. Do not pad a shorter payload or truncate a longer payload to the mean.

Reject or quarantine a datagram from the documented source when its received payload length exceeds ${WIRE.maxPacketBytes}. Record the UTC timestamp, source tuple, destination port, and observed byte count. Confirm that the receive API reports payload length rather than an IP-frame length before escalating.

Minimum packet size, allowed size distribution, and behavior for a zero-length UDP datagram are not currently specified. Avoid inventing a lower bound in the delivery layer.

Preserve the payload exactly

Treat the UDP payload as binary. Do not decode stream traffic as UTF-8, normalize bytes, strip trailing zeros, convert line endings, or append a string terminator. Copy the exact byte range returned by the receive API.

The verification payload is the exception that an activation tool may display as text. Use a decoding mode that preserves visibility of invalid bytes rather than crashing. A valid challenge begins with the documented ASCII-compatible prefix, but the complete encoding remains not currently specified.

Store a separate length with each application buffer. Some languages expose a larger reusable array than the actual datagram. Pass only the received byte count to downstream processing.

Avoid IP and UDP header confusion

The service packet size documented here refers to the payload delivered by the UDP socket. Packet-capture tools can display additional IP and UDP headers. A normal IPv4 header without options adds 20 bytes, and a UDP header adds 8 bytes. A ${WIRE.maxPacketBytes} byte UDP payload therefore produces 1,256 IP bytes before link-layer overhead under those conditions.

IPv4 options, IPv6, encapsulation, VPNs, and tunnels can change overhead. Supported delivery address families are not currently specified. Measure the actual path when configuring MTU.

Do not compare a packet-capture frame length directly with ${WIRE.maxPacketBytes} without subtracting the observed link, IP, and UDP headers. Prefer the application receive length when validating the service payload.

Use a safe inspection program

The following Python command captures one stream datagram from the fixed source, prints its length, and prints a hexadecimal prefix without altering the bytes. Replace 9000 with the verified port and stop any process already bound there.

bash

python3 - <<'PY'
import socket

PORT = 9000
EXPECTED_SOURCE = "64.130.40.90"
MAX_PACKET_BYTES = 1228

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("0.0.0.0", PORT))

while True:
    payload, peer = sock.recvfrom(65535)
    if not peer[0] == EXPECTED_SOURCE:
        continue
    print(f"source={peer[0]}:{peer[1]}")
    print(f"payload_bytes={len(payload)}")
    print(f"prefix_hex={payload[:32].hex()}")
    if len(payload) > MAX_PACKET_BYTES:
        raise SystemExit("packet exceeds documented maximum")
    break
PY

This program does not identify a shred variant or validate Solana fields. It establishes source, boundary, byte count, and an immutable diagnostic prefix.

Keep service validation separate from shred decoding

The delivery layer can validate the source IP, destination port, complete datagram boundary, and maximum length. The downstream protocol layer can decode Solana shred fields. Do not merge these responsibilities into an error message that says only invalid packet.

Use distinct errors such as unexpected source IP, UDP payload truncated, service payload exceeds 1228 bytes, and shred decoder rejected payload. This distinction identifies whether the fault lies in routing, buffer sizing, the documented wire boundary, or protocol parsing.

The exact shred header layout, data and coding variants, signature verification process, recovery-set rules, and network-upgrade behavior are not currently specified in this product source. Consult an authoritative Solana protocol implementation selected by your team before decoding.

Account for UDP behavior

A correct payload can arrive late, arrive before an earlier payload, or never arrive. Format validation must not turn arrival order into a validity condition. The service provides no ordering or retransmission.

A duplicate-delivery guarantee is not currently specified. Design downstream processing to identify or tolerate repeated protocol content according to the shred format your team implements.

Backpressure is unavailable. Avoid expensive parsing, disk writes, or text logs inside the socket receive loop. Copy the payload and hand it to bounded downstream work.

Record actionable metrics

Count datagrams by received payload length, source address, destination port, and validation result. Count truncation signals separately from protocol-decoder failures. Record kernel UDP receive errors and application queue drops.

Do not log complete raw packets by default. The product does not specify a logging requirement, retention policy, or payload sensitivity classification. Use bounded samples when debugging and control access under your own policy.

Parameters

NameTypeDefaultNotes
verification prefixliteral byte prefixSHRED-FANOUT-VERIFY/1Identifies the one-time challenge payload before its destination ID and token.
maximum packet payloadbytes1228Allocate at least this many bytes and flag larger accepted service payloads.
mean packet payloadmeasured bytes1216Capacity observation, not a fixed valid length.
stream payload schemabinary formatnot currently specifiedNo detailed Solana shred layout is defined in the product contract.

When it goes wrong

A receive call reports truncation. Example error: `UDP payload truncated`.

Cause. The supplied receive buffer cannot hold the complete datagram up to 1228 bytes.

Fix. Use a buffer of at least 1228 bytes and honor the API's returned byte count and truncation flag.

A valid-size packet is rejected. Example error: `expected 1216 bytes, received 1203`.

Cause. The decoder treats the 1216 byte measured mean as a fixed packet length.

Fix. Accept service payload lengths up to 1228 and validate exact structure in the selected shred decoder.

Stream data fails text decoding. Example error: `UnicodeDecodeError: invalid start byte`.

Cause. The receiver treats binary shred payloads as text.

Fix. Keep stream datagrams as bytes and decode only a verification payload identified by its literal prefix.

Questions

Is every packet 1,216 bytes?
No. ${FEED.meanPacketBytes} bytes is the observed mean, not a fixed length. The documented maximum is ${WIRE.maxPacketBytes} bytes. Retain the exact byte count returned by the UDP receive call, avoid padding or trimming, and let the selected Solana shred parser decide whether the binary structure is valid.
Does shredstream.sh add a packet header?
The documented stream is raw UDP shred delivery, and no added service envelope is currently specified. Pass the complete UDP payload to downstream shred processing. The verification datagram is distinct because it begins with the documented challenge prefix and then carries a destination ID and token.
Can I parse every packet as text?
No. Stream payloads are binary raw shred data. Keep them as bytes. An activation tool may display the verification datagram because its payload begins with a literal text prefix, but the complete encoding after that prefix is not currently specified. Use tolerant display logic only for the challenge.