[Feature request] Let a repeater ask its neighbors which packets they have
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
Read the linked gist’s C++ header, host test, and simple_repeater hook sketch, then trace wasSeen in SimpleMeshTables and how discovery control packet sub-types are handled. The issue describes a report format and replay results, but firmware behavior has not been built or tested. Done means agreeing on whether and how to add the feature, implementing it in firmware, and validating packet handling and neighbor counts.
由索引模型根据 Issue 内容生成。
描述
In #3991 I compared the packet logs of two of my repeaters, A and B, and found that A can't tell from overheard echoes whether B is receiving it. B's receiver was half deaf for a day and A's view of it barely changed. #3315 asks for the neighbor list to show only links that work both ways, and #3937 has repeaters going slowly deaf while still transmitting, with the question "Is there a way for me to tell if receive is reducing?" I think a repeater's neighbors can answer that with one small packet, and I'd like to know if you'd take it before I write a PR.
A repeater already keeps the hashes of the last 160 packets it received or sent, to drop duplicates. On request it would send its neighbors the first two bytes of the newest 16 of those, as a zero-hop control packet. The neighbor that asked checks the list against the flood packets it forwarded in the last few minutes and counts how many are in it. neighbors could then show that count beside the SNR. Nothing acts on it. It's a number for whoever is looking after the repeater.
It uses the control packet that discovery uses, with the next free sub-type. Current repeaters, sensors, and room servers ignore a sub-type they don't know.
| Field | Bytes | |
|---|---|---|
| flags | 1 | 0xA in the upper 4 bits. Bit 0 set means the list is everything since start. |
| sequence | 1 | 0 for the first report since start, then 1 to 255 and around |
| reporter | 4 | first 4 bytes of the reporter's public key |
| entries | 2 each | first 2 bytes of each packet hash, oldest first |
Sixteen entries make a 38-byte payload, about 0.2 s on the air at the US preset. There are no timestamps in it because repeater clocks can't be trusted. The asking side dates the list with its own clock, from the oldest entries in it that it also saw, and judges only packets it first heard after that.
#3630 adds sequence numbers so a destination can count lost direct packets. This is for flood traffic between neighboring repeaters, and it doesn't change any existing packet.
What I tested first is the logic, in Python and in C++, by replaying my repeaters' logs with a report every 15 minutes. On the four days from #3991 the count followed what B's own log shows it had, block by block. In the worst six hours B had 45.6% of what A forwarded and the count said 45.6%. That agreement is less impressive than it looks, since both numbers come from B's log. What it does show is that A picks the right packets to judge without a shared clock, including through a real fault.
The count is of packets B ended up with, from anyone. That is the number that matters for flooding, and it is a different thing from the quality of the link from A to B. When I made a healthy receiver lose 30% of the copies it heard, it still ended up with 93% of the packets, because it hears several repeaters, and the count said 93%. A receiver that hears almost nothing but A dropped to 72%. With everything removed the count goes to zero at the next report.
Since then it has been on the air for 39 hours between four of my own repeaters, sent and judged by a script beside openHop on each Pi. It has not run in firmware. They sent 590 reports. The repeater on my roof received 432 of the 441 sent by the other three, one of which is 2.4 miles away, and the slowest took 1.5 s from being built to being received. Of 5,729 packets it forwarded and then judged, 5,721 were in the next report from the neighbor it was judging. I looked up the other 8 in the neighbors' own logs. Five really were missing. The other three are a single packet that all three neighbors had received. Each had also logged the same hash 87 minutes before, and my script leaves a repeated hash at its old place in the list, so it was no longer among the newest 16. The firmware's table looks like it does the same, since wasSeen in SimpleMeshTables returns on a match without adding the hash again, but I haven't traced every caller. All four repeaters are healthy and hear each other well, so this only shows the packet gets through and the bookkeeping holds up on a real channel.
Then I gave one of the two repeaters I keep indoors a receive fault by tuning its receiver 15.75 kHz off the channel for half an hour. The roof repeater forwarded 17 packets in that time. The faulted one received 4 of them and the one beside it received all 17. From the faulted one's reports the roof repeater counted 4 of 15, and from the other's 12 of 12, and all 15 answers match the faulted repeater's own log. The count was still 14 of 15 on the report that went out a minute after the fault began and showed the drop on the next one, 16 minutes in. That is one fault on one unit and a small number of packets.
The report isn't signed, and a companion app can already send any control packet, so the count shouldn't drive anything automatic. Companions pass control packets up to the app, so apps would start seeing a sub-type they don't know. My phone showed each one as a line in the MeshCore app's RX log and nowhere else. On a busy channel 16 entries cover very little. In the replays, at about 45 forwards an hour, they covered 82% of what A sent. On the air, at about 97 an hour, they covered half. In a synthetic run at 400 an hour they covered 13% (the count stayed right, on fewer packets). The timing margins are set for the US preset and would need to scale for slower ones. The C++ is about 3.3 KB of RAM for 8 neighbors with no floating point. I haven't measured flash.
Code is at https://gist.github.com/captinjack99/d64fedfab723562f6e6cc8e200e5925b: the reference in Python, a C++ header with a host test that checks it against the Python on about 7,500 reports, and a sketch of the hooks in simple_repeater, read against dev and not built.
In that test each unit sends a report every 15 minutes without being asked, which is about 0.02% airtime each. That would also catch a repeater nobody is watching. In firmware I'd leave it off by default, or out, whichever you prefer.
- 主要语言
- C
- 星标
- 3.9k
- 派生
- 1.5k
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 61
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
meshcore-dev/MeshCore 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
meshcore-dev/MeshCore#4015 ·
维护者通常 2 天内回复
-
CMD_SET_DEFAULT_FLOOD_SCOPE leaves an older, longer name's tail after the new name可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
meshcore-dev/MeshCore#3891 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
meshcore-dev/MeshCore#3826 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
meshcore-dev/MeshCore#3825 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
meshcore-dev/MeshCore#3781 ·
维护者通常 2 天内回复
查看 meshcore-dev/MeshCore 的全部 Issue
相似的 Issue
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBuffer未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
needs triage
难度 2/5 1-3 小时 新手友好度 72/100
389ds/389-ds-base#8251 ·
维护者通常 1 天内回复
-
bug data-types
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/clickhouse-cpp#645 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ROCm/hrx-system#3628 ·
维护者通常 1 天内回复