Requesting Community Feedback: Refactoring the Downlink Interface #4885
thomas-bc
started this conversation in
Call for Comments
Replies: 2 comments
-
|
Great Idea! My team would definitely benefit from it! I think it would add flexibility for users to adopt a more CCSDS centric approach (if they so wished) while also allowing users to implement their own logic as needed |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Opened a feature request going in that direction: #4909 Decided to only include the PacketDescriptor for now (as opposed to full FrameContext object) to keep the interface simple and agnostic to the underlying Comms implementation. Clear contract, clear separation between App layer and Comms layer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello dear community!
The team has been slowly converging towards an idea, and we would like to share it with you and get your feedback on it.
In one sentence: we are considering refactoring
Svc.ComQueue's interface and removing the contract on data format, to make it easier for projects to define and use project-configurable APIDs, and simplifying the configuration.Background
The
Svc.ComQueueis a central component in our downlink stack. Application layer components that want to send data out of the system (e.g.TlmPacketizer,EventManager,FileDownlink, or project-specific components that want to send packets out to the radio) queue up messages throughSvc.ComQueue.Svc.ComQueuequeues up messages (of typeFw.BufferorFw.Com) and sends sends them to the radio, through the framers for framing. However, working with ComQueue is not straightforward, and it expects what one could call the "F Prime packet layout" (| PacketDescriptor | Payload |).Click to expand for a long tangent on more details on the current ComQueue... not essential to this proposal
How to setup a component to interface with
Svc.ComQueueis not super well documented, and relies on a process that has grown to be a bit complex, with needing to keep track port indices on ComQueue to assign priorities for different types of messages, needing to stamp out a PacketDescriptor token (==APID in CCSDS) at the front of the payload, etc. This is not ideal, and not user-friendly.In my view,
Svc.ComQueueis actually aSvc.FprimePacketQueue, where F Prime packet ==| PacketDescriptor | Payload |. ComQueue will only function if the data is laid out this way.We are also duplicating data in that the Packet Descriptor is repeated twice in each frame when using CCSDS: once in the Space Packet header (APID field), and once in the payload which is essentially an "F Prime Packet" format.
Historically, we've used the F Prime Protocol and a custom F Prime "packet" format (not much docs for that unfortunately, which is a big motivation for trying to clean that up and document it nicely), where PacketDescriptor tokens are stamped out at the front of the payload to indicate what kind of payload it is (telemetry, event, file etc.). This is essentially a very minimalistic implementation of a protocol stack, and we can draw equivalences with the CCSDS protocol stack. PacketDescriptor == Space Packet APID, F Prime Protocol == CCSDS Data Link Layer protocol (TC/TM/AOS/USLP).
When implementing the CCSDS protocols in F Prime, we've tried to introduce minimal breaking changes, and so we've encapsulated the F Prime "packet" within a CCSDS Space Packet. We've also re-used the
Svc.ComQueuecomponent so that the migration would be transparent to the user. We've built on top of existing infrastructure that is solid, and that is great. But that was at the cost of some redundancy and added complexity.The Proposal
I propose that we refactor the interface between the application layer and the Comms(Downlink) layer through a tweaked version of the
Svc.ComQueue, that I suggest we callSvc.DownlinkQueue(better name TBD?).Design Goals
Svc.DownlinkQueueshall be agnostic to the layout of the payload. It shouldn't even need to look at it, just pass it along.Fw.Bufferfor downlink by connecting toSvc.DownlinkQueue.payload: Fw.BufferandcontextData: ComCfg.FrameContextthat contains at least a PacketDescriptor (==APID in CCSDS) indicating the type/source of the payload. (see ComCfg.FrameContext)contextData: Users (i.e. component connecting toDownlinkQueue) shall be free to provide additional context (or hints ?) such as priority, Virtual Channel ID for CCSDS, etc. — with the understanding that different protocol implementations may or may not support that additional context.Proposed Changes
The main change is to pull that
contextData: ComCfg.FrameContextargument up to the application interface level. Today, the contextData is created within the ComQueue based on the payload token (which is basically an implicit version ofcontextData). It is not available to the user.I believe we should be able to leverage much of the existing Svc.ComQueue implementation, and just refactor the user interface along with queuing up the context object alongside the payload. Then, it can be passed down to the framers, which are already setup to use
ComCfg.FrameContextfor framing.Examples of what that would look like from the "user" side, for example in FileDownlink.cpp:
In projects, you could add APIDs to the ComCfg.Apid configuration, and send packets out just the same, with your project-configured APIDs.
This makes the system substantially easier to follow and extend:
Long term vision & possiblities
Jotting down a few thoughts:
sendPayloadWithApid()ports and thereceive_APID_xyz_handler()handlers. The above proposal is entirely compatible with this and is a step towards enabling this.Svc.DownlinkQueuetogether with theSvc.ApidManagerand theSpacePacketFramer/Deframerand this would provide exactly what the CCSDS standard defines as a "Space Packet Service" and "Octet String Service" (ref).Request for Feedback
I'm eager to get as much feedback as possible on this! I realize different organizations may have a different approach to all those things. So I'm curious to hear about your thoughts, if maybe there are things I overlooked, use-cases that aren't covered, etc.
A few specific questions for the community:
CC'ing a few people that may be interested
@Willmac16 @etiennecollin @gmarchetx @keck-in-space @timcanham @LeStarch
Beta Was this translation helpful? Give feedback.
All reactions