Skip to content

Commit a8c7c1f

Browse files
committed
Add stateful MAP SMS workflows
1 parent 0c0445f commit a8c7c1f

19 files changed

Lines changed: 1507 additions & 54 deletions

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ SIGTRAN.NET is currently in a **public release-candidate** track. Version
1616
`1.0.0-rc.1` has been published and restored from NuGet.org.
1717

1818
Native Linux SCTP and external SCTP/M3UA peer evidence are retained and now feed
19-
the SDK readiness APIs through a common verification catalog. Stateful M3UA and
20-
M2PA runtimes are available. Full stable-product readiness remains gated on
21-
stateful MAP workflows, end-to-end independent-peer evidence,
19+
the SDK readiness APIs through a common verification catalog. Stateful M3UA,
20+
M2PA, SCCP, TCAP, and MAP SMS runtimes are available. Full stable-product
21+
readiness remains gated on end-to-end independent-peer evidence,
2222
operator-sized performance evidence, trusted signing, and stable release
2323
execution.
2424

@@ -71,7 +71,7 @@ The current RC engineering track focuses on:
7171
| M2PA | RFC 4165 codec and stateful `IMtp2Link` runtime provide alignment, proving, 24-bit sequencing, acknowledgement, retrieval retention, congestion handling, processor-outage recovery, metrics, and transport replacement. Independent peer evidence remains. |
7272
| SCCP | Stateful `ISccpService` supports UDT/XUDT/LUDT, GT translation, routing, bounded segmentation/reassembly, UDTS return policy, metrics, cancellation, and MTP3 receive ownership. External peer evidence remains. |
7373
| 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. External peer evidence remains. |
74-
| MAP | SMS codec and facade foundations exist; stateful service workflows and external evidence remain. |
74+
| 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. Independent peer evidence remains. |
7575
| Tooling | Byte-level tests, protocol diagnostics, trace comparison, and interoperability evidence are core project principles. |
7676

7777
---
@@ -159,7 +159,8 @@ Start here:
159159
- [Phase 49 SCCP stateful service](docs/PHASE49_SCCP_STATEFUL_SERVICE.md)
160160
- [TCAP](docs/TCAP.md)
161161
- [Phase 50 TCAP dialogue manager](docs/PHASE50_TCAP_DIALOGUE_MANAGER.md)
162-
- [MAP SMS profile](docs/MAP.md)
162+
- [MAP SMS service](docs/MAP.md)
163+
- [Phase 51 MAP SMS service](docs/PHASE51_MAP_SMS_SERVICE.md)
163164
- [Interoperability and tooling](docs/INTEROPERABILITY.md)
164165
- [Compatibility policy](docs/COMPATIBILITY.md)
165166
- [Quality and contribution rules](docs/QUALITY.md)

docs/COMMERCIAL_READINESS_REPORT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ retained manifests instead of stale hard-coded flags.
4242
- M3UA and M2PA now provide stateful runtime implementations through
4343
`IMtp3Network` and `IMtp2Link`. Independent external M2PA peer evidence remains
4444
part of the end-to-end traffic lab gate.
45-
- SCCP and TCAP now provide stateful runtime implementations with routing,
46-
reassembly, transaction correlation, invoke outcomes, timeout handling, and
47-
cleanup. MAP SMS still requires stateful operation workflows, and the complete
48-
stack requires independent end-to-end peer evidence.
45+
- SCCP, TCAP, and MAP SMS now provide stateful runtime implementations with
46+
routing, reassembly, transaction correlation, typed application operations,
47+
Result/Error/Reject outcomes, timeout handling, and cleanup. The complete
48+
stack still requires independent end-to-end peer evidence.
4949
- The retained benchmark is not an operator-sized multi-host capacity or soak
5050
result.
5151

docs/LAYER_CONTRACTS.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The direction is intentionally downward:
1414
| MTP3 network | `IMtp3Network` | `IMtp2Link` or an M3UA network adapter |
1515
| SCCP service | `ISccpService` | `IMtp3Network` |
1616
| TCAP dialogues | `ITcapDialogues` | `ISccpService` |
17+
| TCAP components | `ITcapComponentDialogues` | `ITcapDialogues` |
1718
| MAP SMS service | `IMapSmsService` | `ITcapDialogues` |
1819

1920
Upper layers should depend on the public contract of the layer below them, not on concrete classes such as a specific socket adapter, session implementation, or lab runner.
@@ -36,9 +37,16 @@ can implement the same contract.
3637

3738
`ISccpService` exposes SCCP Unitdata primitives over `IMtp3Network`. `SccpConnectionlessService` provides a connectionless UDT implementation.
3839

39-
`ITcapDialogues` exposes Begin, Continue, End, and Receive dialogue primitives over `ISccpService`. `TcapDialogueService` provides a stateful dialogue service over SCCP Unitdata.
40+
`ITcapDialogues` exposes Begin, Continue, End, and Receive dialogue primitives
41+
over `ISccpService`. `ITcapComponentDialogues` extends that boundary with
42+
tracked invokes, correlated outcomes, inbound components, response primitives,
43+
and Abort. `TcapDialogueManager` implements both contracts.
4044

41-
`IMapSmsService` exposes SMS-oriented MAP operations over `ITcapDialogues`. `MapSmsService` composes the existing MAP SMS TCAP builder with the dialogue contract.
45+
`IMapSmsService` exposes SMS-oriented MAP operations over `ITcapDialogues`.
46+
Fire-and-forget compatibility methods work with the base contract; correlated
47+
stateful methods require the `ITcapComponentDialogues` capability without
48+
depending on a concrete dialogue manager. `MapSmsServer` also consumes that
49+
component contract for typed inbound dispatch.
4250

4351
## Consumer Rule
4452

@@ -49,7 +57,7 @@ ISctpTransport sctp = CreateProductionSctpTransport();
4957
using M3uaTransportSession m3uaSession = new(sctp);
5058
IMtp3Network mtp3 = new M3uaMtp3Network(m3uaSession);
5159
ISccpService sccp = new SccpConnectionlessService(mtp3, routingLabel);
52-
ITcapDialogues tcap = new TcapDialogueService(sccp);
60+
ITcapComponentDialogues tcap = new TcapDialogueManager(sccp);
5361
IMapSmsService map = new MapSmsService(tcap, calledParty, callingParty);
5462
```
5563

docs/MAP.md

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
1-
# MAP SMS Profile
1+
# MAP SMS Service
22

3-
Phase 5 builds MAP SMS operation models and BER bindings on top of the TCAP foundation.
3+
SIGTRAN.NET provides typed MAP SMS codecs, correlated client workflows, and an
4+
asynchronous inbound operation server over TCAP.
45

56
## Service Contract
67

7-
`IMapSmsService` is the official SMS-oriented MAP service boundary. It depends on `ITcapDialogues` and exposes operation-level methods for MO-ForwardSM, MT-ForwardSM, and SendRoutingInfoForSM.
8+
`IMapSmsService` is the official SMS-oriented MAP service boundary. It depends
9+
on `ITcapDialogues` and exposes all five supported operations:
810

9-
`MapSmsService` composes `MapSmsTcapClient` with the TCAP dialogue contract, allowing applications to inject alternate TCAP dialogue managers without changing MAP SMS code.
11+
- `sendRoutingInfoForSM`
12+
- `mo-ForwardSM`
13+
- `mt-ForwardSM`
14+
- `reportSM-DeliveryStatus`
15+
- `alertServiceCentre`
16+
17+
The `Send*Async` methods retain fire-and-forget compatibility. The
18+
`Invoke*Async` methods require `ITcapComponentDialogues`, correlate the invoke
19+
with ReturnResult, ReturnError, Reject, timeout, or dialogue closure, and return
20+
`MapSmsOperationResult`.
21+
22+
```csharp
23+
IMapSmsService map = new MapSmsService(
24+
tcapDialogueManager,
25+
remoteMapAddress,
26+
localMapAddress);
27+
28+
MapSmsOperationResult result =
29+
await map.InvokeRoutingInfoForShortMessageAsync(request, ct: cancellationToken);
30+
31+
if (result.ErrorCode == MapSmsErrorCode.UnknownSubscriber)
32+
{
33+
// Apply the operator's subscriber-not-found policy.
34+
}
35+
```
1036

1137
## Operation Catalog
1238

@@ -24,6 +50,21 @@ bool known = MapSmsOperationCatalog.TryGet(
2450
out MapSmsOperationMetadata metadata);
2551
```
2652

53+
`MapSmsOperationProfiles` binds each operation to its standardized local
54+
operation value, application-context-name, and default timeout. The built-in
55+
profiles use the TS 29.002 v3/v2 contexts:
56+
57+
| Operation | Local code | Application context |
58+
| --- | ---: | --- |
59+
| `mt-ForwardSM` | 44 | `0.4.0.0.1.0.25.3` |
60+
| `sendRoutingInfoForSM` | 45 | `0.4.0.0.1.0.20.3` |
61+
| `mo-ForwardSM` | 46 | `0.4.0.0.1.0.21.3` |
62+
| `reportSM-DeliveryStatus` | 47 | `0.4.0.0.1.0.20.3` |
63+
| `alertServiceCentre` | 64 | `0.4.0.0.1.0.23.2` |
64+
65+
The assignments follow
66+
[ETSI TS 129 002](https://www.etsi.org/deliver/etsi_ts/129000_129099/129002/03.06.00_60/ts_129002v030600p.pdf).
67+
2768
## Parameter Set
2869

2970
`MapSmsParameterSet` is the shared BER context-specific parameter container used by the operation models.
@@ -153,6 +194,33 @@ byte[] tcapMessage = built.EncodedMessage;
153194

154195
The facade hides TCAP transaction-id, invoke-id, dialogue portion, and component wrapping while keeping the encoded transaction available for lower-level routing.
155196

197+
## Inbound Operation Server
198+
199+
`MapSmsServer` dispatches decoded inbound invokes to operation-specific async
200+
handlers. It validates the operation and payload before calling application
201+
code, returns `MistypedComponent` for malformed parameters, returns
202+
`UnrecognizedComponent` when no profile or handler exists, maps handler
203+
responses to ReturnResult, ReturnError, or Reject, and reports processing
204+
metrics.
205+
206+
```csharp
207+
MapSmsServer server = new(tcapDialogueManager);
208+
server.RegisterHandler(
209+
MapSmsOperationCode.MtForwardShortMessage,
210+
(request, ct) =>
211+
{
212+
MapMtForwardShortMessage mt =
213+
request.GetMessage<MapMtForwardShortMessage>();
214+
return ValueTask.FromResult(MapSmsOperationResponse.Result());
215+
});
216+
217+
await server.RunAsync(stoppingToken);
218+
```
219+
220+
Only one application consumer should own the inbound TCAP component stream for
221+
an endpoint. `TcapDialogueManager` keeps correlated outbound outcomes on their
222+
invoke completion path, so they cannot accumulate in the inbound server queue.
223+
156224
## Evidence Vectors
157225

158226
`MapSmsEvidenceVectors.GetVectors()` exposes deterministic byte-level vectors for MO-ForwardSM, MT-ForwardSM, SendRoutingInfoForSM, ReportSM-DeliveryStatus, and AlertServiceCentre operation parameters.
@@ -166,6 +234,11 @@ Each vector stores literal BER-shaped expected bytes and validates the current o
166234

167235
## Readiness
168236

169-
`MapSmsReadiness.GetReport()` reports the current MAP SMS profile status. The foundation is complete when operation metadata, address primitives, ForwardSM codecs, SRI-SM, delivery status, AlertServiceCentre, errors/extensions, and the TCAP client facade are present.
237+
`MapSmsReadiness.GetReport()` reports twelve implemented service capabilities:
238+
operation metadata, address primitives, five operation codecs, errors and
239+
extensions, the TCAP facade, operation profiles, correlated client workflows,
240+
typed server dispatch, and operational controls.
170241

171-
Production readiness remains false until external MAP SMS interoperability vectors and operator-profile validation are added.
242+
The in-process paired-stack tests exercise all five workflows and MAP error
243+
mapping. Production readiness remains false until independent end-to-end MAP
244+
SMS traces and operator-profile validation are retained.

docs/PHASE51_MAP_SMS_SERVICE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Phase 51 - MAP SMS Service
2+
3+
## Objective
4+
5+
Move MAP SMS from deterministic codecs and transaction builders to a stateful,
6+
interface-driven application service over the concurrent TCAP dialogue manager.
7+
8+
## Delivered Runtime
9+
10+
- `ITcapComponentDialogues` separates correlated component operations from the
11+
concrete `TcapDialogueManager`.
12+
- `MapSmsService` executes and correlates SRI-SM, MO/MT ForwardSM,
13+
ReportSM-DeliveryStatus, and AlertServiceCentre.
14+
- `MapSmsOperationResult` exposes Result, MAP Error, Reject, timeout, and
15+
dialogue-close outcomes without leaking TCAP internals into application code.
16+
- `MapSmsServer` validates and decodes inbound invokes, dispatches typed async
17+
handlers, and sends ReturnResult, ReturnError, or Reject.
18+
- `MapSmsOperationProfiles` supplies the TS 29.002 operation values,
19+
application contexts, and default timeouts.
20+
- Cancellation aborts an outstanding dialogue where possible. TCAP timeout
21+
correlation and bounded component queues remain owned by the lower layer.
22+
- Server metrics cover received, completed, errored, rejected, malformed, and
23+
failed-handler operations.
24+
25+
## Compatibility
26+
27+
The original `Send*Async` methods and `MapSmsTcapClient` remain available.
28+
Legacy TCAP operation enum tokens retain their values for source and byte-vector
29+
compatibility. MAP profiles place their actual local operation values on the
30+
wire through explicit application-profile conversion.
31+
32+
## Verification
33+
34+
The paired-stack test composes:
35+
36+
`MapSmsService -> TcapDialogueManager -> SccpConnectionlessService -> IMtp3Network`
37+
38+
It sends all five operations across two independent stack instances, validates
39+
typed server decoding, checks four successful results, and verifies
40+
`absentSubscriberForSM` ReturnError mapping. The full solution build and test
41+
suite pass with zero warnings.
42+
43+
## Remaining Gate
44+
45+
This phase proves application behavior inside the SDK. Independent
46+
MAP/TCAP/SCCP/M3UA/SCTP peer traffic, PCAP field comparison, and operator
47+
profile evidence are intentionally assigned to the end-to-end traffic lab.

docs/PHASE51_SUMMARY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Phase 51 Summary
2+
3+
Phase 51 is implementation-complete.
4+
5+
- All five MAP SMS workflows have correlated client APIs.
6+
- Inbound invokes have typed asynchronous server dispatch.
7+
- MAP errors, TCAP rejects, timeouts, cancellation, and metrics are represented.
8+
- Standard operation codes and application-context OIDs are profile-driven.
9+
- Public APIs include XML documentation.
10+
- In-process end-to-end tests cover success and MAP error paths.
11+
- README, MAP guidance, architecture boundaries, roadmap, and readiness status
12+
are synchronized.
13+
14+
Independent peer evidence remains a Phase 52 gate and is not implied by this
15+
implementation milestone.

docs/PHASE_INDEX.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ This index is the complete phase map for Sigtran.NET. It links each phase to the
5555
| 48 | M2PA production path | [Phase 48 M2PA Production Path](PHASE48_M2PA_PRODUCTION_PATH.md), [Phase 48 Summary](PHASE48_SUMMARY.md), [M2PA](M2PA.md) | Implementation complete; external peer evidence pending |
5656
| 49 | SCCP stateful service layer | [Phase 49 SCCP Stateful Service](PHASE49_SCCP_STATEFUL_SERVICE.md), [Phase 49 Summary](PHASE49_SUMMARY.md), [SCCP](SCCP.md) | Implementation complete; external peer evidence pending |
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 |
58-
| 51 | MAP SMS service | Planned | Pending |
58+
| 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 | Planned | Pending |
6060
| 53 | Operator-sized performance and resilience | Planned | Pending |
6161
| 54 | Production operations package | Planned | Pending |
@@ -66,6 +66,6 @@ This index is the complete phase map for Sigtran.NET. It links each phase to the
6666
The retained verification catalog now reports native Linux SCTP, external SCTP
6767
peer traffic, M3UA interoperability, RC SBOM/provenance/API baseline, and
6868
prerelease publication evidence. Full product readiness remains blocked on the
69-
stateful MAP workflows, end-to-end M2PA and higher-layer
70-
independent peer traffic, operator-sized performance, production operations, a
69+
end-to-end M2PA and higher-layer independent peer traffic, operator-sized
70+
performance, production operations, a
7171
trusted release identity, and protected stable publication.

docs/SDK_ROADMAP.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,13 @@ peer evidence remains in the end-to-end lab gate.
471471
AlertServiceCentre workflows.
472472
- Add MAP error mapping, operation profiles, cancellation, and operator samples.
473473

474-
Status: Pending.
474+
Status: Implementation complete. `MapSmsService` now executes and correlates all
475+
five supported SMS operations through `ITcapComponentDialogues`.
476+
`MapSmsOperationProfiles` supplies standardized local operation values,
477+
application contexts, and timeouts. `MapSmsServer` performs typed inbound
478+
dispatch with Result/Error/Reject responses, cancellation, validation, and
479+
metrics. Paired-stack tests cover every operation and MAP error mapping.
480+
Independent end-to-end peer evidence remains in Phase 52.
475481

476482
## Phase 52 - End-To-End SS7 Traffic Lab
477483

0 commit comments

Comments
 (0)