diff --git a/404.html b/404.html index 3142b2c4..596cac90 100644 --- a/404.html +++ b/404.html @@ -377,14 +377,14 @@
  • - + - Packet Structure + Packet Format @@ -411,7 +411,7 @@ - Meshcore payloads + Payload Format diff --git a/cli_commands/index.html b/cli_commands/index.html index ef798941..5f61a341 100644 --- a/cli_commands/index.html +++ b/cli_commands/index.html @@ -1465,14 +1465,14 @@
  • - + - Packet Structure + Packet Format @@ -1499,7 +1499,7 @@ - Meshcore payloads + Payload Format diff --git a/companion_protocol/index.html b/companion_protocol/index.html index 78806632..7533c659 100644 --- a/companion_protocol/index.html +++ b/companion_protocol/index.html @@ -950,14 +950,14 @@
  • - + - Packet Structure + Packet Format @@ -984,7 +984,7 @@ - Meshcore payloads + Payload Format diff --git a/docs/index.html b/docs/index.html index d083d1ac..4a073bd5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -446,14 +446,14 @@
  • - + - Packet Structure + Packet Format @@ -480,7 +480,7 @@ - Meshcore payloads + Payload Format diff --git a/faq/index.html b/faq/index.html index e260c417..07b7551e 100644 --- a/faq/index.html +++ b/faq/index.html @@ -1408,14 +1408,14 @@
  • - + - Packet Structure + Packet Format @@ -1442,7 +1442,7 @@ - Meshcore payloads + Payload Format diff --git a/index.html b/index.html index 2c2690ae..3ed0e5bc 100644 --- a/index.html +++ b/index.html @@ -396,14 +396,14 @@
  • - + - Packet Structure + Packet Format @@ -430,7 +430,7 @@ - Meshcore payloads + Payload Format @@ -574,7 +574,7 @@
  • Frequently Asked Questions
  • CLI Commands
  • Companion Protocol
  • -
  • Packet Structure
  • +
  • Packet Format
  • QR Codes
  • If you find a mistake in any of our documentation, or find something is missing, please feel free to open a pull request for us to review.

    diff --git a/nrf52_power_management/index.html b/nrf52_power_management/index.html index 5e7f853b..770f37df 100644 --- a/nrf52_power_management/index.html +++ b/nrf52_power_management/index.html @@ -16,7 +16,7 @@ - + @@ -634,14 +634,14 @@
  • - + - Packet Structure + Packet Format @@ -668,7 +668,7 @@ - Meshcore payloads + Payload Format diff --git a/packet_structure/index.html b/packet_format/index.html similarity index 68% rename from packet_structure/index.html rename to packet_format/index.html index 85c4f6be..349e1a28 100644 --- a/packet_structure/index.html +++ b/packet_format/index.html @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - Packet Structure - MeshCore Docs + Packet Format - MeshCore Docs @@ -70,7 +70,7 @@
    - + Skip to content @@ -105,7 +105,7 @@
    - Packet Structure + Packet Format
    @@ -404,7 +404,7 @@ - Packet Structure + Packet Format @@ -422,7 +422,7 @@ - Packet Structure + Packet Format @@ -448,47 +448,75 @@ @@ -513,7 +541,7 @@ - Meshcore payloads + Payload Format @@ -634,47 +662,75 @@ @@ -694,7 +750,7 @@ - + @@ -702,7 +758,77 @@ -

    Packet Structure

    +

    Packet Format

    +

    This document describes the MeshCore packet format.

    +
      +
    • 0xYY indicates YY in hex notation.
    • +
    • 0bYY indicates YY in binary notation.
    • +
    • Bit 0 indicates the bit furthest to the right: 0000000X
    • +
    • Bit 7 indicates the bit furthest to the left: X0000000
    • +
    +

    Version 1 Packet Format

    +

    This is the protocol level packet structure used in MeshCore firmware v1.12.0

    +
    [header][transport_codes(optional)][path_length][path][payload]
    +
    +
      +
    • header - 1 byte
        +
      • 8-bit Format: 0bVVPPPPRR - V=Version - P=PayloadType - R=RouteType
      • +
      • Bits 0-1 - 2-bits - Route Type
          +
        • 0x00/0b00 - ROUTE_TYPE_TRANSPORT_FLOOD - Flood Routing + Transport Codes
        • +
        • 0x01/0b01 - ROUTE_TYPE_FLOOD - Flood Routing
        • +
        • 0x02/0b10 - ROUTE_TYPE_DIRECT - Direct Routing
        • +
        • 0x03/0b11 - ROUTE_TYPE_TRANSPORT_DIRECT - Direct Routing + Transport Codes
        • +
        +
      • +
      • Bits 2-5 - 4-bits - Payload Type
          +
        • 0x00/0b0000 - PAYLOAD_TYPE_REQ - Request (destination/source hashes + MAC)
        • +
        • 0x01/0b0001 - PAYLOAD_TYPE_RESPONSE - Response to REQ or ANON_REQ
        • +
        • 0x02/0b0010 - PAYLOAD_TYPE_TXT_MSG - Plain text message
        • +
        • 0x03/0b0011 - PAYLOAD_TYPE_ACK - Acknowledgment
        • +
        • 0x04/0b0100 - PAYLOAD_TYPE_ADVERT - Node advertisement
        • +
        • 0x05/0b0101 - PAYLOAD_TYPE_GRP_TXT - Group text message (unverified)
        • +
        • 0x06/0b0110 - PAYLOAD_TYPE_GRP_DATA - Group datagram (unverified)
        • +
        • 0x07/0b0111 - PAYLOAD_TYPE_ANON_REQ - Anonymous request
        • +
        • 0x08/0b1000 - PAYLOAD_TYPE_PATH - Returned path
        • +
        • 0x09/0b1001 - PAYLOAD_TYPE_TRACE - Trace a path, collecting SNR for each hop
        • +
        • 0x0A/0b1010 - PAYLOAD_TYPE_MULTIPART - Packet is part of a sequence of packets
        • +
        • 0x0B/0b1011 - PAYLOAD_TYPE_CONTROL - Control packet data (unencrypted)
        • +
        • 0x0C/0b1100 - reserved
        • +
        • 0x0D/0b1101 - reserved
        • +
        • 0x0E/0b1110 - reserved
        • +
        • 0x0F/0b1111 - PAYLOAD_TYPE_RAW_CUSTOM - Custom packet (raw bytes, custom encryption)
        • +
        +
      • +
      • Bits 6-7 - 2-bits - Payload Version
          +
        • 0x00/0b00 - v1 - 1-byte src/dest hashes, 2-byte MAC
        • +
        • 0x01/0b01 - v2 - Future version (e.g., 2-byte hashes, 4-byte MAC)
        • +
        • 0x02/0b10 - v3 - Future version
        • +
        • 0x03/0b11 - v4 - Future version
        • +
        +
      • +
      +
    • +
    • transport_codes - 4 bytes (optional)
        +
      • Only present for ROUTE_TYPE_TRANSPORT_FLOOD and ROUTE_TYPE_TRANSPORT_DIRECT
      • +
      • transport_code_1 - 2 bytes - uint16_t - calculated from region scope
      • +
      • transport_code_2 - 2 bytes - uint16_t - reserved
      • +
      +
    • +
    • path_length - 1 byte - Length of the path field in bytes
    • +
    • path - size provided by path_length - Path to use for Direct Routing
        +
      • Up to a maximum of 64 bytes, defined by MAX_PATH_SIZE
      • +
      • v1.12.0 firmware and older drops packets with path_length larger than 64
      • +
      +
    • +
    • payload - variable length - Payload Data
        +
      • Up to a maximum 184 bytes, defined by MAX_PACKET_PAYLOAD
      • +
      • Generally this is the remainder of the raw packet data
      • +
      • The firmware parses this data based on the provided Payload Type
      • +
      • v1.12.0 firmware and older drops packets with payload sizes larger than 184
      • +
      +
    • +
    +

    Packet Format

    @@ -715,7 +841,7 @@ - + @@ -723,25 +849,27 @@ - + - + - + - +
    header 1Contains routing type, payload type, and payload version.Contains routing type, payload type, and payload version
    transport_codes2x 16-bit transport codes (if ROUTE_TYPE_TRANSPORT_*)
    path_lenpath_length 1Length of the path field in bytes.Length of the path field in bytes
    path up to 64 (MAX_PATH_SIZE)Stores the routing path if applicable.Stores the routing path if applicable
    payload up to 184 (MAX_PACKET_PAYLOAD)The actual data being transmitted.Data for the provided Payload Type
    -

    Note: see the payloads doc for more information about the content of payload.

    -

    Header Breakdown

    -

    bit 0 means the lowest bit (1s place)

    +
    +

    NOTE: see the Payloads documentation for more information about the content of specific payload types.

    +
    +

    Header Format

    +

    Bit 0 means the lowest bit (1s place)

    @@ -756,23 +884,23 @@ - + - + - +
    0-1 0x03 Route TypeFlood, Direct, Reserved - see below.Flood, Direct, etc
    2-5 0x3C Payload TypeRequest, Response, ACK, etc. - see below.Request, Response, ACK, etc
    6-7 0xC0 Payload VersionVersioning of the payload format - see below.Versioning of the payload format
    -

    Route Type Values

    +

    Route Types

    @@ -785,26 +913,26 @@ - + - + - + - +
    0x00 ROUTE_TYPE_TRANSPORT_FLOODFlood routing mode + transport codesFlood Routing + Transport Codes
    0x01 ROUTE_TYPE_FLOODFlood routing mode (builds up path).Flood Routing
    0x02 ROUTE_TYPE_DIRECTDirect route (path is supplied).Direct Routing
    0x03 ROUTE_TYPE_TRANSPORT_DIRECTdirect route + transport codesDirect Routing + Transport Codes
    -

    Payload Type Values

    +

    Payload Types

    @@ -817,86 +945,86 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
    0x00 PAYLOAD_TYPE_REQRequest (destination/source hashes + MAC).Request (destination/source hashes + MAC)
    0x01 PAYLOAD_TYPE_RESPONSEResponse to REQ or ANON_REQ.Response to REQ or ANON_REQ
    0x02 PAYLOAD_TYPE_TXT_MSGPlain text message.Plain text message
    0x03 PAYLOAD_TYPE_ACKAcknowledgment.Acknowledgment
    0x04 PAYLOAD_TYPE_ADVERTNode advertisement.Node advertisement
    0x05 PAYLOAD_TYPE_GRP_TXTGroup text message (unverified).Group text message (unverified)
    0x06 PAYLOAD_TYPE_GRP_DATAGroup datagram (unverified).Group datagram (unverified)
    0x07 PAYLOAD_TYPE_ANON_REQAnonymous request.Anonymous request
    0x08 PAYLOAD_TYPE_PATHReturned path.Returned path
    0x09 PAYLOAD_TYPE_TRACEtrace a path, collecting SNI for each hop.Trace a path, collecting SNR for each hop
    0x0A PAYLOAD_TYPE_MULTIPARTpacket is part of a sequence of packets.Packet is part of a sequence of packets
    0x0B PAYLOAD_TYPE_CONTROLcontrol packet data (unencrypted)Control packet data (unencrypted)
    0x0C.reserved reserved
    0x0D.reserved reserved
    0x0E.reserved reserved
    0x0F PAYLOAD_TYPE_RAW_CUSTOMCustom packet (raw bytes, custom encryption).Custom packet (raw bytes, custom encryption)
    -

    Payload Version Values

    +

    Payload Versions

    @@ -909,22 +1037,22 @@ - + - + - + - +
    0x00 11-byte src/dest hashes, 2-byte MAC.1-byte src/dest hashes, 2-byte MAC
    0x01 2Future version (e.g., 2-byte hashes, 4-byte MAC).Future version (e.g., 2-byte hashes, 4-byte MAC)
    0x02 3Future version.Future version
    0x03 4Future version.Future version
    diff --git a/payloads/index.html b/payloads/index.html index 0b916401..8fd82034 100644 --- a/payloads/index.html +++ b/payloads/index.html @@ -13,7 +13,7 @@ - + @@ -27,7 +27,7 @@ - Meshcore payloads - MeshCore Docs + Payload Format - MeshCore Docs @@ -70,7 +70,7 @@
    - + Skip to content @@ -105,7 +105,7 @@
    - Meshcore payloads + Payload Format
    @@ -388,14 +388,14 @@
  • - + - Packet Structure + Packet Format @@ -431,7 +431,7 @@ - Meshcore payloads + Payload Format @@ -449,7 +449,7 @@ - Meshcore payloads + Payload Format @@ -636,8 +636,8 @@ -

    Meshcore payloads

    -

    Inside of each meshcore packet is a payload, identified by the payload type in the packet header. The types of payloads are:

    +

    Payload Format

    +

    Inside each MeshCore Packet is a payload, identified by the payload type in the packet header. The types of payloads are: