From da00246fe88bf2ae0ecf3169a563d3e156ef9d3a Mon Sep 17 00:00:00 2001 From: Adrien Beraud Date: Sun, 18 Oct 2026 10:43:30 -0400 Subject: [PATCH] docs: describe the fragment size calculation --- docs/transport-crypto.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/transport-crypto.md b/docs/transport-crypto.md index f4a81472..403be689 100644 --- a/docs/transport-crypto.md +++ b/docs/transport-crypto.md @@ -258,7 +258,7 @@ The confirmation is lost when the session keys change: on epoch rotation, or whe **Recovery.** On the first retransmission of a request, the node forgets B's ephemeral key. The retry is therefore an Initial envelope, with our credential in a private network. This recovers when B no longer has the session or our authorization, for example after a restart. In public mode, a plaintext read-only request claiming B's ID is answered with an Initial envelope to B's known static key. The answer uses a transient node record: it does not reset B's existing ephemeral key, address or session. A restarted peer can read this answer and establish a new session. -When value data is fragmented for a node with a known key, fragments are reduced to `1280 − 199 = 1081` bytes, so that each packet still fits in the 1280-byte IPv6 minimum MTU. +Value data is fragmented so that each packet fits in the 1280-byte IPv6 minimum MTU: `1280 − 40 − 8 = 1232` bytes of UDP payload, less 48 bytes reserved for the msgpack framing of a fragment. Fragments carry `1184` bytes of value data, or `1184 − 199 = 985` bytes for a node with a known key, leaving room for the largest envelope overhead. ### 6.5 Receiving @@ -532,4 +532,4 @@ From the library, set `Config::transport` before starting: | Credential signature context | `"opendht-credential-v1"` | | Ephemeral key, token contexts | `"opendht-address-key-v1"`, `"opendht-address-token-v1"` | | Token size | 32 bytes | -| Encrypted value fragment size | 1081 bytes | +| Value fragment size | 1184 bytes, 985 for encrypted peers |