
Last week I was mostly getting my head around LoRa/LoRaWAN fundamentals. This week Wei wants me to actually understand mesh networking, since that's what our SQC485Iv2 nodes run instead of LoRaWAN. So today, the most basic question first: what actually is a mesh network, and how is it different from the star topology I spent all last week learning about?
In classic LoRaWAN, the topology is star-of-stars: every end device talks directly to whichever gateway(s) are in range, and the gateway just relays everything up to a network server. Devices never talk to each other. If a sensor is out of radio range of every gateway, it's simply not on the network — there's no way for a neighboring device to help it out.
A mesh network relaxes that constraint. Nodes can relay traffic for each other. If node A can't reach the gateway directly but it can hear node B, and node B can reach the gateway, A's message can hop through B to get there. Extend that chain and you get multi-hop reach — coverage that's much bigger than any single node's radio range, built out of overlapping shorter links instead of one long one.
The other piece that clicked for me today: resilience. In a star network, if the one path from a device to its gateway is blocked (something physically obstructing the RF path, interference, whatever), that device is just offline until the path clears. In a mesh, if there are multiple neighbors that could relay a message, traffic can potentially route around an obstruction instead of being stuck waiting for one specific link to come back.
None of this is free, though. Multi-hop messages take longer to arrive than a direct single-hop transmission — every hop adds a transmission, and each transmission takes real airtime on a LoRa link (this is a big part of why yesterday's — well, last week's — discussion of spreading factor and time-on-air matters; longer time-on-air per hop adds up fast across several hops). And the network logic itself is more complex: something has to decide how messages get relayed without flooding the whole network forever, which I gather is tomorrow's topic.
This actually explains something about our own product line that I'd been fuzzy on. Siliqs sites often have RS485 sensors spread across multiple buildings or floors — industrial layouts where one gateway physically cannot see every sensor node, and running new gateway cabling to every building isn't realistic. A star topology would need a gateway (or LoRaWAN-style backhaul) reachable from every single sensor location. A mesh only needs some path to exist, hop by hop, even if no single node can see the gateway directly. That's apparently a big part of why our nodes are mesh-based rather than classic LoRaWAN — I hadn't connected that dot until today.
Tomorrow: how Meshtastic (which our stack is influenced by, as I understand it — still confirming exactly how closely) actually decides who relays what, since "nodes can relay for each other" raises the obvious question of how you stop that from looping forever.

上禮拜大部分時間都在搞懂 LoRa/LoRaWAN 的基礎。這禮拜 Wei 要我開始搞懂 mesh networking,因為我們的 SQC485Iv2 節點用的是 mesh,不是 LoRaWAN。所以今天先問最基本的問題:mesh network 到底是什麼,跟我上禮拜學的 star topology 差在哪?
在經典的 LoRaWAN 裡,topology 是 star-of-stars:每個 end device 都直接跟收訊範圍內的 gateway 講話,gateway 只負責把東西轉送到 network server。裝置彼此之間不會互相講話。如果某個感測器超出所有 gateway 的收訊範圍,它就是不在網路上——旁邊的裝置沒辦法幫它一把。
Mesh network 放鬆了這個限制。節點可以互相幫忙轉送(relay)流量。如果節點 A 沒辦法直接連到 gateway,但它聽得到節點 B,而節點 B 可以連到 gateway,A 的訊息就可以透過 B 跳過去。把這個鏈接延伸下去,就會得到 multi-hop 的涵蓋範圍——比任何單一節點的無線電距離都大得多,靠的是好幾段較短的連結疊在一起,而不是一條很長的連結。
今天另一個搞懂的點是韌性(resilience)。在 star network 裡,如果裝置到 gateway 唯一的那條路被擋住(實體遮蔽、干擾之類的),這個裝置就是離線,一直等到那條路通了為止。在 mesh 裡,如果有好幾個鄰居都能幫忙轉送,流量有機會繞過障礙,而不是卡死等特定一條連結恢復。
當然這不是沒有代價的。Multi-hop 的訊息會比單跳直傳花更久才到——每一跳都要多一次傳輸,而 LoRa 連結上每一次傳輸都要花實打實的 airtime(這也是為什麼上禮拜討論 spreading factor 跟 time-on-air 那篇很重要;每一跳的 time-on-air 拉長,跳幾次下來累積起來很可觀)。網路邏輯本身也更複雜:得有東西來決定訊息怎麼轉送,才不會讓整個網路無限轉發下去——這聽說是明天的題目。
這也解釋了我之前一直沒搞清楚的一件事,關於我們自己的產品線。Siliqs 的場地常常是 RS485 感測器分散在好幾棟建築或好幾層樓——這種工業現場的佈局,一個 gateway 實體上不可能看得到每一個感測節點,而幫每一棟建築都拉新的 gateway 線路也不現實。Star topology 需要每個感測器位置都能連到某個 gateway(或 LoRaWAN 式的 backhaul)。Mesh 只需要「某條路徑存在」就好,一跳一跳接過去,就算沒有任何一個節點直接看得到 gateway 也沒關係。這顯然就是我們的節點用 mesh 而不是傳統 LoRaWAN 的一大原因——這個點我今天才連起來。
明天:Meshtastic(據我所知我們的協定棧受它影響——實際多接近還要再確認)到底怎麼決定誰該轉送什麼,因為「節點可以互相 relay」馬上就會讓人問:那要怎麼防止它無限循環下去?