Back to Fprime

Svc::Ccsds::SdlsSaRouter

Svc/Ccsds/SdlsSaRouter/docs/sdd.md

4.3.07.3 KB
Original Source

Svc::Ccsds::SdlsSaRouter

The Svc::Ccsds::SdlsSaRouter component routes CCSDS SDLS (Space Data Link Security) encryption and decryption requests to downstream crypto components (encryptors or decryptors) based on the security association (SA) index. Its upstream ports mirror the Svc.Ccsds.CcsdsSdlsEncrypt/CcsdsSdlsDecrypt interfaces (which share the same port types) with operation-neutral names, and its downstream side provides arrays of the matching client-style ports (inlined, as FPP interfaces are not array-able at this time). Separate instances may serve the uplink (decryption) and downlink (encryption) paths.

The SA-to-port mapping is a compile-time FPP array of {U16 SA, FwIndexType port index} pairs (SdlsCfg.SaMap, entry type Svc.Ccsds.SaMapEntry defined in Svc/Ccsds/Types). The map values and sizing constants are defined in a component-local configuration module (Svc/Ccsds/SdlsSaRouter/config/SdlsSaRouterConfig/SdlsSaRouterCfg.fpp, TlmPacketizer-style), which projects may override. This permits more SAs than ports, sparse SAs, or project-defined non-linear SA ranges that all map down to a linear, compact array of outputs.

Functionality

  • Loads the compile-time SdlsCfg.SaMap into an internal Fw::ArrayMap from SA index to port index at construction.
  • Receives an SA index, iv/data buffer, and frame context on the guarded dataIn port.
  • Looks up the SA index in the map; if found, forwards the request out the mapped saDataOut port.
  • Passes an UNKNOWN_SA status forward on dataOut (with the untouched buffer) if the SA index has no map entry, or UNKNOWN_PORT if the mapped port index is out of range or unconnected; the buffer is not forwarded downstream in either case.
  • Passes buffers returned by downstream crypto components (deallocation path) upstream via bufferReturnOut.
  • Passes the operation status and processed data emitted by downstream crypto components upstream via dataOut, recording the originating port in an Fw::ArrayMap bookkeeping table (sized by SdlsCfg.SaRouterMaxOutstandingBuffers), and routes ownership returns received on dataReturnIn back to the originating crypto component via saDataReturnOut — or upstream via bufferReturnOut for buffers the router itself forwarded on routing errors.

Port Descriptions

KindNamePort TypeDescription
guarded inputdataInSvc.Ccsds.CcsdsSdlsEncryptionReceives the SA index and iv/data buffer to route.
outputdataOutSvc.Ccsds.CcsdsSdlsDataSends the operation status and processed data (possibly newly allocated) upstream.
guarded inputdataReturnInSvc.ComDataWithContextReceives back ownership of buffers sent on dataOut.
outputbufferReturnOutSvc.ComDataWithContextReturns incoming iv/data buffers for deallocation.
outputsaDataOut[SdlsCfg.SaRouterPortCount] Svc.Ccsds.CcsdsSdlsEncryptionSends the SA index and iv/data buffer to the mapped downstream crypto component.
sync inputsaDataIn[SdlsCfg.SaRouterPortCount] Svc.Ccsds.CcsdsSdlsDataReceives the operation status and processed data from downstream crypto components.
outputsaDataReturnOut[SdlsCfg.SaRouterPortCount] Svc.ComDataWithContextReturns ownership of processed data buffers to downstream crypto components.
sync inputsaBufferReturnIn[SdlsCfg.SaRouterPortCount] Svc.ComDataWithContextReceives back iv/data buffers from downstream crypto components for deallocation.

The downstream-facing inputs (saDataIn, saBufferReturnIn) are sync rather than guarded: downstream crypto components call back synchronously on the caller's thread, which already holds the component guard (guarding them would re-enter the mutex and deadlock). This is a topology constraint, not a convention: connected crypto components must be passive with synchronous handlers (see SVC-CCSDS-SDLS-SA-ROUTER-008).

Events

NameSeverityDescription
TrackingTableFullWARNING_HIThe outstanding-buffer tracking table is full; the data was dropped and its buffer returned.
UntrackedBufferReturnedWARNING_HIA returned buffer was not found in the tracking table; it was returned upstream.

Configuration

ConstantDescription
SdlsCfg.SaRouterPortCountDimension of the downstream port arrays.
SdlsCfg.SaRouterMapEntryCountNumber of entries in the SA-to-port map (independent of port count).
SdlsCfg.SaRouterMaxOutstandingBuffersCapacity of the outstanding processed-buffer bookkeeping table.
SdlsCfg.SaRouterPortsEnumeration of the downstream crypto component ports (PLAINTEXT = 0, UNCONNECTED = 1).
SdlsCfg.SaMapCompile-time array of {SA index, port index} pairs.

All of the above are defined in the component-local configuration module Svc/Ccsds/SdlsSaRouter/config/SdlsSaRouterConfig.

Requirements

NameDescriptionValidation
SVC-CCSDS-SDLS-SA-ROUTER-001The SdlsSaRouter shall accept an SA index and iv/data buffer via its guarded dataIn port (mirroring the CcsdsSdlsEncrypt/CcsdsSdlsDecrypt interfaces).Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-002The SdlsSaRouter shall map the incoming SA index to a downstream port index using a compile-time SA-to-port map: an FPP array of {U16 SA, FwIndexType port index} pairs (SdlsCfg.SaMap) defined in configuration.Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-003The SdlsSaRouter shall forward the SA index and buffer out the mapped output port, and shall pass the downstream crypto component's SdlsStatus forward alongside the processed data via dataOut.Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-004The SdlsSaRouter shall receive returned iv/data buffers from downstream crypto components and pass them upstream via its return output.Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-005Upon receiving an SA index with no map entry, the SdlsSaRouter shall pass an UNKNOWN_SA status forward on dataOut with the untouched buffer, without forwarding it downstream.Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-006Upon a map entry referencing an out-of-range or unconnected port index, the SdlsSaRouter shall pass an UNKNOWN_PORT status forward on dataOut with the untouched buffer, without forwarding it downstream.Unit Test
SVC-CCSDS-SDLS-SA-ROUTER-007The downstream port arrays shall share a single dimension set by a constant in the component configuration module; the SA-map array dimension shall be an independent config constant.Inspection
SVC-CCSDS-SDLS-SA-ROUTER-008Downstream crypto components connected to saDataOut/saDataReturnOut shall invoke saDataIn/saBufferReturnIn synchronously on the caller's thread (i.e. be passive with synchronous handlers). Asynchronous (queued or hardware-backed) crypto components must not be connected to these ports without adding external synchronization.Unit Test / Inspection

See Also