nasa / CF

The Core Flight System (cFS) CFDP application.
Apache License 2.0
79 stars 45 forks source link

Investigate whether TX and RX PDU sizes need to be different #19

Closed jphickey closed 6 months ago

jphickey commented 2 years ago

This issue was imported from the GSFC issue tracking system

Imported from: [GSFCCFS-1196] Investigate whether TX and RX PDU sizes need to be different Originally submitted by: Timmons, Elizabeth J. (GSFC-5820) on Mon Jul 20 13:37:06 2020

Original Description: Need to investigate uses cases where TX and RX PDU sizes need to be different. Need to investigate the impact of making a change to allow that.

skliper commented 6 months ago

TX and RX PDU sizes can be different. Transmit maximum size is configurable via table using outgoing_file_chunk_size as defined below. Note the actual TX PDU also includes the PDU header which is variable size. The CCSDS header also needs to be accounted for to get to the final size over the SB. https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/config/default_cf_tblstruct.h#L51-L52

CF_MAX_PDU_SIZE is defined in the interface header here, note this includes the PDU headers but not the CCSDS header: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/config/default_cf_interface_cfg.h#L94-L95

The outgoing_file_chunk_size is limited by this structure size: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/fsw/src/cf_cfdp_pdu.h#L371-L381

Note the comment below is actually misleading, since CF gets a buffer from SB and writes from the file to it directly: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/docs/dox_src/cfs_cf.dox#L460-L462

On the receive side the PDU is processed "in place", so it isn't restricted by local CF buffer sizes. There's a misleading comment here: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/docs/dox_src/cfs_cf.dox#L455-L458

Note that there is a structure defined below, but it's only used for size checking of outgoing_file_chunk_size and not directly: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/fsw/src/cf_cfdp_pdu.h#L371-L381

This comment is also wrong, since outgoing_file_chunk_size is common across channels: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/config/default_cf_interface_cfg.h#L87-L89

Also no longer applicable: https://github.com/nasa/CF/blob/27dcaf507f79631b1105dcf4a261d8ce60b6aedd/fsw/src/cf_cfdp_types.h#L413-L415