Skip to content

docs: add SVS v4 specification - #23

Draft
Taranum01 wants to merge 1 commit into
named-data:mainfrom
Taranum01:svs-v4-spec
Draft

docs: add SVS v4 specification#23
Taranum01 wants to merge 1 commit into
named-data:mainfrom
Taranum01:svs-v4-spec

Conversation

@Taranum01

Copy link
Copy Markdown

This PR adds the SVS v4 wire-format specification as Specification-v4.md, alongside the existing v3 Specification.md.

Summary

SVS v4 extends the v3 wire format to support large sync groups by introducing:

  • A 32-byte SHA-256 membership hash (mhash, TLV 0xCB) carried in every Sync Data.
  • A wire-level replacement of the v3 VectorType discriminator with three distinct TLVs:
    • FullStateVector (0xCD) — direct form carrying the complete State Vector.
    • PartialStateVector (0xCE) — direct form carrying a publication-time subset, used when the encoded FULL exceeds SyncVectorThreshold.
    • SvsDataRef (0x07) — publish-only form pointing to a retrievable full-vector Data.
  • A new publish + pull recovery mode triggered by mhash mismatch or when the local FULL exceeds SyncVectorThreshold. Producers publish full-vector Data at /<group>/<node>/<boot>/32=sv/<version> and send a publish-only Sync Data referencing it.
  • A bumped Sync Interest name version: /<sync-prefix>/v=4.

SyncVectorThreshold is a fixed library constant of 1200 bytes.

Reference implementation

The ndnd Go implementation in named-data/ndnd (std/sync, std/ndn/svs/v4) ships against this spec on the psvs branch.

File

  • New: Specification-v4.md (508 lines)
  • §9 ("Migration from Version 3") documents the wire-format deltas.

This is a non-breaking, additive contribution — Specification.md (v3) is left untouched. v3 and v4 deployments cannot interoperate on the same Sync Interest prefix (v=3 vs v=4), per the §9 migration note.

cc @yoursunny — addressing the request from named-data/ndnd#190.

Uploads the SVS v4 wire-format specification (mhash, distinct
FullStateVector / PartialStateVector / SvsDataRef TLVs, and the
publish + pull recovery mode) alongside the existing v3
Specification.md. A 'Migration from Version 3' section (§9) summarizes
the wire-format deltas.

Source: https://github.com/named-data/ndnd/blob/psvs/docs/svs-v4.md
Reference implementation: named-data/ndnd std/sync std/ndn/svs/v4
Comment thread Specification-v4.md

### 1.2 Large groups

When the encoded State Vector exceeds **`SyncVectorThreshold`** (a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transition from a small group to a large group could be sudden.
It could occur when:

  • A new member (name + boot time combination) joins the group.
  • A sequence number's TLV-LENGTH increases, such as incrementing from 0xFFFF to 0x00010000.

This implies that, every node must be prepared to accept both formats at all times.
Hence, having both "small group" and "large group" would unnecessarily complicate the protocol and its implementations.

If I read correctly, the Direct FULL mode is either same as or very similar to the small group mode, I suggest deleting small group mode altogether.
Instead, the protocol could specify that a producer MUST send as Direct FULL mode when the state vector size is within the threshold.

Comment thread Specification-v4.md

## 2. Format and Naming

### 2.1 Sync Interest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sync Interest Prefix Announcement (introduced in #21) is missing.

Comment thread Specification-v4.md
| `0xCE` | **PARTIAL** | `StateVector` contains a subset (§4.2). Used for new publication only when FULL exceeds threshold. |

Distinct TLVs (instead of a shared field with a discriminator) let a
receiver skip the more expensive subset-evaluation code path when it sees

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec should not use the term "code path", which is an implementation concept.

Comment thread Specification-v4.md

### 4.3 `SyncVectorThreshold`

`SyncVectorThreshold` is a fixed library constant (1200 bytes) that bounds

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec should not use the term "library constant", which is an implementation concept.

Comment thread Specification-v4.md

**Computation:**

```abnf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is not valid ABNF syntax.
You should use ABNF to define what goes into the plaintext, and then use a non-ABNF block to define mhash concept.

Comment thread Specification-v4.md
full-vector Data.

```abnf
SvsData = SVS-DATA-TYPE TLV-LENGTH

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outer SVS-DATA-TYPE TLV-LENGTH is redundant.
The enclosed Data packet's Content could just contain MemberSetHash (FullStateVector|PartialStateVector|SvsDataRef), without the T and L parts.

Comment thread Specification-v4.md
( FullStateVector
| PartialStateVector
| SvsDataRef ) ; exactly one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MemberSetHash and SvsDataRef should have ABNF definitions.

Comment thread Specification-v4.md
```

| Field | TLV type | Value |
|-------|----------|-------|

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the table in favor of the ABNF block.

Comment thread Specification-v4.md
PARTIAL in this case as a signal to the caller; the caller MUST treat an
empty PARTIAL as the publish + pull trigger instead of forwarding it.

An implementation MAY use the following selection priority:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a MAY instead of a MUST ?

Comment thread Specification-v4.md

---

## 9. Migration from Version 3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the necessity of a breaking change.
Instead, the proposed feature can be added incrementally into SVS v3 in the following way:

  • Choose a non-critical TLV-TYPE number for MemberSetHash.
  • When StateVector is small enough to fit in a State Vector Data, encode MemberSetHash + StateVector. Recipients who do not understand MemberSetHash would ignore it.
  • If a State Vector Data is received with StateVector only, a recipient who needs MemberSetHash can compute it from the StateVector.
  • Choose a critical TLV-TYPE number for PartialStateVector and SvsDataRef; SvsDataRef contains nested Name.
  • When StateVector is too large to fit in a State Vector Data, encode either MemberSetHash + PartialStateVector and MemberSetHash + SvsDataRef. Recipients who do not understand this scheme would drop the packet after seeing a critical TLV-TYPE number.

This maintains wire format compatibility and enables upgrading SVS v3 to support the PartialStateVector feature.

@Pesa Pesa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General NAK on the design per today's NDN group discussion.

@Pesa
Pesa marked this pull request as draft September 4, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants