Repository navigation
File downloads: paced by the channel, with a real fallback to smaller blocks - #56
Merged
Merged
Conversation
…l fallback to smaller blocks - Blocks are sent when the last has left the channel's outbound queue (CommsCoreIF::outboundQueuedCount) and its transport is ready (outboundCanAccept), within the ack window, instead of one every 100 ms - The first block waits for the client's first dfAck (clients ack as soon as they are ready to receive), or 200 ms: a block sent straight after the reply to dfStart can reach a client before it has handled the reply - When nothing is acknowledged for 3 s the block size is halved (down to 64 bytes) before resending, in case the channel offers blocks its transport can't deliver - Blocks are marked as acknowledged by the protocol (CommsChannelMsg::setAckedByProtocol), so a transport needn't confirm each packet (BLE sends them as notifications) - test_file_download_okto Measured on an ESP32-S3 (Axiom): USB serial 320 kB/s (downloads of 5000-byte blocks failed before), WiFi 125 kB/s (48), BLE 50 kB/s (5), with the matching RaftSysMods and RaftWebServer changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
What changed
CommsCoreIF::outboundQueuedCount(), new) and the transport is ready (outboundCanAccept()), within the ack window.dfAck, or 200 ms. Without the 100 ms gap, a block sent straight after the reply todfStartcould reach a client before it had handled that reply, and clients ignore blocks for a download they have not set up (seen as a 3 s pause at the start of some WiFi downloads). Released raftjs already acks at once.CommsChannelMsg::setAckedByProtocol(): blocks are marked as covered by the protocol's own acks, so a transport need not confirm each packet (BLE uses notifications for them).Results (ESP32-S3 Axiom, with the matching RaftSysMods and RaftWebServer PRs)
A TinyS3 built without PSRAM gives 230 kB/s over serial and 44 kB/s over BLE.
Testing
linux_unit_tests: newtest_file_download_okto;make checkpasses.Notes
devdocs/file-transfer-flow-control.mdin raftpy.🤖 Generated with Claude Code