M
MeshTRX
All articles

A repeater doubles your range and divides the air

8 min read

A repeater looks like a simple device: hear a packet, repeat it. Descriptions usually stop there, and everything interesting starts afterwards — visible only on a working network. Below is how forwarding works in MeshTRX, what it costs, and why a network of three repeaters does not assemble itself.

Two defences against an avalanche

If a repeater simply repeats everything it hears, the network dies at the second device: two repeaters start repeating each other, and one packet circles until someone switches off. So there are two defences, and they are different.

TTL — the packet's life counter. A number rides in the header, each repeater decrements it, and a packet at zero goes no further. In MeshTRX it starts at two: a packet crosses two repeaters and stops. That limits network depth but does nothing about duplicates: two repeaters hearing the same packet will both repeat it, and both repeats are legitimate.

Memory of what was forwarded. Duplicates are handled by the second defence: the repeater remembers what it already forwarded and drops a repeat of the same thing. The key is sender, packet number and type. A ring cache of 128 entries, with a lifetime of thirty seconds for text and files and three seconds for voice.

Why voice gets a different lifetime is best explained by the bug we made there.

How a counter swallowed every second phrase

The voice packet number is one byte, and it was reset to zero on every press of the button. It seemed convenient: the receiver sees a zero and knows a new phrase has started.

To the repeater it looked different. It remembered forwarded packets for half a minute. You said a phrase — numbers 0, 1, 2 and onwards settled in its memory. Ten seconds later you said a second one — and its packets arrived with the same numbers, from the same sender, of the same type. A match on every field of the key. The second phrase was dropped entirely, as a duplicate.

On the bench, where voice is sent as sparse packets and losses are ruled out, it looks unambiguous:

forwardeddropped
first phrase10 of 100
second, 5 seconds later0 of 1010
fourth, 40 seconds later10 of 100

In a live network the effect hid behind ordinary losses, and the complaint sounded like "voice gets through the repeater every other time" — a description you cannot search for.

The cure is two changes. The number became continuous: the receiver recognises the start of a phrase by a separate flag, not by a zero. And voice memory shrank to three seconds — a packet lives in the network for fractions of a second, three seconds are enough to cut off the echo and too few to forget live speech. Thirty seconds are dangerous for voice for another reason: an eight-bit number at twelve packets per second wraps around in twenty, so in a long conversation a fresh packet would collide with an old entry.

The arithmetic worth doing in advance

Now the main thing — what forwarding costs the air.

A MeshTRX voice packet is 39 bytes. At the working parameters (SF7, 250 kHz bandwidth, 4/7 coding rate) it occupies the air for about 53 milliseconds. Such a packet is sent every 80 milliseconds — the codec demands it.

Everything follows from that:

On airChannel used
one talking station67%
the same plus one repeater133%
plus two repeaters200%
plus three repeaters267%

One station takes two thirds of the channel. One repeat and the transmission no longer fits: on the bench about half the voice packets make it through a repeater, and that is not a firmware defect but a hundred and thirty-three per cent divided into the available hundred.

For speech the loss is tolerable: an 80 ms gap sounds like a click, not a hole in a word. For a file it would be a disaster, which is why files travel with acknowledgements and re-requests for missing pieces — it takes longer, but everything arrives.

Why three repeaters do not form a network

The community is discussing a triangle: three repeaters on tower blocks, four kilometres a side, line of sight between them. The idea is right — coverage grows by an order of magnitude. But put three repeaters in one channel and switch them on, and what happens is not a network but mutual jamming: the 267 per cent in the table above.

Memory of forwarded packets does not help here. It removes duplicates but creates no capacity: each repeater still has to repeat someone else's packet at least once, and the channel is shared.

So something else is needed, in two parts.

Zones. A station belongs to its own repeater, and a repeater repeats only its own. Then the neighbouring repeater does not pick up foreign traffic, and the avalanche disappears by construction rather than by luck. Technically that is a group identifier in the packet — the same field that will be needed for "friend or foe" once encryption arrives.

A trunk outside the shared channel. Zones with no link between them are three independent networks. There are three ways to connect them, at very different prices:

  • over the internet. A repeater on a tower block will almost certainly be on a network — and then a tunnel between repeaters occupies no air at all and has no capacity limit. The cheapest option and the least sporting: a network designed to be independent of infrastructure leans on it at exactly this point;
  • with a second radio module. A separate transceiver on another channel, a directional antenna pointed at the neighbour. Honest off-grid, but that is hardware work, not firmware;
  • by time-sharing one radio. The repeater spends part of its time listening to the trunk channel. Fine for text, positions and beacons; not for voice — the stream is continuous, and gaps in it add up to noise.

The first option can be tested in an evening, the third too, the second needs hardware. It makes sense to start with what can be measured.

What this means in practice

Three conclusions worth keeping in mind when putting up a repeater.

It increases coverage, not capacity. If your network is already crowded — voice flowing, files moving — a repeater will make things worse, not better.

It is most useful where there would otherwise be no link at all: at the edge of coverage, behind a building, down in a hollow. That is exactly why it goes up high — not to amplify, but to see those who cannot see each other.

And it is not free for those who already hear each other directly: it repeats their packets too, taking those same percentages out of the channel. Zones are needed for that reason as well.

How to enable a repeater and what its page shows is in the documentation. The numbers above come from a two-board bench; field measurements, the triangle argument and everything else live in the Telegram group.