-
-
Notifications
You must be signed in to change notification settings - Fork 0
Messages
| Byte | 0-1 | 2 | 3 | 4-n |
|---|---|---|---|---|
| Content | Length of Type Data | ID | Type | Type Data |
| Data type | UInt16 | UInt8 | UInt8 |
| Byte | 0-n |
|---|---|
| Content | Message |
| Data type |
if it responds to a forwarded message, the response is forwarded to the sender
| Byte | 0-n |
|---|---|
| Content | Message |
| Data type |
Config (Type 2)
| Byte | 0 | 1-n |
|---|---|---|
| Content | SubType | connection options |
| Data type | UInt8 | data from subtype |
| Byte | 0-n |
|---|---|
| Content | connection options |
| Data type | JSON |
| Byte | 0-15 | 16 |
|---|---|---|
| Content | UUID | Distance (FF for removed) |
| Data type | UUID | UInt8 |
| Byte | 0-15 |
|---|---|
| Content | UUID |
| Data type | UUID |
| Byte | 0 |
|---|---|
| Content | Distance |
| Data type | UInt8 |
| Byte | 0 | 1 | 2-n |
|---|---|---|---|
| Content | TTL | SubType | SubType Data |
| Data type | UInt8 | UInt8 |
| Byte | 0-1 | 2-n | n-(n+2) | (n+2)-m | ... |
|---|---|---|---|---|---|
| Content | Length of response a | Response a | Length of response b | Response b | ... |
| Data type | UInt16 | Response | UInt16 | Response | ... |
Broadcasts are forwarded to all contacts with a decremented TTL as long as TTL is bigger than 0. A node responds with all unique response it got plus its own. If the same message is received a short time after the first time getting it (has the same hash), it is ignored (empty response)
| Byte | 0 | 1-16 | 17 | 18-n |
|---|---|---|---|---|
| Content | TTL | Receiver | SubType | SubType Data |
| Data type | UInt8 | UUID | UInt8 |
| Byte | 0-1 | 2-n | n-(n+2) | (n+2)-m | ... |
|---|---|---|---|---|---|
| Content | Length of response a | Response a | Length of response b | Response b | ... |
| Data type | UInt16 | Response | UInt16 | Response | ... |
| Byte | 0 |
|---|---|
| Content | Status |
| Data type | UInt8 |
If the receiver is a connected contact, this is forwarded to it, else if it has a referral entry this is forwarded to them, otherwise it's forwarded to all connected contacts with TTL decremented as long TTL is bigger than 0. An empty response means that TTL reached 0 before getting to the Receiver, a node responds with all unique response it got. If the same message is received a short time after the first time getting it (has the same hash), it is ignored (empty response)
Connect (Type 4.0)
encrypted with RSA
| Byte | 0-15 | 16-17 | 18-n |
|---|---|---|---|
| Content | UUID | Port | IP |
| Data type | UUID | UInt16 | IP |
| Byte | 0-1 | 2-n |
|---|---|---|
| Content | Port | IP |
| Data type | UInt16 | IP |
encrypted with preshared key
| Byte | 0-15 | 16-n |
|---|---|---|
| Content | UUID | Public Key |
| Data type | UUID | Public Key |
| Byte | 0-n |
|---|---|
| Content | Public Key |
| Data type | Public Key |
| Byte | 0 | 1-n |
|---|---|---|
| Content | Type | Data |
| Data type | UInt8 |
| Byte | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Content | Part 1 | Part 2 | Part 3 | Part 4 |
| Data type | UInt8 | UInt8 | UInt8 | UInt8 |
| Byte | 0-15 |
|---|---|
| Content | IP |
| Data type | IPv6 |
| Status | Meaning |
|---|---|
| 0 | general failure |
| 1 | Not reachable (for Route/Broadcast) |
| 2 | unsupported message type |
| 3 | Unauthenticated |
| Byte | 0 | 1-16 | 2-3 | 4-n |
|---|---|---|---|---|
| Content | TTL | Receiver | ID | Packet |
| Data type | UInt8 | UUID | UInt16 |
Tunnels are like Route messages, but the Path persists until it is closed, all messages after the first are treated as responses.