Closed thanasipantazides closed 11 months ago
Maybe the header should be <source system><data size><subframe counter>
, with <data size>
taking the max possible value (1024 or something) for most packets, but can determine the last subframe's content size from this header value (don't need to guarantee that the pad character at end of unfull subframe is different from last character(s) of frame).
The calling context (i.e. not Fragmenter
) should prepend the <source system>
field.
More info: TCP and UDP can fragment and reform packets smaller than some MTU size. MTU size over Ethernet is required to be at least 576 B by IPv4 standard. It could be larger (up to 65535 B minus header size) if the underlying hardware/socket interfaces support it, but that is not a given. So should check with TM.
If all onboard systems produce parsable frames smaller than MTU size for the flight system, can let the underlying network stack implement frame fragmentation. Otherwise we need to write something.
The trouble
Originally, this design presumed one parseable frame was less than an Ethernet packet (1.5 kB). But we know now that some frames are ~32 kB, and must be parsed on the ground as a single block.
Each such frame will be read in one block out of the supplying detector system. But, before downlinking, we must add a layer to segment the block. Segmentation implies:
<source system><subframe counter>
. This way, regardless of the arrival order of packets, we can sort by source system hex code, then subframe counter, and reassemble complete frames to parse.Leaning towards using fixed-length packets to send subframes. This incurs low overhead and is more robust than trying to find a unique delimiter that will not appear in any detector's data stream. Only the final subframe Ethernet packet for a given frame will waste downlink capacity.
Note that on the ground, packets should arrive in one piece (not TCP). So the packet-to-packet boundaries should be clear when reading from the ground socket.