[Feature request] Let a repeater ask its neighbors which packets they have
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Domaine
- embedded-iot, networking
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C
- Étoiles
- 3.9k
- Forks
- 1.5k
- Merge moyen
- 2 j 19 h
- PR mergées (30 j)
- 61
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de meshcore-dev/MeshCore
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
meshcore-dev/MeshCore#4015 ·
Les mainteneurs répondent en général sous 2 jours
-
CMD_SET_DEFAULT_FLOOD_SCOPE leaves an older, longer name's tail after the new namePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
meshcore-dev/MeshCore#3891 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
meshcore-dev/MeshCore#3826 ·
Les mainteneurs répondent en général sous 2 jours
-
App Preset Australia: NTOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
meshcore-dev/MeshCore#3825 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
meshcore-dev/MeshCore#3781 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de meshcore-dev/MeshCore
Issues similaires
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
389ds/389-ds-base#8251 ·
Les mainteneurs répondent en général sous 1 jour
-
bug data-types
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/clickhouse-cpp#645 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
ROCm/hrx-system#3628 ·
Les mainteneurs répondent en général sous 1 jour