Close

What Protocol Does Jebel Use?

A project log for Jebel: Off Grid Communications

Jebel is a LoRa based text communication system for humanitarian and disaster relief situations.

chris-lowChris Low 08/01/2019 at 22:200 Comments

Jebel uses its own protocol specifically designed to be very lightweight and to maximize range and network reliability. It utilizes a hybrid network that employs nodes and repeaters.

Theory of wireless network protocols

How do nodes in the network transfer data?

There are different ways to create a network of connected devices for a project like this. All of these methods have advantages and disadvantages.

Peer to Peer

The simplest method which is used is used in traditional walkie talkies is a peer to peer network. In this typology all nodes communicate directly with each other without any intermediary. The messages can be addressed to specific nodes, or to all nodes.

Advantage:
Simple to set up
only requires 2 nodes
flexibility in locations

Disadvantage:
limited to the range of the device.

Star or Centralized

Another typology is a star configuration where all units send and receive data via a central node. This is the system utilized in Lorawan where all nodes report to a central gateway. In this system nodes do not communicate to each-other directly, but only via the central node.

Advantages:
Centralized network control
allows for monitoring

Disadvantage:
both devices need to be in range of central node
bottleneck at gateway

Mesh

Another typology is a mesh or repeater mesh typology where every node also acts as a repeater. This has the advantage of giving the highest chance of a message going through as in theory as long as there is a chain of nodes between two nodes they will be able to communicate. This could be a very effective system in a network with only a few nodes, however it quickly becomes problematic with something like Lora which takes a long time to send messages, because when multiple nodes start repeating a message it can create interference, so that all the messages become corrupted.

Advantages:
Doesn’t need established network
Flexibility
any node can communicate with another node

Disadvantage:
can’t deal with numerous nodes
nodes will interfere with other nodes

Hybrid System

Jebel utilizes a hybrid system that takes advantage of the benefits of the different systems, but limits the disadvantages of each of these systems. This is being called a Hybrid Repeater Network. In this system each node has a unique address. All nodes have the ability to communicate with any node in range like in a peer to peer network. If a node receives a message it will send back a message received confirmation to the sending node. In this form only two nodes are needed for communication, and they can work anywhere they are in range of each other. If the message is not received by the node however after a set amount of time the node will send a command to repeat the message. Nodes designated as repeaters will repeat the message, and later the message received confirmation. These repeater nodes would be stationary nodes placed on hilltops which maximize the line of sight which is critical for Lora messages. This is why the system is called Jebel which is a transliteration of the Arabic word for mountain. By only allowing nodes with the best locations to repeat messages there is much less noise than in a completely mesh network, which maximizes the chance for a message to get through without creating interference.


Example 1

To understand the protocol the easiest way is to look at several examples. In the first example two nodes A and B are in range of each other. A sends a message, B receives the message and sends back a confirmation to A. Any repeaters that hear the message and don’t hear a repeat command will not repeat the message.

Example 2

In the next example we have the same situation, but A is not within range of B. In this situation once an amount of time that would be sufficient to allow for B to send its confirmation has elapsed the node A will send a command to the repeater which will repeat the message from A. B will send a confirmation to the repeater which will repeat the confirmation to A. Any other repeaters which hear the confirmation sent by the repeater would not continue to repeat the message.

Example 3

Extending the range of this scenario multiple repeater hops are possible with this system. If no confirmation is received by the first repeater after a set period of time it will send a command to repeat the message again. Other repeaters in the network can then repeat the message. If the message is received by node B then confirmation will be repeated only by those repeaters that sent the original message.

Limitations

In theory this system could be extended out to an indefinite number of repeaters, but in practice this would really only be practical for a relatively small network, as a large number of repeaters would cause a message to get repeated too many times trying to locate a node. In a very complex network like this some sort of defined routing protocol would be needed, which would likely require each nodes location to be known within the system. However for a system with a few repeater the hybrid system outlined here would create a lightweight network that required no predefined routing so it would be self-healing. It also does not require any central routing, so it is very flexible. Creating a network would be as easy as turning on two devices, or slightly more complicated, setting a repeater in location with good coverage.

Other issues with the protocol would occur on outlying situations which involve multiple repeaters, or where nodes on on the edge of the repeaters range. For example if the message from node A is heard by multiple repeaters. If they then try and repeat the message at the same time they can interfere with each other. This issue can be worked around by giving each repeater a different set amount of time before it repeats a message, then if it hears another repeater it will wait a set time before repeating the message if it does not hear a confirmation. The downside of this system is that it creates extra delay, but this is acceptable as timing is not critical for this system, and it is more critical that messages get through without interference.

What information is sent:

Lora messages are low bandwidth which means that large messages will take considerable time to send. With higher spreading factors long messages could take seconds to transmit, so making a message header that is as small as possible is critical. For Jebel the message header is five bytes.

1st byte Message address (where message is going)
2nd byte Message sender address (who sent message)
3rd byte Message type (is this a text message, a received confirmation, or a command)
4th byte message id (identifier for the message)
5th byte check sum (total length of message in bytes to confirm message integrity on receiving side)

Messages with Lora can be up to 256 bytes, so with this header there is 251 bytes available for the message contents. Currently the address is one byte. This allows for up to 255 devices on the network with 0x00 being allocated to send to all devices. If these spaces were not enough for the devices on the network the addresses could go to 2 bytes, which would allow for 65535 devices, but it would add two bytes to each message (one byte for message address, and one byte for senders address) it is better to stay at one byte addresses unless more devices are needed.

All messages have the five byte header attached to them, but many messages do not need any additional information beside the header. 256 possible per-configured messages can be sent by changing the value of the 3rd byte. For example one byte is set to request the current battery voltage of a node, another to get the current GPS location, another is used to confirm message receipt. These short messages can communicate a lot of information without needed great deals of on-air time.

Devices

Nodes and repeaters can utilize a number of different hardware sets to communicate on the Jebel network. Any Arduino compatible board can be used as long as they are capable of communicating with a Lora compatible device. Currently the major focus is on the ESP32 platform because it allows for multiple uarts which allows for serial communication to computer, Nextion display and GPS unit concurrently. It also allows for Bluetooth or WiFi connections which are not currently implemented. The low power processor in the ESP32 also allows for low current deep sleep to allow for long battery run times.

Discussions