-
Notifications
You must be signed in to change notification settings - Fork 114
Protocol
grant_____ edited this page Sep 6, 2018
·
20 revisions
OLD NOTES COPIED FROM disaster-radio-nodemcu wiki
This page describes the way disaster radio publish messages.
At time of writing (May 2017), disaster radio would use LoRa as a low bandwidth, long range, and low power. LoRa packets can be 256 bytes (add reference). LoRA uses 916 MHz (904-924MHz ISM band, allowed to mesh, you can do whatever you want, needs references).
- disaster feeds are a tuple of (id, public key).
- disaster node is publicly identified by id, public key
7 bits protocol version | 33 bits CRC32 | 64 bytes signature | 128 bits disaster relay node id | 128 bits feed id | 2 bytes hop count | 1 bytes data encoder
total header size 104 bytes
Leaves 256 - 104 = 152 bytes to play with. 140 bytes + 12 bytes data header.
1 byte data header version | 1 byte message type | 10 empty
12 bytes
- node start and announces (message type, in data header) public key (<= 140 bytes) signature
- other node receives the announce message, puts the feed (id, public key) into a lookup table
- at some point, node A learns about feed X (e.g. from connecting client)
- node A sends subscribe message (message type), id of feed X, id of source node A
- all nodes that relay the subscribe message, save triple (node A id, feed X id, minimum hop count), increment hop count, broadcast message
- node A send unsubscribe message
- all nodes that relay the unsubscribe message, delete triple with (node A id, feed X id, hop count)
- node A published message "hi" to feed X by creating a message and broadcasting it
- all nodes that relay the message, update hop count in triple (node A id, feed X id)
- (todo add description)