Skip to content

redundancy: add: configurable vector sequence recovery - #1426

Open
Afshin-Zanganeh wants to merge 3 commits into
inet-framework:masterfrom
howhangliu:feat/frer-vector-recovery
Open

Afshin-Zanganeh wants to merge 3 commits into
inet-framework:masterfrom
howhangliu:feat/frer-vector-recovery

Conversation

@Afshin-Zanganeh

@Afshin-Zanganeh Afshin-Zanganeh commented Nov 6, 2026 •

Copy link
Copy Markdown

StreamMerger eliminates duplicates using a bounded list of accepted sequence numbers. It has no sequence-position acceptance window or inactivity reset. This change adds a reusable recovery helper and a selectable VectorStreamMerger for simulations that need the Vector Recovery Algorithm, addressing the sequence-recovery portion of #1069.

The helper tracks received sequence positions and compares numbers modulo 65536. The merger applies recovery once per processed packet, owns a reset timer per recovery instance, and publishes cumulative diagnostic counters. Existing StreamMerger behavior and default module selection are unchanged.

Recovery grouping and window size affect delivery. Inputs sharing an instance must use the same sequence generator, and the history must cover expected sequence gaps and path-delay differences. Timer rounding and simultaneous-event ordering are documented model choices covered by focused tests.

Scope

Implements the documented IEEE 802.1CB-2017 vector recovery behavior with the IEEE 802.1CBdb-2021 forward-window correction. This covers duplicate and rogue rejection, delayed-packet acceptance, sequence wraparound, timeout reset, tagless handling and optional individual-member recovery. Latent error detection, MRA and management tables are outside this contribution.

The module reuses INET's packet-filter interfaces, stream mapping and sequence tags. It adds no on-wire format or core packet API change. It requires complete frames and backpressure=false. Recovery counters are aggregate diagnostics, not standard management tables.

Commit series

  1. redundancy: add: vector sequence recovery state introduces the helper and its unit tests.
  2. redundancy: add: configurable vector stream merger integrates packet processing, timers and statistics, with module and protocol tests.
  3. examples: add: vector recovery demonstration and validation adds usage documentation, four network configurations.

The implementation plan is plan/pending/frer-vector-recovery.md. The protocol requirements, test traces and assertions are described in tests/protocol/frer/vector-recovery.md.

Configuration

*.*.bridging.streamRelay.merger.typename = "VectorStreamMerger"
*.*.bridging.streamRelay.merger.historyLength = 32
*.*.bridging.streamRelay.merger.resetTimeout = 10ms

Examples are in showcases/tsn/framereplication/vectorrecovery.

Validation

Linux debug and release builds of the recovery implementation passed. Both modes passed all 2 unit, 11 module and 8 protocol fixtures: 42 focused test executions. Native ASan/UBSan checks also passed, including differential transitions and multiple sequence wraps.

Tests use INET's existing opp_run_unit_tests, opp_run_module_tests and opp_run_protocol_tests runners. Exact build commands and selectors are documented in the protocol reviewer document. The showcase README gives the network commands and the recorded scalar/vector results. The change adds no VRA-specific runner and leaves existing fingerprint baselines unchanged.

The separate full-network campaign checks four scenarios in both modes and the five existing FRER fingerprint cases with the stored non-graphical ingredients. Its final result is still being collected.

@Afshin-Zanganeh
Afshin-Zanganeh force-pushed the feat/frer-vector-recovery branch 2 times, most recently from a15963f to 1784b94 Compare November 6, 2026 11:14
The existing merger has no reusable sequence-position recovery state. IEEE 802.1CB-2017 defines numbered recovery decisions and history advancement that can be checked independently of packet handling.

Add a packet-independent helper with signed modular classification, reset and batched history advancement. Unit fixtures check exhaustive classifications, an independent received-number oracle, loss increments and wraparound. The helper includes the forward-boundary correction published through IEEE 802.1CBdb-2021.

Plan: plan/pending/frer-vector-recovery.md
Change: src.protocolelement.redundancy.VectorSequenceRecovery | behavior.add | test whatsnew | frer-vector-recovery
A membership-only stream merger cannot simulate vector-recovery acceptance windows, recovery timeouts or individual-member discard reloads. These behaviors affect duplicate elimination after gaps and sender restarts.

Add an opt-in merger using the recovery helper. Commit decisions once through the packet-filter hook, maintain one reset event per recovery group and publish cumulative recovery signals with NED last statistics. Preserve the existing merger and its default selection. Module fixtures and protocol-observation traces exercise the production packet path, boundary handling, wraparound and timer policies. The protocol reviewer document at tests/protocol/frer/vector-recovery.md records requirements and scope limits.

Plan: plan/pending/frer-vector-recovery.md
Change: src.protocolelement.redundancy.VectorStreamMerger | behavior.add | test whatsnew | frer-vector-recovery
@Afshin-Zanganeh
Afshin-Zanganeh force-pushed the feat/frer-vector-recovery branch from 1784b94 to 67ade12 Compare November 6, 2026 12:24
@Afshin-Zanganeh
Afshin-Zanganeh marked this pull request as ready for review November 6, 2026 12:30

@levy levy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other than the marked part, this PR is in a very good shape! Thanks!

@@ -0,0 +1,112 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is this file supposed to do in the tests/module folder?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@levy Thanks for pointing this out. It was a standalone post-processing script for the four showcase simulations. I removed it as it was extra thing.

Users need configuration examples covering failures and sequence wraparound. The new module does not alter existing configurations unless explicitly selected.

Document module selection and limitations, add failure and wraparound showcase configurations, with scalar/vector recording for result analysis. Unit, module and protocol fixtures use INET's existing category runners; the protocol reviewer document gives the focused selectors. Existing FRER fingerprint baselines are unchanged.

Plan: plan/pending/frer-vector-recovery.md
Change: examples | behavior.add | test | frer-vector-recovery
@Afshin-Zanganeh
Afshin-Zanganeh force-pushed the feat/frer-vector-recovery branch from 67ade12 to 6bc0ce4 Compare November 6, 2026 14:31

This branch has not been deployed

No deployments
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.

2 participants