mosh:protocol_details
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mosh:protocol_details [2026/05/02 03:10] – [Overview] mosh | mosh:protocol_details [2026/06/10 13:54] (current) – mosh | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <WRAP important> | ||
| + | This page is retained for historical reference and may not reflect the current MOSH/ | ||
| + | See [[guide: | ||
| + | </ | ||
| ====== MOSH Protocol Specification (v1 Draft) ====== | ====== MOSH Protocol Specification (v1 Draft) ====== | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | MOSH (Modern Offline Smart Home) is a lightweight, | ||
| - | |||
| - | The protocol is optimized for: | ||
| - | * Small microcontrollers (e.g., ATmega128) | ||
| - | * Deterministic parsing | ||
| - | * Minimal memory usage | ||
| - | * Transport independence (nRF24, ESP-NOW, UART, etc.) | ||
| - | * Decentralized operation (no required central coordinator) | ||
| MOSH separates responsibilities into: | MOSH separates responsibilities into: | ||
| * [[mosh: | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| * [[mosh: | * [[mosh: | ||
| + | * [[mosh: | ||
| * [[mosh: | * [[mosh: | ||
| - | * [[mosh: | + | * [[mosh: |
| - | * [[mosh: | + | |
| * [[mosh: | * [[mosh: | ||
| * [[mosh: | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| * [[mosh: | * [[mosh: | ||
| * [[mosh: | * [[mosh: | ||
| - | * [[mosh: | + | * [[mosh: |
| * [[mosh: | * [[mosh: | ||
| - | ----- | + | * [[mosh: |
| - | + | ||
| - | ===== Frame Structure ===== | + | |
| - | + | ||
| - | A MOSH frame is a maximum 1470 bytes. Depending on the transport, frames can/will be segmented if the frames length is longer than the [[.: | + | |
| - | + | ||
| - | All MOSH packets follow this structure: | + | |
| - | + | ||
| - | | Header (12 Btyes) | | + | |
| - | | Payload | | + | |
| - | | Footer (CRC16) (2 Bytes) | | + | |
| - | + | ||
| - | + | ||
| - | ===== Header Layout (12 Bytes) ===== | + | |
| - | + | ||
| - | ^ Field ^ Length (Bytes) ^ Description ^ | + | |
| - | | Start of Frame | 1 | Fixed marker for frame synchronization | | + | |
| - | | TTL | 1 | Time-to-live (decremented on forwarding) | | + | |
| - | | Message ID | 2 | Unique ID per message (for ACK/ | + | |
| - | | Version + Flags | 1 | Upper 4 bits = protocol version, lower 4 bits = flags | | + | |
| - | | Source Address | + | |
| - | | Destination Address | + | |
| - | | Context | + | |
| - | | Op Code | 1 | Operation within context | | + | |
| - | | Payload Length | + | |
| - | + | ||
| - | ===== Footer (2 Bytes) ===== | + | |
| - | + | ||
| - | ^ Field ^ Size (Bytes) ^ Description ^ | + | |
| - | | CRC16 | 2 | Frame integrity check | | + | |
| - | + | ||
| - | ----- | + | |
| - | + | ||
| - | ===== Version and Flags ===== | + | |
| - | + | ||
| - | ==== Version (Upper Nibble) ==== | + | |
| - | Protocol version (0–15). | + | |
| - | + | ||
| - | ==== Flags (Lower Nibble) ==== | + | |
| - | + | ||
| - | ^ Bit ^ Name ^ Description ^ | + | |
| - | | 0 | ACK_REQUIRED | + | |
| - | | 1 | ACK | Frame is an acknowledgment | + | |
| - | | 2 | IS_RETRY | + | |
| - | | 3 | RESERVED | + | |
| - | + | ||
| - | ----- | + | |
| - | + | ||
| - | ===== Addressing ===== | + | |
| - | + | ||
| - | Each address field is 16 bits: | + | |
| - | [ Network ID (6 bits) | Node ID (10 bits) ] | + | |
| - | + | ||
| - | + | ||
| - | ==== Network ID ==== | + | |
| - | | + | |
| - | * Used to segment MOSH domains | + | |
| - | + | ||
| - | ==== Node ID ==== | + | |
| - | * Range: 0–1023 | + | |
| - | * Unique within a network | + | |
| - | + | ||
| - | ----- | + | |
| - | + | ||
| - | ===== Context and Op Codes ===== | + | |
| - | + | ||
| - | The Context byte determines which core manager processes the payload. | + | |
| - | + | ||
| - | ^ Value ^ Context | + | |
| - | | 0 | + | |
| - | | 1 | [[mosh: | + | |
| - | | 2 | [[mosh: | + | |
| - | | 3 | [[mosh: | + | |
| - | | 4–7 | RESERVED | Future expansion | | + | |
| - | + | ||
| - | ----- | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | ===== Payload ===== | + | |
| - | + | ||
| - | The payload format will vary based on the various [[mosh: | + | |
| - | + | ||
| - | The transport layer does not interpret payload contents. | + | |
| - | + | ||
| - | ----- | + | |
| - | + | ||
| - | ===== Footer (CRC16) ===== | + | |
| - | 16-bit error detection code generated per frame | + | |
| - | ----- | + | |
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
| + | * [[mosh: | ||
/var/www/wiki.moshnetworks.com/data/attic/mosh/protocol_details.1777691404.txt.gz · Last modified: by mosh
