| Internet-Draft | NLTP v1 | November 2026 |
| Bains | Expires 20 May 2027 | [Page] |
This document specifies the NeckLink Transport Protocol (NLTP), a lightweight, loss-healing, forward-secret transport protocol designed for microcontrollers, autonomous sensors, and edge gateways operating over lossy wireless links (including IEEE 802.11 vendor action frames such as ESP-NOW v1 and v2) and Carrier-Grade NAT (CGNAT) UDP paths. NLTP combines systematic Galois Field GF(2^8) algebraic Cauchy erasure coding with a single-round-trip (1-RTT) X25519 and pre-shared key (PSK) session handshake, ChaCha20-Poly1305 authenticated encryption with associated data (AEAD), a 512-packet sliding anti-replay window, optional pre-encryption zero-heap LZ4 block compression, integer delivery-rate pacing, and a confirmed out-of-line reflex channel that eliminates head-of-line (HOL) blocking for urgent actuator commands. The entire protocol executes with zero dynamic heap allocation and zero floating-point operations, fitting within 4,760 octets of static RAM in transmit-plus-reflex sensor configurations.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 20 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
Field telemetry, marine buoys, industrial actuators, and wireless microcontroller meshes routinely operate over links suffering 10% to 35% packet loss, asymmetric Carrier-Grade NATs (CGNATs), and strict Maximum Transmission Unit (MTU) ceilings such as 250 octets on legacy ESP-NOW v1 or 1,470 octets on ESP-NOW v2. Traditional stream transports stall on retransmission timeouts when bursts of packets are lost, suffer head-of-line (HOL) blocking when urgent control messages queue behind bulk transfers, and exceed the SRAM and Flash budgets of 32-bit microcontrollers lacking floating-point units or heap allocators.¶
The NeckLink Transport Protocol (NLTP) addresses these constraints through six integrated mechanisms:¶
"NL"
(0x4E 0x4C) and traverses UDP sockets, zero-knowledge UDP
relays, and raw IEEE 802.11 vendor action frames without protocol
translation.¶
k = 8
systematic data shards accompanied by proactive and reactive Cauchy
parity shards over GF(2^8), healing lost packets in flight
and verifying the reassembled object with [FIPS180-4]
SHA-256.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Unless explicitly noted otherwise (such as network-order attributes
in [RFC5389] STUN messages), all multi-octet integer
fields in NLTP headers, nonces, and payloads are encoded in unsigned
little-endian byte order, denoted LE16(x),
LE32(x), and LE64(x). Concatenation of byte
sequences is denoted by ||, bitwise exclusive-OR by
^, and bitwise OR by |.¶
Every NLTP datagram starts with a 4-octet prefix:¶
pkt[0..1]): Fixed ASCII octets
0x4E ('N') and 0x4C ('L').
Receivers MUST silently discard frames that do not
begin with 0x4E 0x4C.¶
pkt[2]): The upper
4-bit nibble encodes the wire framing version
(version = pkt[2] >> 4), and the lower 4-bit
nibble encodes the packet type
(pkt_type = pkt[2] & 0x0F). Unencrypted frames use
NLTP_VERSION = 1. Encrypted frames (including handshake
frames) use NLTP_SESSION_VERSION = 2.¶
pkt[3]): Bit 7 (0x80,
NLTP_FLAG_ENCRYPTED) selects between the 16-octet
unencrypted header (0) and the 20-octet encrypted AEAD
header (1). Bits 6..0 (0x7F) carry
type-specific flags: 0x01 indicates metadata
receipt confirmation in PROPRIOCEPTIVE_ACK,
0x02 marks extended ACK rate trailers and reliable
reflex frames, and 0x40 (FLAG_LZ4) is reserved
for inline LZ4 stream signaling.¶
When NLTP_FLAG_ENCRYPTED (0x80) is clear, the
frame consists of a 16-octet header followed by N >= 0
payload octets:¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic 'N' | Magic 'L' | Ver=1 | Type |0| Flags | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | conn_id (LE32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | crc32 (LE32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ts_ms (LE32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload (0..N octets) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
conn_id (4 octets, LE32):conn_id | 1) on initialization to guarantee a non-zero
identifier.¶
crc32 (4 octets, LE32):0xEDB88320, initial value 0xFFFFFFFF, final XOR
0xFFFFFFFF) computed over the 16-octet header with
octets 8..11 set to 0x00000000, immediately
followed by payload[0..N-1]. Unencrypted endpoints
MUST discard any frame whose computed CRC-32 does
not match crc32.¶
ts_ms (4 octets, LE32):
When an endpoint is configured with a pre-shared key, all
unencrypted frames and all frames with version != 2
MUST be rejected prior to state mutation. An
authenticated encrypted frame consists of a 20-octet cleartext
Additional Authenticated Data (AAD) header, N >= 0
octets of ChaCha20 ciphertext, and a 16-octet Poly1305 tag
(minimum wire length 36 octets):¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic 'N' | Magic 'L' | Ver=2 | Type |1| Flags | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | conn_id (LE32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + seq64 (LE64) + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ts_ms (LE32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ciphertext (0..N octets) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Poly1305 Tag (16 B) + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
AEAD sealing and opening follow [RFC8439] Section 2.8 with the following deterministic parameters:¶
12 octets):
nonce12 = LE32(conn_id) || LE64(seq64).¶
20 octets): The exact cleartext
header pkt[0..19]. Modifying any header bit (including
version_type, flags, conn_id,
seq64, or ts_ms) invalidates the Poly1305 tag.¶
0
generates the 32-octet one-time Poly1305 key; plaintext
encryption starts at ChaCha20 block counter 1.¶
pkt[20+N..35+N] in
constant time before updating the anti-replay
bitmap or writing any decrypted bytes to memory.¶
Table 1 defines all NLTP packet types encoded
in the lower 4 bits of pkt[2].¶
| Hex | Symbolic Name | Summary |
|---|---|---|
0x01
|
PT_DATA_SHARD
|
Systematic data shard (idx < k) |
0x02
|
PT_CRYPTIC_PARITY
|
GF(2^8) Cauchy repair shard (idx >= k) |
0x03
|
PT_PROPRIOCEPTIVE_ACK
|
Cumulative base, per-generation DOF need, and rate trailer |
0x04
|
PT_STREAM_META
|
UTF-8 JSON stream descriptor (size, gens, SHA-256, LZ4) |
0x05
|
PT_STREAM_FIN_ACK
|
End-of-stream completion and SHA-256 verification status |
0x06
|
PT_REFLEX_MSG
|
Out-of-line reliable low-latency reflex message |
0x07
|
PT_NEURAL_STATE
|
Unreliable high-rate state telemetry vector |
0x08
|
PT_PING
|
4-octet timestamp probe for RTT, keepalive, and NAT punch |
0x09
|
PT_PONG
|
4-octet echo reply to PT_PING
|
0x0A
|
PT_REFLEX_ACK
|
4-octet acknowledgement of PT_REFLEX_MSG
|
0x0B
|
PT_HELLO
|
Initiator 1-RTT X25519+PSK handshake message (84 B wire) |
0x0C
|
PT_HELLO_ACK
|
Responder 1-RTT X25519+PSK handshake reply (100 B wire) |
0x0D
|
PT_NO_SESSION
|
Rate-limited restart hint echoing peer conn_id/seq64
|
Both peers share a 32-octet long-term symmetric key K.
When configured from a human-readable string psk,
leading and trailing ASCII whitespace (' ', '\t',
'\r', '\n') is stripped. If the trimmed string
has length 43 or 44 characters and decodes via URL-safe Base64 to
exactly 32 octets, those 32 octets form K; otherwise:¶
K = SHA-256("NLTP-v1-PASSPHRASE:" || trim(psk))
¶
Before sealing any session data frame, an initiator ('i')
with connection ID cid_i generates a fresh 16-octet random
nonce n_i and a 32-octet random scalar sk_i,
computes pk_i = X25519(sk_i, 9) per
[RFC7748], and transmits PT_HELLO
(0x0B) sealed under K at wire version 2
using a random odd 64-bit sequence number
(seq64 = rand64() | 1):¶
Initiator (cid_i) Responder (cid_r)
----------------- -----------------
sk_i, n_i <-- CSPRNG
pk_i = X25519(sk_i, 9)
PT_HELLO (48 B pt / 84 B wire)
AEAD_K(n_i || pk_i)
--------------------------------->
sk_r, n_r <-- CSPRNG
pk_r = X25519(sk_r, 9)
dh = X25519(sk_r, pk_i)
verify dh != 0^32
derive (k_i2r, k_r2i)
wipe(sk_r, dh)
PT_HELLO_ACK (64 B pt / 100 B wire)
AEAD_K(n_i || n_r || pk_r)
<---------------------------------
verify n_i matches pending HELLO
dh = X25519(sk_i, pk_r)
verify dh != 0^32
derive (k_i2r, k_r2i)
wipe(sk_i, dh)
Session Frames (Ver=2, seq64=1..)
AEAD_{k_i2r}(...) / AEAD_{k_r2i}(...)
<================================>
Both peers MUST check whether the 32-octet X25519
shared secret dh equals the all-zero byte string
(0x00^32) as specified in [RFC7748] Section
6.1, and MUST abort handshake processing if so.
Directional 256-bit AEAD keys are derived via
[RFC2104] HMAC-SHA-256 over an 87-octet transcript:¶
prk = HMAC-SHA256(K, "NLTP-1.5-X25519" || dh || n_i || n_r
|| LE32(cid_i) || LE32(cid_r))
k_i2r = HMAC-SHA256(prk, "i2r")
k_r2i = HMAC-SHA256(prk, "r2i")
¶
The initiator transmits with k_tx = k_i2r and receives
with k_rx = k_r2i; the responder transmits with
k_tx = k_r2i and receives with k_rx = k_i2r.
Ephemeral scalars (sk_i, sk_r), dh, and
prk MUST be zeroized immediately upon key
derivation.¶
HELLO (nonce
pend_n_i) receives a valid PT_HELLO carrying
nonce n_i, it compares the 16-octet nonces
lexicographically. If pend_n_i < n_i, its own
HELLO wins and the incoming HELLO is ignored;
otherwise it cancels its pending HELLO, wipes
pend_sk_i, and responds as 'r'.¶
SESS_TAKEOVER_MS =
1000): Each endpoint maintains two session slots:
live sess[0] and candidate sess[1]. If
sess[0] has received authenticated traffic within the
preceding 1,000 ms, a newly answered PT_HELLO is
installed into sess[1] and promoted to sess[0]
only after a subsequent data/control frame authenticates under
sess[1].k_rx. Retransmitted identical PT_HELLO
frames replay the cached 100-octet HELLO_ACK.¶
PT_NO_SESSION (0x0D) Restart Hint:
When an encrypted endpoint receives a version-2 data frame for an
unknown peer_cid (e.g., after an MCU reboot), it
MAY emit a 36-octet unauthenticated
PT_NO_SESSION hint at most once per
HINT_INTERVAL_MS = 250 ms containing a 20-octet header
(seq64 = 0) and 16-octet payload
LE32(peer_cid) || LE64(peer_seq) || LE32(0). The
recipient initiates a fresh PT_HELLO only if it has an
active session, no handshake is already pending, the echoed
peer_cid equals its own conn_id, and
0 < peer_seq <= sess[0].tx_seq.¶
Each established session direction initializes tx_seq = 0
(pre-incremented to 1 on the first frame) and a receive
replay window (highest_seq = 0, bitmap[0..7] = 0) modeled on
[RFC6479] covering NLTP_REPLAY_WINDOW_BITS =
512 sequence numbers.¶
seq64 == 0 MUST always be
rejected.¶
seq64 > highest_seq, the packet is eligible. Upon
AEAD tag verification, the 512-bit bitmap shifts left by
seq64 - highest_seq bits (clearing all words if the shift
is >= 512), sets bit 0, and updates
highest_seq = seq64.¶
seq64 <= highest_seq, let
diff = highest_seq - seq64. If diff >= 512, or
if bit (diff & 63) of bitmap[diff >> 6]
is already 1, the packet MUST be rejected
as stale or replayed. Otherwise, upon AEAD tag verification, that
bit is set to 1.¶
Bulk transfers slice the wire buffer into generations of up to
NLTP_DEFAULT_GEN_K = 8 systematic rows. Arithmetic operates
over the binary extension field GF(2^8) modulo the
irreducible polynomial x^8 + x^4 + x^3 + x^2 + 1
(0x11D). Multiplicative inversion computes
inv(a) = a^254 in GF(2^8) with inv(0) = 0.¶
For a generation of k (2 <= k <= 8)
systematic rows S[0..k-1] and parity offset
p_off = idx - k in 0..191, the Cauchy encoding
vector C[p_off, 0..k-1] uses disjoint element sets:¶
x_r = 64 + (p_off % 192) /* x_r in [64..255] */
y_c = c & 0x3F /* y_c in [0..63] */
C[p_off, c] = inv_GF256(x_r ^ y_c)
ParityRow[p_off] = sum_{c=0}^{k-1} GF256_mul(C[p_off, c], S[c])
¶
Because x_r >= 64 and y_c < 64,
(x_r ^ y_c) >= 64 > 0 holds for all (r, c),
guaranteeing every square submatrix of the systematic generator
matrix [I_k | C^T] is invertible (Maximum Distance Separable
property). Any k distinct shards (systematic or parity)
suffice to reconstruct the generation via incremental Gauss-Jordan
elimination. When k == 1, ParityRow[p_off] equals
S[0] verbatim.¶
When sending compressible payloads (len >= 32 octets), an
endpoint MAY compress the raw payload using the
standard [LZ4] raw block format prior to generation
slicing and AEAD encryption. If the compressed output is strictly
smaller than the input, PT_STREAM_META includes
"codec":"lz4" and "raw_bytes":len, while
"total_bytes" carries the compressed byte count and
"sha256" carries the SHA-256 digest of the original
uncompressed payload.¶
Constrained receivers perform zero-heap overlap-safe in-place
decompression inside a single receive buffer buf[0..buf_cap-1]
whenever buf_cap >= raw_bytes + (comp_len >> 8) + 32
by shifting the reassembled compressed block to
buf[buf_cap - comp_len .. buf_cap - 1] and enforcing
dp + match_len <= sp and offset <= dp before
every literal and match copy.¶
Urgent actuator or telemetry-trigger commands use
PT_REFLEX_MSG (0x06, flags = 0x02) with
payload LE32(reflex_seq) || LE16(msg_len) ||
msg[0..msg_len-1] (0 <= msg_len <= 192). Reflex
frames bypass the bulk congestion window and rate pacer, transmit
twice back-to-back on session readiness for immediate loss
resilience, and retransmit with 1.5x exponential backoff (45..250 ms
up to a 10,000 ms deadline) until acknowledged by a 4-octet
PT_REFLEX_ACK (0x0A, flags = 0x02)
carrying LE32(reflex_seq). Receivers deduplicate incoming
reflexes using a bounded (peer_cid, reflex_seq) ring buffer.¶
For endpoints behind symmetric CGNATs that cannot complete direct
[RFC5389] STUN hole punching, NLTP defines an optional
19-octet zero-knowledge UDP relay envelope:
"NR" || u8(cmd) || room_tag[0..15] || inner_nltp_pkt, where
cmd is 0x01 (DATA), 0x02
(REGISTER), or 0x03 (REG_ACK), and
room_tag = SHA-256("NLTP-RELAY-ROOM:" || trim(room))[0..15].
Because the inner NLTP v2 frame remains end-to-end encrypted and
authenticated under session keys derived from K, the relay
hub learns neither room names nor payload contents.¶
This document has no IANA actions. NLTP operates over
application-configured UDP ports and IEEE 802.11 vendor-specific
action frames identified by the "NL" (0x4E 0x4C)
magic prefix.¶
K after a session has
terminated does not reveal past session keys (k_i2r,
k_r2i) because ephemeral X25519 scalars (sk_i,
sk_r) and Diffie-Hellman outputs (dh) are wiped
immediately after derivation. However, a passive attacker who
already possesses K at handshake time can impersonate a
peer; deployments SHOULD provision high-entropy
256-bit random keys rather than low-entropy passphrases.¶
seq64 = 1, 2, ...)
under fresh, direction-separated 256-bit keys (k_i2r !=
k_r2i), preventing nonce reuse across up to 2^64 - 1 frames
per session. Handshake frames (PT_HELLO,
PT_HELLO_ACK) sealed directly under K combine a
random 31-bit conn_id | 1 with a fresh 63-bit random
seq64 | 1, providing 94 bits of CSPRNG nonce entropy per
handshake frame; endpoints MUST refuse encrypted
operation if no cryptographic random source is available.¶
highest_seq, and transport adapters
update peer network/MAC addresses only after valid_rx
increments on cryptographic authentication.¶
dp + match_len <= sp,
dp + match_len <= expected_raw_len, and end-to-end
SHA-256 digests strictly after AEAD authentication, preventing
unauthenticated memory exhaustion or buffer overflows on zero-heap
microcontrollers.¶
Given the [RFC7748] Section 6.1 shared secret
dh, 32-octet PSK K = 1011..2f, initiator nonce
n_i = 0102..10, responder nonce n_r = 2122..30,
cid_i = 0x11223345, and cid_r = 0x55667789:¶
K = 101112131415161718191a1b1c1d1e1f
202122232425262728292a2b2c2d2e2f
dh = 4a5d9d5ba4ce2de1728e3bf480350f25
e07e21c947d19e3376f09b3c1e161742
n_i = 0102030405060708090a0b0c0d0e0f10
n_r = 2122232425262728292a2b2c2d2e2f30
cid_i = 0x11223345 (LE32: 45332211)
cid_r = 0x55667789 (LE32: 89776655)
prk = 6306595ae52f5df950e3ebdaa2d464fe
047051fa0e38b54075e378f83c7c17e2
k_i2r = 9b2408a16c17371feff864059f2c4f55
6d85d56f88592e61fe23f906e45f91fa
k_r2i = 99494825a27dd99ddb4f57a236d4b620
85656f0beedd06ec3255837b35f625ec
¶
Sealing a 4-octet PT_PING (0x08) payload
LE32(1000) = e8030000 under k_i2r above with
version = 2, flags = 0x80,
conn_id = 0x11223345, seq64 = 1, and
ts_ms = 1000 yields:¶
AAD Header (20 B): 4e4c2880 45332211 0100000000000000 e8030000
Nonce (12 B) : 45332211 0100000000000000
Ciphertext (4 B) : 9dc0f833
Poly1305 Tag(16B): 4ee50dfb b2a72a34 76367815 995fb029
Full Wire (40 B) : 4e4c2880453322110100000000000000e8030000
9dc0f8334ee50dfbb2a72a3476367815995fb029
¶
For k = 8 systematic columns over 0x11D, the
first two repair rows (parity_offset = 0 and
parity_offset = 1) are:¶
parity_offset = 0 (x_0 = 64): 36 5f f8 d5 92 4e a6 04 parity_offset = 1 (x_1 = 65): 5f 36 d5 f8 4e 92 04 a6¶