Skip to content

Commit 75bd1af

Browse files
Tighten com protocol sdds (#5017)
* Tighten ComQueue protocol definition across com-stack SDDs Clarify that Fw::Success::SUCCESS is valid in exactly three contexts: 1. At start-up to initiate data flow 2. In response to a successfully transmitted message 3. After a previous Fw::Success::FAILURE to indicate recovery Updated SDDs and docs for: - Communication Adapter Interface (core protocol reference) - ComQueue - ComAggregator - ComStub - FprimeFramer - TmFramer - AosFramer - ComRetry - Svc Interfaces - How-to guides (radio manager, custom framing) Closes #5005 Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov> * Remove incorrect data. * Add 'interoperate' to spell-check expect list Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov> * Fix relative link depth for CCSDS framer docs (4 levels, not 3) Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent edb3f1b commit 75bd1af

12 files changed

Lines changed: 63 additions & 42 deletions

File tree

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ initstate
352352
inkscape
353353
inorder
354354
installable
355+
interoperate
355356
intlimits
356357
inttypes
357358
INVALIDBUFFER

Svc/Ccsds/AosFramer/docs/sdd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ The `Svc::Ccsds::AosFramer` uses an internal (member) buffer to hold the fixed s
3434
| output | dataOut | Svc.ComDataWithContext | Outputs framed data with optional context |
3535
| output | dataReturnOut | Svc.ComDataWithContext | Returns ownership of the incoming Fw::Buffer to its sender once framing is handled |
3636
| sync input | dataReturnIn | Svc.ComDataWithContext | Receives buffer from a deallocate call in a ComDriver component |
37-
| sync input | comStatusIn | Fw.SuccessCondition | Receives general status from downstream component indicating readiness for more input |
38-
| output | comStatusOut | Fw.SuccessCondition | Indicates the status of framer for receiving more data |
37+
| sync input | comStatusIn | Fw.SuccessCondition | Receives status from downstream communication adapter per the [Communication Adapter Protocol](../../../../docs/reference/communication-adapter-interface.md#communication-adapter-protocol) |
38+
| output | comStatusOut | Fw.SuccessCondition | Passes status through to upstream `Svc::ComQueue` per the [Framer Status Protocol](../../../../docs/reference/communication-adapter-interface.md#framer-status-protocol) |

Svc/Ccsds/TmFramer/docs/sdd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ For each frame generated, the `Svc::Ccsds::TmFramer` will populate the CCSDS TM
4242
| output | dataOut | Svc.ComDataWithContext | Outputs framed data with optional context |
4343
| output | dataReturnOut | Svc.ComDataWithContext | Returns ownership of the incoming Fw::Buffer to its sender once framing is handled |
4444
| sync input | dataReturnIn | Svc.ComDataWithContext | Receives buffer from a deallocate call in a ComDriver component |
45-
| sync input | comStatusIn | Fw.SuccessCondition | Receives general status from downstream component indicating readiness for more input |
46-
| output | comStatusOut | Fw.SuccessCondition | Indicates the status of framer for receiving more data |
45+
| sync input | comStatusIn | Fw.SuccessCondition | Receives status from downstream communication adapter per the [Communication Adapter Protocol](../../../../docs/reference/communication-adapter-interface.md#communication-adapter-protocol) |
46+
| output | comStatusOut | Fw.SuccessCondition | Passes status through to upstream `Svc::ComQueue` per the [Framer Status Protocol](../../../../docs/reference/communication-adapter-interface.md#framer-status-protocol) |
4747

4848
## Requirements
4949

@@ -56,7 +56,7 @@ For each frame generated, the `Svc::Ccsds::TmFramer` will populate the CCSDS TM
5656
| SVC-Ccsds-TM-FRAMER-004 | The TmFramer shall output the constructed TM Transfer Frame via its `dataOut` port. | Unit Test |
5757
| SVC-Ccsds-TM-FRAMER-005 | The TmFramer shall return ownership of the input buffer via the `dataReturnOut` port after the framing process is complete. | Unit Test |
5858
| SVC-Ccsds-TM-FRAMER-006 | The TmFramer shall accept returned buffers (previously sent via `dataOut`) through the `dataReturnIn` port for deallocation or reuse. | Unit Test |
59-
| SVC-Ccsds-TM-FRAMER-007 | The TmFramer shall receive communication status from downstream components via the `comStatusIn` port, and pass it through to `comStatusOut` | Unit Test, Integration Test |
59+
| SVC-Ccsds-TM-FRAMER-007 | The TmFramer shall receive communication status from downstream components via the `comStatusIn` port and pass it through to `comStatusOut`, including the initial start-up `Fw::Success::SUCCESS`, per-message statuses, and any recovery `Fw::Success::SUCCESS` after a `Fw::Success::FAILURE`, per the [Framer Status Protocol](../../../../docs/reference/communication-adapter-interface.md#framer-status-protocol) | Unit Test, Integration Test |
6060
| SVC-Ccsds-TM-FRAMER-008 | The TmFramer shall use exactly one Virtual Channel. | Unit Test, Integration Test |
6161
| SVC-Ccsds-TM-FRAMER-009 | The TmFramer shall correctly populate all mandatory fields of the TM Transfer Frame Primary Header, including Transfer Frame Version Number, Spacecraft Identifier, Virtual Channel Identifier, Operational Control Field Flag, Master Channel Frame Count, Virtual Channel Frame Count, Transfer Frame Secondary Header Flag, Synchronization Flag, Packet Order Flag, Segment Length Identifier, and First Header Pointer. | Unit Test, Inspection |
6262
| SVC-Ccsds-TM-FRAMER-010 | The TmFramer shall be configurable with a Spacecraft Identifier. | Inspection, Unit Test |

Svc/ComAggregator/docs/sdd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Aggregates buffers in the downlink chain. This is for use with systems that have
1313
| Svc-ComAggregator-002 | ComAggregator shall hold the incoming buffer when there is insufficient space in the aggregate buffer. | Unit-Test |
1414
| Svc-ComAggregator-003 | ComAggregator shall send the current aggregate buffer when the incoming buffer is held due to overflow. | Unit-Test |
1515
| Svc-ComAggregator-004 | ComAggregator shall send the current aggregate buffer when it receives a timeout trigger if and only if the aggregate is non-empty. | Unit-Test |
16-
| Svc-ComAggregator-005 | ComAggregator shall clear aggregation state when a SUCCESS communication status is received back. | Unit-Test |
16+
| Svc-ComAggregator-005 | ComAggregator shall clear aggregation state when a `Fw::Success::SUCCESS` communication status is received back. | Unit-Test |
1717
| Svc-ComAggregator-006 | ComAggregator shall preserve the order of received buffers when forming each aggregate and across aggregate sends. | Unit-Test |
18-
| Svc-ComAggregator-007 | ComAggregator shall inter operate with the [Communication Adapter Interface comStatus protocol](../../../docs/reference/communication-adapter-interface.md) | Unit-Test |
18+
| Svc-ComAggregator-007 | ComAggregator shall interoperate with the [Communication Adapter Interface protocol](../../../docs/reference/communication-adapter-interface.md). Specifically, it shall pass through `Fw::Success::SUCCESS` and `Fw::Success::FAILURE` statuses per the [Framer Status Protocol](../../../docs/reference/communication-adapter-interface.md#framer-status-protocol), including the initial start-up SUCCESS and any recovery SUCCESS following a FAILURE. | Unit-Test |
1919

2020

2121
## Design

Svc/ComQueue/docs/sdd.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1. Introduction
44

5-
`Svc::ComQueue` is an F´ active component that functions as a priority queue of buffer types. Messages are dequeued and forwarded in order of priority when a `Fw::Success::SUCCESS` signal is received. Receiving a `Fw::Success::FAILURE` results in the queues being paused until a following `Fw::Success::SUCCESS` is received.
5+
`Svc::ComQueue` is an F´ active component that functions as a priority queue of buffer types. Messages are dequeued and forwarded in order of priority when a `Fw::Success::SUCCESS` signal is received on the `comStatusIn` port. `Fw::Success::SUCCESS` is accepted in three contexts: (1) at start-up to initiate data flow, (2) in response to a previously sent message, and (3) after a previous `Fw::Success::FAILURE` to indicate recovery. Receiving a `Fw::Success::FAILURE` results in the queues being paused until a subsequent `Fw::Success::SUCCESS` is received.
66

77
`Svc::ComQueue` is configured with a queue depth and queue priority for each incoming `Fw::Com` and `Fw::Buffer` port by passing in a configuration table at initialization.
88
Queued messages from the highest priority source port are serviced first and a round-robin algorithm is used to balance between ports of shared priority.
@@ -12,10 +12,11 @@ Queued messages from the highest priority source port are serviced first and a r
1212
## 2. Assumptions
1313

1414
1. Incoming buffers to a given port are in priority order
15-
2. Data is considered to be successfully sent when a `Fw::Success::SUCCESS` signal was received
16-
3. The com adapter is responsible for any retransmission of failed data
15+
2. Data is considered to be successfully sent when a `Fw::Success::SUCCESS` signal is received in response to that data
16+
3. The communication adapter is responsible for any retransmission of failed data and for emitting a recovery `Fw::Success::SUCCESS` after a failure
1717
4. The system includes downstream components implementing the
1818
[communications adapter](../../../docs/reference/communication-adapter-interface.md)
19+
5. An initial `Fw::Success::SUCCESS` will be received on `comStatusIn` to initiate data flow (typically at start-up or driver connection)
1920

2021

2122
## 3. Requirements
@@ -24,10 +25,10 @@ Queued messages from the highest priority source port are serviced first and a r
2425
| Requirement | Description | Rationale | Verification Method |
2526
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|---------------------|
2627
| SVC-COMQUEUE-001 | `Svc::ComQueue` shall queue `Fw::Buffer` and `Fw::ComBuffer` received on incoming ports. | The purpose of the queue is to store messages. | Unit Test |
27-
| SVC-COMQUEUE-002 | `Svc::ComQueue` shall output exactly one `Fw::Buffer` (wrapping the queued data units) on a received `Fw::Success::SUCCESS` signal. | `Svc::ComQueue` obeys the communication adapter interface protocol. | Unit Test |
28-
| SVC-COMQUEUE-003 | `Svc::ComQueue` shall pause sending on the `Fw::Success::FAILURE` and restart on the next `Fw::Success::SUCCESS` signal. | `Svc::ComQueue` should not sent to a failing communication adapter. | Unit Test |
28+
| SVC-COMQUEUE-002 | `Svc::ComQueue` shall output exactly one `Fw::Buffer` (wrapping the queued data units) on a received `Fw::Success::SUCCESS` signal. `Fw::Success::SUCCESS` is valid at start-up (to initiate flow), in response to a sent message, or after a previous `Fw::Success::FAILURE` (to indicate recovery). | `Svc::ComQueue` obeys the [communication adapter interface protocol](../../../docs/reference/communication-adapter-interface.md#communication-queue-protocol). | Unit Test |
29+
| SVC-COMQUEUE-003 | `Svc::ComQueue` shall pause sending on `Fw::Success::FAILURE` and resume on the next `Fw::Success::SUCCESS` signal. | `Svc::ComQueue` should not send to a failing communication adapter. | Unit Test |
2930
| SVC-COMQUEUE-004 | `Svc::ComQueue` shall have a configurable number of `Fw::Com` and `Fw::Buffer` input ports. | `Svc::ComQueue` should be adaptable for a number of projects. | Inspection |
30-
| SVC-COMQUEUE-005 | `Svc::ComQueue` shall select and send the next priority `Fw::Buffer` and `Fw::ComBuffer` message in response to `Fw::Success::SUCCESS`. | `Svc::ComQueue` obeys the communication adapter interface protocol. | Unit test |
31+
| SVC-COMQUEUE-005 | `Svc::ComQueue` shall select and send the next priority `Fw::Buffer` and `Fw::ComBuffer` message in response to `Fw::Success::SUCCESS`. | `Svc::ComQueue` obeys the [communication adapter interface protocol](../../../docs/reference/communication-adapter-interface.md#communication-queue-protocol). | Unit test |
3132
| SVC-COMQUEUE-006 | `Svc::ComQueue` shall periodically telemeter the number of queued messages per-port in response to a `run` port invocation. | `Svc::ComQueue` should provide useful telemetry. | Unit Test |
3233
| SVC-COMQUEUE-007 | `Svc::ComQueue` shall emit a queue overflow event for a given port when the configured depth is exceeded. Messages shall be discarded. | `Svc::ComQueue` needs to indicate off-nominal events. | Unit Test |
3334
| SVC-COMQUEUE-008 | `Svc::ComQueue` shall implement a round robin approach to balance between ports of the same priority. | Allows projects to balance between a set of queues of similar priority. | Unit Test |
@@ -78,6 +79,8 @@ buffer is received. `FAILURE` statuses keep the `Svc::ComQueue` in `WAITING` sta
7879
either send a buffer and transition to `WAITING` or will have no buffers to send and will transition into `READY` state.
7980
Buffers are queued when in `WAITING` state.
8081

82+
`Fw::Success::SUCCESS` triggers a transition from `WAITING` to either `WAITING` (if a buffer was sent) or `READY` (if no buffers are queued). This SUCCESS is valid in three contexts per the [Communication Queue Protocol](../../../docs/reference/communication-adapter-interface.md#communication-queue-protocol): at start-up, in response to a sent message, or after a previous FAILURE indicating recovery.
83+
8184
![`Svc::ComQueue` Functional State Machine](./img/state-machine.png)
8285

8386
### 4.3 Model Configuration

Svc/ComRetry/docs/sdd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1. Introduction
44

5-
The `Svc::ComRetry` component forwards messages from upstream to downstream components, resending messages on failure. Any topology requiring retry capabilities must place this component in the pipeline before a `ComStub` or `Radio` component. This component expects a `ComStatus` response. It acts as a pass-through component in case of a successful delivery, i.e. when it receives `Fw::Success::SUCCESS`. On receiving `Fw::Success::FAILURE`, it resends the message until it exceeds the maximum number of retries.
5+
The `Svc::ComRetry` component forwards messages from upstream to downstream components, resending messages on failure. Any topology requiring retry capabilities must place this component in the pipeline before a `ComStub` or `Radio` component. This component expects a `ComStatus` response per the [Communication Adapter Protocol](../../../docs/reference/communication-adapter-interface.md#communication-adapter-protocol). It acts as a pass-through component in case of a successful delivery, i.e. when it receives `Fw::Success::SUCCESS`. On receiving `Fw::Success::FAILURE`, it resends the message until it exceeds the maximum number of retries. After all retries are exhausted, it emits `Fw::Success::FAILURE` upstream, and the downstream communication adapter is responsible for eventually emitting a recovery `Fw::Success::SUCCESS` to resume data flow.
66

77
`Svc::ComRetry` can be used alongside the other F´ communication components (`Svc::Framer`, `Svc::Deframer`, `Svc::ComQueue`).
88

@@ -14,7 +14,7 @@ The `Svc::ComRetry` component forwards messages from upstream to downstream comp
1414
| SVC-COMRETRY-002 | `Svc::ComRetry` shall store `Fw::Buffer` and its context on receiving buffer ownership through `dataReturnIn` | Store the buffer in case a retry is required | Unit test |
1515
| SVC-COMRETRY-003 | `Svc::ComRetry` shall pause delivery on receiving `Fw::Success::FAILURE` | `Svc::ComRetry` should not send to a failing communication adapter. | Unit test |
1616
| SVC-COMRETRY-004 | `Svc::ComRetry` shall resend `Fw::Buffer` on receiving `Fw::Success::SUCCESS` after prior failure if retries are available | Retry delivery of buffer | Unit test |
17-
| SVC-COMRETRY-005 | `Svc::ComRetry` shall simply pass the status upstream when the buffer is not initialized | No buffer has been passed down the stack to `Svc::ComRetry` yet | Unit test |
17+
| SVC-COMRETRY-005 | `Svc::ComRetry` shall pass through the initial start-up `Fw::Success::SUCCESS` and any non-data statuses upstream when no buffer is pending | The initial SUCCESS must reach `Svc::ComQueue` to initiate data flow per the [Communication Queue Protocol](../../../docs/reference/communication-adapter-interface.md#communication-queue-protocol) | Unit test |
1818
| SVC-COMRETRY-006 | The maximum number of retries shall be configurable | The number of retries should be adaptable for projects | Inspection |
1919
| SVC-COMRETRY-007 | `Svc::ComRetry` shall return buffer ownership to the upstream component on receiving `Fw::Success::SUCCESS` or after all retry attempts fail | Memory management | Unit Test |
2020
| SVC-COMRETRY-008 | `Svc::ComRetry` shall send `ComStatus` upstream on successful delivery or after all retry attempts fail | Status of message delivery must be passed up the stack | Unit Test |

0 commit comments

Comments
 (0)