mavlink/mavlink-devguide

How does burst mode work for FTP?

hamishwillee opened this issue · 9 comments

How does Burst ReadFile operations/streaming work?

I know that for normal reads, the file is read in chunks, with an ACK before each new chunk is sent. My guess is that for BurstReadFile the file is chunked and sent without waiting for a request - so basically you just send a stream of ACKs, with sequentially incremented sequence numbers. When you've sent everything you send the last ACK with the burst mode complete field set.

  1. Is that correct?
  2. Presumably the recipient is in burst mode, so it is sitting waiting for a bunch of ACKs and re-assembles the message - correct?
  3. How is the recipient expected to cope with missing packets - it looks like after the burst is complete perhaps the recipient individually requests the missing packets - does it use a normal read/ACK process for that?

@bkueng @dayjaby This is a post I created back in 2018. Is this your understanding of burst mode? If so I can take a first shot at docs.

This is how it works on the high level:

  • client requests burst, which is acked
  • server sends individual chunks
  • client receives w/o acks until it sees that burstComplete is set, then requests next chunk
  • client requests individual missing chunks via non-burst normal reads

@bkueng Thanks! Is this correct then?

A few assumptions (reasonable)?

  1. The server decides the size of the chunks it wants to stream during burst, but the client (GCS) gets to decide the size it wants when filling in chunks. I assume it will normally use the maximum size
  2. The client needs to track the missing data chunks based on the offsets and data sent.
  3. There are timeouts for "not got a new packet" while waiting for a new burst payload.

Correct, looks good.

  • You might want to add another BurstReadFile for clarity, or at least mention there can be multiple (there's also an offset specified)
  • Can you use client and server (or similar) instead of GCS and Drone, to be more generic?

Thanks @bkueng

  • I have updated the image above #98 (comment) to use Client/Server and add offset to the final BurstRead call.
  • Where do you mean add an extra burst read? See the ones marked up below (I have updated the missing offset marked in circle above).
    image

PS @bkueng Conversations continues on PR: #445
That might need modification pending your answer to question above.

Where do you mean add an extra burst read? See the ones marked up below (I have updated the missing offset marked in circle above).

After the red arrow

@bkueng That's why I am confused. At this point burst_complete=1. Are you saying that even after complete the server will send BurstReadFile? If so, I presume that it specifies size=0 and an empty data buffer. How many times?

burst_complete=1 does not mean transfer complete. A server can split a transfer into multiple bursts. Let's discuss directly if not clear.