Skip to content

Cfdp rework#91

Draft
hunter-esi wants to merge 18 commits into
masterfrom
cfdp_rework
Draft

Cfdp rework#91
hunter-esi wants to merge 18 commits into
masterfrom
cfdp_rework

Conversation

@hunter-esi

@hunter-esi hunter-esi commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Reworks cfdp to be handled by 4 queues and 2 separate threads, based on the example implementation in the cfdp package.

  • put_req_queuesends put requests to the source handler, being either new put requests originating on the satellite or transactions within a larger operation, e.g. the second two transactions of a proxy put request.
  • _cfdp_tm_queue is the queue of pdus that should be sent to the ground station from both the source and dest handlers.
  • _cfdp_src_queue and _cfdp_dest_queue are the queues received pdus, once they have been taken out of the uslp frame and the destination has been determined.

In addition, I have modified ThirteenFish's preliminary cfdp unit test file so that it now contains unit tests for sending a file from the "ground station" to the satellite, sending the same file but with the EOF ack getting dropped, sending a proxy put request (and the corresponding 2 addition transactions), and sending a cfdp directory listing request (and the corresponding two additional transactions).

The cachestore has been modified to allow successful directory listing requests, although I do not like the current implementation as it has to hack around the oresat_file naming conventions to have the directory list file preserved between the first two transactions. CFDP is also only able to access the fwrite cache, so I think that cachestore should be rewritten to allow sub directories and also to handle this case much more cleanly.

At present, the following issues mean that this is not ready to be merged. I will not have much time to fix the in the immediate future, and so contributions by those interested to resolve them would be appreciated.

  • The c3 software talking to YAMCS (on the same computer) successfully completes the first two transactions of a proxy put or directory listing request, but fails the third and final transaction.
  • Suspension of the current transaction can lead to cfdp sending endless cancel pdus.
  • The directory listing request sends the result of an ls -al command, which yamcs cannot handle and therefore YAMCS can never read the directory listing file. The file should be redefined to be compatible with YAMCS.
  • It should be possible to optimize the power use of the cfdp threads, either by making the cfpd threads sleep until the c3-state becomes EDL, or by tuning the sleep timeouts.

… close to being finished, but I will be modifying this allong the way so it should be representative of the current implementation.
…tively simple class, and DestHandler and SrcHandler should be new classes / threads handling cfdp's in out. The current implementation tries to put them all into a cfdp user class, with no threading so they're executed immediately every time.

This commit steals most of common.py from the cfdp-cli-udp example. I will be reworking it to match our needs.
…ings in a similar way to how we already do. This is being changed to only exist in the CfdpUser Class, which will have 2 instances.
…aseline for the final implementation after implementng dropped ack, proxy put, and directory request test cases.
…ce handler doesn't resend EoFs if its received a finished PDU?
…dled upstream is wrong, as there should be an EOF sent before the transaction is complete.
…pping the threads before waiting for them to join. Still need to make the netowrk threads behave better on shutdown.
…e. Unit test seems to work, except for the fact that the VFS tries to use the local directory for both the ground and the s/c, resulting in the s/c trying to send an empty file after the ground overwrites it. Think dir operations work, need to chnage how handlers use vfs though.
A major issue is that the file that YAMCS requests is not handled well by the cachestore, and so we are left with the choices of either having the cachestore hardcoded to look for .dirlist* files or rewriting a large amount of the logic for the upstream package.
put requests finish, unless the filename is incorrect. This should instead return some kind of error or do something other than endlessly NaKing.

Proxy put requests finish the first two transactions, then the proxy [put response fails.

Directory Listings finish the first two transactions, but yamcs doesn't seem to like the directory listing file we send down so we need to format it differently. Like the proxy put, the response fails.
@hunter-esi hunter-esi linked an issue Jun 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CFDP Implementation Rework

2 participants