User Tools

Site Tools


mosh:transports

This is an old revision of the document!


MOSH Transports

OSI Model -- Quick Overview

The Open Systems Interconnect (OSI) model is a framework that describes how two or more computer systems communicate over a network. Each layer of the framework provides a specific purpose in communications. The OSI framework is as follows:

  • Layer 7 - Application
  • Layer 6 - Presentation
  • Layer 5 - Session
  • Layer 4 - Transport
  • Layer 3 - Network
  • Layer 2 - Data Link
  • Layer 1 - Physical

Depending on the underlying transport, MOSH messages may be transmitted starting at different layers of the OSI model. For example, when using ESP-NOW, communication operates close to Layer 2 (Data Link), whereas with Wi-Fi + TCP, MOSH operates above Layer 4 (Transport). It is important to know that in all cases, MOSH implements its own framework of security.

Encapsulation

Another key concept in network communications is that of encapsulation. Simply put, encapsulation is the process of wrapping existing data in new data. In OSI (and TCP/IP), data at higher layers is encapsulated by data at lower layers.

Depending on the transport being used, MOSH may rely on the functionality of these existing protocols for things like reliable message delivery. MOSH encapsulates its application-layer messages within the payload of lower-level protocols like ESP-NOW, TCP, or UART. Depending on the transport, reliability, ordering, and error correction may be handled by the underlying protocol (e.g., TCP), or left to MOSH to implement (e.g., ESP-NOW or UART).

MOSH Transports

A MOSH transport is the radio (or serial connection) where MOSH transmits and receives MOSH messages. Transport options are largely determined by the developers choice in hardware. However, there are some scenarios where transports can be chosen in software (ie ESP-NOW vs Wifi on ESP radios). The MOSH transport library currently provides support for the following protocols:

  • Espressif ESP-NOW(V1)
  • Espressif ESP-NOW(V2)
  • Wi-Fi
  • Serial
  • nRF24L01 (future)
  • nRF52840 (future)
  • LoRa (future)

MOSH is designed to abstract the transport layer so that core functionality (messaging, routing, automation) remains consistent regardless of whether messages are transmitted via ESP-NOW, Wi-Fi, Serial, or future transports.

ESP-Now (v1 and v2)

ESP-NOW is a protocol designed by Espressif for low-overhead, connectionless, peer-to-peer communication. It provides optional encryption via shared keys and supports unicase acknowledgements, but it does not implement full reliability (such as automatic retries or guaranteed delivery).

ESP-NOWv1 supports payloads up to 250 bytes. In version 2 (unofficial community extension or modified firmware), payloads up to 1470 bytes may be supported, typically by layering on top of Wi-Fi frames.

Wi-Fi

Wi-Fi is a wireless protocol defined by the IEEE in the 802.11 protocol standard. MOSH can use Wi-Fi as a transport, often over TCP or UDP sockets. This provides features like encryption (via TLS), reliable delivery (via TCP), and long-range routing. However, Wi-Fi is not required for a functional MOSH networks.

TTL Serial (UART)

TTL Serial (UART) is commonly used by MCUs for programming or debugging, but it can also be used for MOSH communication between nodes. This is especially useful for bridging different transport – for example, a MOSH Controller can connect a UART node to an ESP-NOW or Wi-Fi network, acting as a gateway.

Transport Bridging

Different transports can be bridged.

/var/www/wiki.moshnetworks.com/data/attic/mosh/transports.1750867641.txt.gz · Last modified: by mosh

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki