Skip to content

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.

Getting started

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).

Definitions

  1. disaster feeds are a tuple of (id, public key).
  2. disaster node is publicly identified by id, public key

Header

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.

Data Header

1 byte data header version | 1 byte message type | 10 empty

12 bytes

Sequence

Announce

  1. node start and announces (message type, in data header) public key (<= 140 bytes) signature
  2. other node receives the announce message, puts the feed (id, public key) into a lookup table

Subscribe

  1. at some point, node A learns about feed X (e.g. from connecting client)
  2. node A sends subscribe message (message type), id of feed X, id of source node A
  3. all nodes that relay the subscribe message, save triple (node A id, feed X id, minimum hop count), increment hop count, broadcast message

Unsubscribe

  1. node A send unsubscribe message
  2. all nodes that relay the unsubscribe message, delete triple with (node A id, feed X id, hop count)

Publish to feed

  1. node A published message "hi" to feed X by creating a message and broadcasting it
  2. all nodes that relay the message, update hop count in triple (node A id, feed X id)
  3. (todo add description)
Clone this wiki locally