Back to Fprime

Svc::Ccsds::AosDeframer

Svc/Ccsds/AosDeframer/docs/sdd.md

4.3.05.5 KB
Original Source

Svc::Ccsds::AosDeframer

The Svc::Ccsds::AosDeframer is an implementation of the DeframerInterface for the CCSDS AOS Space Data Link Protocol.

It receives fixed-size AOS transfer frames on its input and extracts the packets contained in the frame data zone (M_PDU), emitting each complete packet on its output port. Please refer to the CCSDS AOS specification (CCSDS 732.0-B-5) for details on the frame format and protocol.

The Svc::Ccsds::AosDeframer is designed to work in the common F Prime uplink stack, receiving frame data from an upstream Svc::FrameAccumulator or communications adapter and passing extracted packets downstream, commonly to a Svc::Ccsds::SpacePacketDeframer or a router. It is the receive-side counterpart of the Svc::Ccsds::AosFramer.

AOS Deframing Support

The AOS Deframer supports the following subset of CCSDS AOS SDL:

  • A single accepted virtual channel (NumVcs = 1), configured via the configure() function
  • M_PDU (Multiplexing PDU) data field service, including packets spanning multiple frames
  • Optional Frame Error Control Field (FECF) verification per Section 4.1.6
  • Space Packet Protocol (SPP) extraction per CCSDS 133.0-B-2 and Encapsulation Packet Protocol (EPP) extraction per CCSDS 133.1-B-3, individually enabled via a packet-version-number (PVN) mask
  • Idle frame and idle packet discard
  • VC frame count continuity checking with gap detection

Space Data Link Security (SDLS), the Transfer Frame Insert Zone, and the Frame Header Error Control Field are not supported.

Internals

The deframer validates each incoming frame header: Transfer Frame Version Number, Spacecraft ID, Virtual Channel ID, frame length, and (when enabled) the FECF CRC. Invalid frames are dropped with a corresponding event and, when connected, a notification on the errorNotify port.

For each valid frame, the M_PDU First Header Pointer (FHP) is used to locate packet boundaries within the data zone. Complete packets are emitted directly. When a packet spans multiple frames, the deframer allocates a buffer through its BufferAllocation interface (allocate/deallocate ports), accumulates the packet across successive frames, and emits it when complete. A frame count gap, an invalid FHP, or an allocation failure causes any in-progress spanning packet to be abandoned and reported via events.

Ownership of incoming frame buffers is returned to the sender via the dataReturnOut port; downstream consumers return emitted packet buffers via the dataReturnIn port, which the deframer deallocates when it owns them (spanning-packet buffers) or passes back upstream otherwise.

Configuration

The configure() function must be called before any frames are processed:

cpp
deframer.configure(
    fixedFrameSize,          // Fixed size of AOS frames in bytes (Section 4.1.1)
    frameErrorControlField,  // Whether the FECF is present (Section 4.1.6)
    spacecraftId,            // Accepted 10-bit spacecraft ID (default: ComCfg::SpacecraftId)
    vcId,                    // Accepted 6-bit virtual channel ID (default: 0)
    pvnMask                  // Bitmask of PVNs to extract (SPP and EPP enabled by default)
);

Port Descriptions

KindNamePort TypeDescription
guarded inputdataInSvc.ComDataWithContextReceives framed AOS data (VC_RECEIVE.indication, Section 3.4.3.2)
outputdataOutSvc.ComDataWithContextOutputs extracted packets with context
outputdataReturnOutSvc.ComDataWithContextReturns ownership of received frame buffers to the sender
sync inputdataReturnInSvc.ComDataWithContextReceives back ownership of emitted packet buffers
outputerrorNotifyCcsds.ErrorNotifyNotifies a connected component of deframing errors
outputallocateFw.BufferGetAllocates buffers for packets spanning multiple frames
outputdeallocateFw.BufferSendDeallocates spanning-packet buffers

Events

EventSeverityDescription
InvalidSpacecraftIdwarning lowFrame SCID does not match the configured SCID
InvalidFrameLengthwarning highFrame length does not match the configured fixed frame size
InvalidVcIdactivity lowFrame VCID is not in the accepted set
InvalidFecfwarning highFECF (CRC) check failed
InvalidTfvnwarning highInvalid Transfer Frame Version Number
DisabledPvnwarning highPacket version number invalid or disabled by configuration
IdleFrameactivity lowFrame contained only idle data
SpanningPacketAllocFailedwarning highBuffer allocation for a spanning packet failed; packet dropped
VcFrameCountGapwarning highDiscontinuity detected in the VC frame count sequence
SpanningPacketAbandonedwarning highA spanning packet was abandoned before completion
InvalidFhpwarning highFirst Header Pointer exceeds the data zone size

Telemetry

ChannelTypeDescription
LatestVcFrameCountU32Latest VC frame count received from the frame header
FramesProcessedU32Frames processed per virtual channel
PacketsExtractedU32Packets extracted per virtual channel
CrcErrorCountU32FECF (CRC) errors per physical channel