Skip to content

Commit 42324fa

Browse files
committed
Add full-stack performance and resilience lab
1 parent 17bd345 commit 42324fa

37 files changed

Lines changed: 2118 additions & 76 deletions

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Native Linux SCTP, external SCTP/M3UA, and cross-implementation full-stack MAP
1919
SMS traffic evidence are retained. Stateful M3UA, M2PA, SCCP, TCAP, and MAP SMS
2020
runtimes are available. Full stable-product readiness remains gated on
2121
operator/vendor profile interoperability, independent M2PA evidence,
22-
operator-sized performance evidence, production operations, trusted signing,
23-
and stable release execution.
22+
20K peak and operator-sized multi-host performance evidence, production
23+
operations, trusted signing, and stable release execution.
2424

2525
For release history and governance, see:
2626

@@ -55,6 +55,8 @@ The current RC engineering track focuses on:
5555
comparison evidence.
5656
- Cross-implementation MAP SMS traffic through TCAP, SCCP, M3UA, and native SCTP
5757
with retained PCAP, traces, field comparison, and digest evidence.
58+
- Full-stack performance and resilience tooling with a retained 62,000-operation
59+
baseline, latency/resource metrics, SCTP failover, and zero-loss recovery.
5860
- Stateful SCCP, TCAP, and MAP SMS service layers.
5961
- M2PA as a parallel MTP2 path.
6062
- Byte-level tests and protocol validation.
@@ -74,6 +76,7 @@ The current RC engineering track focuses on:
7476
| SCCP | Stateful `ISccpService` supports UDT/XUDT/LUDT, GT translation, routing, bounded segmentation/reassembly, UDTS return policy, metrics, cancellation, and MTP3 receive ownership. Independent C-peer UDT evidence is retained; operator/vendor profile evidence remains. |
7577
| TCAP | Concurrent `TcapDialogueManager` provides transaction correlation, Begin/Continue/End/Abort, tracked invokes, Result/Error/Reject outcomes, shared timeout scanning, bounded queues, cleanup, snapshots, and metrics. Independent C-peer transaction evidence is retained; operator/vendor profile evidence remains. |
7678
| MAP | Stateful client/server SMS workflows cover SRI-SM, MO/MT ForwardSM, ReportSM-DeliveryStatus, and AlertServiceCentre with operation profiles, result/error correlation, typed dispatch, cancellation, and metrics. All five operations have cross-implementation repository-profile evidence; operator/vendor profile evidence remains. |
79+
| Performance | The retained WSL baseline completed 62,000 full-stack operations without protocol loss at about 13.5K sustained/peak TPS. The 20K peak and multi-host operator qualification gates remain open. |
7780
| Tooling | Byte-level tests, protocol diagnostics, trace comparison, and interoperability evidence are core project principles. |
7881

7982
---
@@ -164,6 +167,7 @@ Start here:
164167
- [MAP SMS service](docs/MAP.md)
165168
- [Phase 51 MAP SMS service](docs/PHASE51_MAP_SMS_SERVICE.md)
166169
- [Phase 52 end-to-end SS7 traffic lab](docs/PHASE52_END_TO_END_SS7_TRAFFIC_LAB.md)
170+
- [Phase 53 performance and resilience](docs/PHASE53_OPERATOR_PERFORMANCE_RESILIENCE.md)
167171
- [Interoperability and tooling](docs/INTEROPERABILITY.md)
168172
- [Compatibility policy](docs/COMPATIBILITY.md)
169173
- [Quality and contribution rules](docs/QUALITY.md)
@@ -220,9 +224,10 @@ Stable production support requires:
220224
- Stable API lifecycle validation.
221225
- Security, release, compliance, and operations review.
222226

223-
The Linux SCTP, external M3UA, and repository-profile full-stack traffic gates
224-
are complete. Until the remaining gates are complete, the package should be
225-
treated as release-candidate infrastructure for controlled integrations.
227+
The Linux SCTP, external M3UA, repository-profile full-stack traffic, and
228+
controlled performance execution gates are complete. Until the remaining gates
229+
are complete, the package should be treated as release-candidate infrastructure
230+
for controlled integrations.
226231

227232
---
228233

docs/COMMERCIAL_READINESS_REPORT.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,22 @@ retained manifests instead of stale hard-coded flags.
3838
invokes and built five results. The retained PCAP contains 23 SCTP packets
3939
and ten M3UA DATA messages. The complete bundle is under
4040
`docs/evidence/PHASE52_END_TO_END_20260724T085858Z/`.
41+
- Full-stack performance run `performance-20260724T093659Z` completed 62,000
42+
MAP SMS transactions through TCAP, SCCP, M3UA, and native SCTP without
43+
protocol failure. Sustained, peak, and soak throughput were approximately
44+
13.5K TPS; sustained/peak P95 remained below 15 ms; peak working set was
45+
70 MB; and hot-path allocation was about 9.5 KB per transaction. Injected
46+
association failure recovered in about 1.04 seconds and recovery traffic
47+
completed without loss. Compressed PCAP, TShark fields, metrics, logs,
48+
configuration, trace, comparison, report, and digests are retained under
49+
`docs/evidence/PHASE53_PERFORMANCE_20260724T093659Z/`.
4150

4251
## Remaining Production Blockers
4352

44-
- The current benchmark is real Linux SCTP peer traffic evidence, but it is single-host loopback. Do not use it for broad operator capacity claims until an operator-sized deployment benchmark is retained.
53+
- The current full-stack benchmark is real Linux SCTP peer traffic evidence,
54+
but it is single-host WSL loopback. It reached about 13.5K TPS and did not
55+
meet the 20K peak target. Do not use it for broad operator capacity claims
56+
until a representative multi-host deployment benchmark passes.
4557
- Package publication evidence is closed for the public RC prerelease. Stable commercial release gates are foundation-complete, but live stable publication still requires retained stable release evidence, a completed protected stable publication run, and verified stable NuGet publication evidence.
4658
- Public/stable signing must use the organization's approved trusted certificate in the protected release environment; the current signing evidence is internal self-signed RC evidence.
4759
- Hosted GitHub provenance/SBOM attestations were skipped for dry-run and prerelease because private repository or organization attestation persistence can require a supported plan or public repository. These runs retained local provenance markers; stable runs keep hosted attestation reserved for the protected stable gate.
@@ -51,8 +63,8 @@ retained manifests instead of stale hard-coded flags.
5163
cross-implementation traffic evidence for the repository profile. A separate
5264
operator or vendor profile run is still required before broad SS7 network
5365
interoperability can be claimed.
54-
- The retained benchmark is not an operator-sized multi-host capacity or soak
55-
result.
66+
- The retained soak contains 20,000 operations, not the long-duration
67+
multi-host soak required for an operator capacity claim.
5668

5769
## Production Decision
5870

docs/PHASE14_PERFORMANCE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,15 @@ Long-running benchmarks remain opt-in so normal pull-request validation stays fa
7474
## Phase Status
7575

7676
`SigtranPerformanceStatus.Describe()` summarizes the completed Phase 14 units and separates performance foundation readiness from production performance readiness.
77+
78+
## Measured Full-Stack Baseline
79+
80+
Phase 53 adds an executable native SCTP benchmark and retained run
81+
`performance-20260724T093659Z`. The run completed 62,000 MAP SMS transactions
82+
through TCAP, SCCP, and M3UA with no failures, measured approximately 13.5K TPS
83+
for sustained, peak, and soak stages, and restored traffic after association
84+
failure without loss.
85+
86+
The run is a single-host WSL baseline and did not reach the 20K peak target. See
87+
[Phase 53](PHASE53_OPERATOR_PERFORMANCE_RESILIENCE.md) for metrics, evidence,
88+
and the remaining multi-host gate.

docs/PHASE33_PERFORMANCE_RESILIENCE_EVIDENCE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ This keeps retained benchmark evidence separate from production claims. A report
114114

115115
The final unit completes the status count and validates the phase with naming, package-neutrality, build, test, and pack checks. The final status capability is `final-sweep-validation`.
116116

117-
Phase 33 is foundation-complete for performance and resilience evidence contracts. Production performance claims still require a retained real peer-traffic benchmark report and wider commercial readiness.
117+
Phase 33 is foundation-complete for performance and resilience evidence
118+
contracts. Phase 53 now supplies a retained 62,000-operation native SCTP
119+
full-stack baseline and an executable runner. Production performance claims
120+
still require a passing 20K peak result and representative multi-host,
121+
long-duration operator evidence.
118122

119123
## Validation
120124

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Phase 53 - Operator-Sized Performance And Resilience
2+
3+
Phase 53 replaces smoke timing with an executable full-stack benchmark over
4+
native Linux SCTP and an independent C peer.
5+
6+
## Completed Units
7+
8+
| Unit | Capability | Status |
9+
| --- | --- | --- |
10+
| 1 | Full-stack performance lab executable | Complete |
11+
| 2 | Configurable warmup and sustained stages | Complete |
12+
| 3 | Configurable peak and soak stages | Complete |
13+
| 4 | P50, P95, P99, and maximum latency | Complete |
14+
| 5 | CPU, working set, allocation, and Gen2 metrics | Complete |
15+
| 6 | Association failover and reconnect orchestration | Complete |
16+
| 7 | Recovery traffic and loss validation | Complete |
17+
| 8 | PCAP, trace, peer logs, metrics, and comparison artifacts | Complete |
18+
| 9 | Hot-path allocation and TCAP queue corrections | Complete |
19+
| 10 | Retained baseline, docs, build, test, and pack | Complete |
20+
21+
## Run The Benchmark
22+
23+
The runner requires Linux kernel SCTP, lksctp headers, GCC, .NET 10,
24+
`tcpdump`, `tshark`, and `gzip`.
25+
26+
```bash
27+
SIGTRAN_ARTIFACT_ROOT="$HOME/sigtran-lab/artifacts" \
28+
SIGTRAN_WARMUP_OPERATIONS=1000 \
29+
SIGTRAN_SUSTAINED_OPERATIONS=20000 \
30+
SIGTRAN_PEAK_OPERATIONS=20000 \
31+
SIGTRAN_RECOVERY_OPERATIONS=1000 \
32+
SIGTRAN_SOAK_OPERATIONS=20000 \
33+
bash scripts/run-full-stack-performance-lab.sh
34+
```
35+
36+
Counts, concurrency, addresses, point codes, and peer identity are environment
37+
configurable. Publication targets remain fixed in the lab report unless the
38+
executable is explicitly given alternative qualification arguments.
39+
40+
## Runtime Corrections
41+
42+
The first measured run exposed two production bottlenecks:
43+
44+
- Native SCTP receive allocated a buffer as large as the maximum M3UA PDU for
45+
every message, and send copied an already array-backed payload.
46+
- The optional TCAP dialogue observation queue could block correlated result
47+
processing when no observation consumer was present.
48+
49+
The native path now uses array-backed memory directly and falls back to
50+
`ArrayPool<byte>` only when required. `SCTP_NODELAY` is enabled by default
51+
through `NativeSctpTransportOptions.EnableNoDelay`.
52+
53+
TCAP correlated processing no longer waits for the optional dialogue event
54+
consumer. A full observation queue drops the event and increments
55+
`TcapDialogueManagerMetrics.DroppedDialogueEvents`; inbound application Invoke
56+
components retain bounded backpressure.
57+
58+
## Retained Baseline
59+
60+
Run `performance-20260724T093659Z` completed on WSL2 kernel
61+
`6.18.33.2-microsoft-standard-WSL2` with .NET `10.0.9`, eight visible
62+
processors, native SCTP, packet capture, and the independent C peer.
63+
64+
| Stage | Operations | Failed | TPS | P95 | P99 | Allocation |
65+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
66+
| Warmup | 1,000 | 0 | 4,913.2 | 2.352 ms | 92.041 ms | 10,179 B/op |
67+
| Sustained | 20,000 | 0 | 13,515.3 | 7.230 ms | 8.419 ms | 9,627 B/op |
68+
| Peak | 20,000 | 0 | 13,491.5 | 14.471 ms | 16.380 ms | 9,585 B/op |
69+
| Recovery | 1,000 | 0 | 4,333.8 | 13.255 ms | 89.833 ms | 9,626 B/op |
70+
| Soak | 20,000 | 0 | 13,582.4 | 6.911 ms | 8.058 ms | 9,501 B/op |
71+
72+
All 62,000 requests and responses were counted at M3UA, SCCP, and TCAP.
73+
Association recovery completed in `1,039.1 ms`, recovery traffic completed in
74+
`1,270.4 ms`, and no recovery operations were lost.
75+
76+
The retained bundle under
77+
`docs/evidence/PHASE53_PERFORMANCE_20260724T093659Z/` includes compressed PCAP
78+
and TShark output, peer logs, host profile, SDK trace, structured metrics,
79+
configuration, comparison, report, and SHA-256 manifest.
80+
81+
## Qualification Decision
82+
83+
The controlled execution passed, including sustained load, failover, recovery,
84+
and soak. It did not satisfy the `20,000 TPS` peak target: observed peak
85+
throughput was `13,491.5 TPS`.
86+
87+
This result is also single-host WSL loopback. It cannot support an
88+
operator-sized multi-host capacity claim. That claim requires a dedicated
89+
Linux host or VM pair, representative CPU limits, production network latency,
90+
long-duration soak, and a separately operated peer. The runner is ready for
91+
that environment without code changes.

docs/PHASE53_SUMMARY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Phase 53 Summary - Performance And Resilience
2+
3+
Phase 53 implementation and controlled baseline execution are complete.
4+
5+
## Delivered
6+
7+
- Added `Sigtran.NET.PerformanceLab` and a repeatable Linux runner.
8+
- Added warmup, sustained, peak, recovery, and soak workloads.
9+
- Added latency percentiles, throughput, CPU, memory, allocation, GC, layer
10+
counters, failover timing, reconnect count, and message-loss reporting.
11+
- Parameterized the independent C peer for long-running and quiet workloads.
12+
- Enabled `SCTP_NODELAY` through a documented native transport option.
13+
- Removed per-message 65KB native receive allocation and redundant send copies.
14+
- Prevented an unused TCAP observation stream from blocking correlated results
15+
and exposed dropped observation events in metrics.
16+
- Retained a 62,000-operation baseline with no protocol failures and successful
17+
association recovery.
18+
- Updated README, performance guidance, SCTP/TCAP docs, roadmap, readiness
19+
report, and phase index.
20+
21+
## Readiness Position
22+
23+
The execution gate is complete and the SDK demonstrated approximately
24+
13.5K full-stack MAP SMS transactions per second in this WSL loopback profile.
25+
The 20K peak target and operator-sized multi-host evidence remain open. No
26+
stable operator-capacity claim should be made from the retained baseline.

docs/PHASE_INDEX.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This index is the complete phase map for Sigtran.NET. It links each phase to the
5757
| 50 | TCAP dialogue manager | [Phase 50 TCAP Dialogue Manager](PHASE50_TCAP_DIALOGUE_MANAGER.md), [Phase 50 Summary](PHASE50_SUMMARY.md), [TCAP](TCAP.md) | Implementation complete; external peer evidence pending |
5858
| 51 | MAP SMS service | [Phase 51 MAP SMS Service](PHASE51_MAP_SMS_SERVICE.md), [Phase 51 Summary](PHASE51_SUMMARY.md), [MAP SMS](MAP.md) | Implementation complete; independent peer evidence pending |
5959
| 52 | End-to-end SS7 traffic lab | [Phase 52 End-To-End SS7 Traffic Lab](PHASE52_END_TO_END_SS7_TRAFFIC_LAB.md), [Phase 52 Summary](PHASE52_SUMMARY.md), [Interoperability](INTEROPERABILITY.md) | Complete for repository-profile cross-implementation traffic; operator/vendor profile evidence remains |
60-
| 53 | Operator-sized performance and resilience | Planned | Pending |
60+
| 53 | Operator-sized performance and resilience | [Phase 53 Performance And Resilience](PHASE53_OPERATOR_PERFORMANCE_RESILIENCE.md), [Phase 53 Summary](PHASE53_SUMMARY.md), [Performance Foundation](PHASE14_PERFORMANCE.md) | Implementation and controlled 62K-operation baseline complete; 20K peak and multi-host operator qualification pending |
6161
| 54 | Production operations package | Planned | Pending |
6262
| 55 | Stable release execution | Planned | Pending |
6363

@@ -68,5 +68,5 @@ peer traffic, M3UA interoperability, RC SBOM/provenance/API baseline, and
6868
prerelease publication evidence. Phase 52 also retains cross-implementation
6969
M3UA/SCCP/TCAP/MAP SMS traffic evidence. Full product readiness remains blocked
7070
on operator/vendor profile validation, independent M2PA peer traffic,
71-
operator-sized performance, production operations, a trusted release identity,
72-
and protected stable publication.
71+
20K peak and multi-host operator performance, production operations, a trusted
72+
release identity, and protected stable publication.

docs/SCTP_TRANSPORT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,15 @@ Run `phase45-native-sctp-20260701T103951Z` passed this script on a Linux VM and
221221
`NativeSctpLab.CreateFromEnvironment()` keeps native SCTP integration verification opt-in through `SIGTRAN_NATIVE_SCTP_LAB=1`.
222222

223223
`NativeSctpReadiness.GetReport()` marks the Phase 8 native SCTP foundation complete while keeping production readiness blocked until Linux verification passes.
224+
225+
## Low-Allocation Native Traffic
226+
227+
`NativeSctpTransportOptions.EnableNoDelay` enables `SCTP_NODELAY` by default for
228+
latency-sensitive signaling. Set it to `false` only when deliberate SCTP
229+
bundling is preferred and measured.
230+
231+
The lksctp interop path uses array-backed `ReadOnlyMemory<byte>` and
232+
`Memory<byte>` directly. Non-array-backed buffers fall back to
233+
`ArrayPool<byte>` instead of allocating a maximum-PDU array for every receive.
234+
Phase 53 reduced measured full-stack allocation from approximately 77 KB to
235+
about 9.5 KB per MAP SMS transaction with these changes.

docs/SDK_ROADMAP.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,15 @@ profile validation and independent M2PA traffic remain separate gates.
500500
separate hosts or VMs.
501501
- Report TPS, P95/P99 latency, CPU, memory, allocations, queue pressure, and loss.
502502

503-
Status: Pending.
503+
Status: Implementation and controlled baseline execution are complete.
504+
`Sigtran.NET.PerformanceLab` and
505+
`scripts/run-full-stack-performance-lab.sh` execute warmup, sustained, peak,
506+
failover, recovery, and soak against the independent C/lksctp peer. Run
507+
`performance-20260724T093659Z` completed 62,000 full-stack transactions without
508+
loss, measured about 13.5K TPS across sustained/peak/soak, kept sustained and
509+
peak P95 below 15 ms, and restored traffic in about 1.27 seconds. The run did
510+
not satisfy the 20K peak target and is single-host WSL loopback, so
511+
operator-sized multi-host qualification remains open.
504512

505513
## Phase 54 - Production Operations Package
506514

docs/TCAP.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ dedicated delay task for every invoke while preserving per-invoke timeout
161161
overrides. `SnapshotDialogues` and `GetMetrics` expose current state without
162162
returning mutable manager internals.
163163

164+
The dialogue event stream is observational and cannot block correlated
165+
ReturnResult, ReturnError, or Reject processing. When its bounded queue is full,
166+
the manager drops the observation event and increments
167+
`TcapDialogueManagerMetrics.DroppedDialogueEvents`. Inbound Invoke components
168+
still use their bounded component queue and retain application backpressure.
169+
164170
## Allocation
165171

166172
`TcapTransactionIdAllocator` and `TcapInvokeRegistry` provide deterministic allocation and duplicate detection for transaction and invoke identifiers.

0 commit comments

Comments
 (0)