Repository navigation
Answer a flooded post or command with a fresh path, so rooms and repeaters recover a broken one 🤖🤖 - #3935
Answer a flooded post or command with a fresh path, so rooms and repeaters recover a broken one 🤖🤖#3935hamsolodev wants to merge 3 commits into
Conversation
A member floods a post when it has no path to the room, as clients do once their path has failed. The room still ACKed the post, and sent a command's reply, down the out_path it held, often that same broken path, so the ACK never arrived and pushes kept going down it too. When a post or command comes by flood, forget the stored out_path and answer with a flooded PATH return (carrying the ACK, for a post), as BaseChatMesh does for a flooded message. The member's reciprocal PATH then gives the room a fresh out_path.
An admin floods a command when it has no path to the repeater, as clients do once their path has failed, but the repeater sent its reply down the out_path it still held, so once that path broke no reply arrived. When a command comes by flood, forget the stored out_path, send a flooded PATH return ahead of the reply (carrying the ACK, for a legacy plain-text command), and flood the reply. The admin's reciprocal PATH gives the repeater a fresh out_path. Requests already answer a flood with PATH+RESPONSE.
With the PATH at 200 ms and the reply at 600, a repeater on the way often forwarded the PATH as the reply went out, or the reply waited and met the admin's reciprocal PATH there, so about one first reply in five was lost. Queue the reply with the PATH, so the two go out back to back before anything forwards either.
|
I've pushed a1a3fcf: a flooded command's reply now goes out with its PATH return, back to back, instead of 400 ms behind it. The smoke test's two missed replies were MeshBench's own. Its fixtures time frames at SF7 4/8 while the host builds run SF8 4/5, so its receiver model put the reply's start too early and dropped a frame that began 9 ms after another. With the fixture matched to the radios, every reply that came right behind another frame arrived. The real cost was smaller but there: 59 of 72 first replies arrived (12 seeds, 6 flooded commands each, one repeater away). The rest were lost when the repeater on the way forwarded the PATH just as the reply went out, or when the reply waited and then met the admin's reciprocal PATH at that repeater. Delaying the reply made it worse, as it lands on the reciprocal PATH: 5 of 72 at 1.7 s, 17 of 72 at 600 ms plus two PATH airtimes. Sent with the PATH, 72 of 72 arrived. The next command went direct 71 of 72 times; the other time the PATH was lost, and that command flooded and was answered. Stale-path recovery is unchanged (74 of 96 commands answered after the swap, 12 of 12 seeds), and airtime is +2.5%. Rerun at the new head with matched settings, the smoke test got 4 of 4 replies, and each next command went direct and was answered. Builds for the host and the RAK4631 and Heltec v3 repeaters and room servers show no new warnings under |
The problem. A room server ACKs a post, and a room or repeater replies to a CLI command, along the path it holds to the sender, even when the post or command came by flood (
examples/simple_room_server/MyMesh.cpp:495-511and:533on dev,examples/simple_repeater/MyMesh.cpp:848and:877). A client floods when it has no path, which is how it recovers once its path has broken. So once a repeater on the way goes, the room's ACKs and the repeater's replies keep going down the dead path and never arrive, and the room's pushes go the same way (simple_room_server/MyMesh.cpp:99). A flooded login or request is answered with a PATH return, which refreshes the path; a flooded post or command is not.The change. When a post or command comes by flood, forget the stored path and answer with a flooded PATH return, as
BaseChatMeshdoes for a flooded message (src/helpers/BaseChatMesh.cpp:256):The client takes the path and answers with its reciprocal PATH, which gives the room or repeater a fresh one. Direct posts and commands are handled as before.
Compatibility. Members' and admins' companions are unchanged: they already take a PATH return with or without an ACK in it (
BaseChatMesh::onContactPathRecv) and answer a flooded one with a reciprocal PATH (src/Mesh.cpp:173-178).Measured on MeshBench: room server and repeater v1.18.0 built against meshcore-native main, with companions and the repeaters on the way unchanged. Links are about 80% delivery a hop, and the unpatched arm was run twice to gauge noise. "Swapped" means the client's repeater on the way stopped mid-session and another took over.
The bench has no fading, the fixtures are small (1 to 4 repeaters, not a busy mesh), and I haven't run this on hardware.
Costs.
Related: #3260 floods the ACK for a retried message. This acts on any flooded post or command, and also replaces the stored path, so pushes and later replies stop using the dead one.
Checked on dev ae28381: built for the host and for the RAK4631 and Heltec v3 room servers and repeaters, with no new warnings under
-Wall -Wextra. Flash grows by 160 and 216 bytes for the room server (RAK4631, Heltec v3) and by 160 and 204 bytes for the repeater; RAM is unchanged.Smoke test on the host build: an unchanged v1.18.0 companion, one repeater away, reset its path and then flooded a post to the patched room and the command
verto the patched repeater (4 runs). Each answered with a flooded PATH, the room's carrying the ACK, and the companion's next post or command went direct and was answered. The repeater's reply first arrived in 2 of the 4 runs; both misses were MeshBench's, whose fixture timed frames at SF7 4/8 against the builds' SF8 4/5. Rerun with the reply sent with its PATH and the settings matched, 4 of 4 arrived. Unpatched dev (one run) answered along the held path with no PATH, and the next post or command flooded again.