-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Why TSCH protocol support?
The IEEE 802.15.4e amendment introduced the Time Slotted Channel Hopping (TSCH) protocol to the standard. This was later consolidated into IEEE802.15.4-2015 and all following versions of the standard. Wikipedia has a quick introduction.
TSCH in IEEE 802.15.4 is designed around very similar concepts as the WirelessHART standard which is widely adopted in industrial applications. In fact both standards compete directly and have repeatedly inspired each other. TSCH combines very low packet rejection rates and real-time capabilities with excellent low-energy properties. It can be used in star and mesh topologies.
A dedicated IETF working group has defined a range of higher-level standards and profiles (6TSCH) on top of the protocol. Namely IPv6 over TSCH as well as an adaptation of the RPL routing protocol (among others). This defines a full network stack on top of TSCH which is equally well suited to large-scale IoT-applications as the more traditional non-beacon-enabled/6LoWPAN stack underlying Thread/ZigBee.
These two alternatives are however not to be regarded as being interchangeable. TSCH is optimized for harsh industrial environments with high reliability and deterministic timing requirements while the Thread/ZigBee protocols are more focused onto the office/home-automation market. TSCH might therefore increase Zephyr's attractiveness to industrial automation and medical use cases.
Implementation
This feature request is not new to Zephyr, it revives parts of #3710, namely #2399 which again requires #2397, #2392 and parts of #2398.
A detailed implementation plan follows below which can be transformed into individual issues and implemented step-by-step (iteratively) once the principle as such has been agreed.
Alternatives
Thread/Zigbee/WiSUN or even raw IEEE 802.15.4 might be regarded as alternatives. But these are to be seen as complementary protocols with different focus, strengths and weaknesses. Namely the superior approach to collision avoidance (deterministic latency) and channel hopping (reliability, resistance to interference) in TSCH as well as highly configurable throughput and latency per device (QoS) are strengths of the TSCH protocol while it is weaker when it comes to ease of configuration, deployment, administration and usage (which makes it less adequate in a home/office automation setting).
Solution Design
A premliminary analysis of the specification (IEEE 802.15.4-2015 or -2020) yielded the following tasks that might be implemented roughly in the order given below:
- Improve short address support in the IEEE 802.15.4 stack as a precondition for TSCH link tables (currently short addresses are not fully supported)
- may require a neighbor table(done, see net: l2: ieee802154: improved/fixed endianness and short address handling #50400) - Consolidate IEEE802.15.4 options in net_pkt:
- Consolidate all pre-existing IEEE 802.15.4-specific fields in net_pkt into a separate struct ieee802154_attr (or similar) pointed to from net_pkt and only allocated/assigned for packages directed to IEEE 802.15.4 interfaces. (Note: The current approach breaks net stack encapsulation, does not scale well and has increasingly negative memory usage effects when non-IEEE 802.15.4 interfaces are used in parallel with IEEE 802.15.4 interfaces.) (done, see Refactor/consolidate net pkt ieee802154 options #51266)
- Support for enhanced beacons and ACKs with TSCH specific IEs:
- Extension of the frame data model (structs, enums)
- Implement Header IEs (7.4.2)
- 7.4.2.7 Time Correction IE
- 7.4.2.17 Header Termination 1 IE
- Implement MLME Payload IE (7.4.3) with Nested IEs (7.4.4)
- 7.4.4.2 TSCH Synchronization IE
- 7.4.4.3 TSCH Slotframe and Link IE
- 7.4.4.4 TSCH Timeslot IE
- 7.4.4.31 Channel hopping IE
- Implement Header IEs (7.4.2)
- RX Support - Parsing and handling of enhanced beacons and ACKs in
ieee802154_recv(),ieee802154_handle_beacon()(i.e. MLME-BEACON-NOTIFY.indication primitive for enhanced beacons) andhandle_ack(). - TX Support - Creating and sending of enhanced beacons (i.e. MLME-BEACON.request/confirm primitive for enhanced beacons) and enhanced ACKs.
- Extension of the frame data model (structs, enums)
- MAC PIB extensions
- 8.4.2.1 General MAC PIB attributes for functional organization
- 8.4.2.2 TSCH-specific MAC PIB attributes
- 8.4.2.3 MAC PIB attributes for hopping sequence
- Consolidate MAC configuration
- Extend the IEEE 802.15.4 network management API to allow for generic configuration of additional MAC PIB attributes.
- MLME-GET.request/confirm
- MLME_SET.request/confirm
- MLME-RESET.request
- Implement required MLME extensions in the network management API
- MLME-SET-SLOTFRAME.request/confirm
- MLME-SET-LINK.request/confirm
- MLME-KEEP-ALIVE.request/confirm
- Implement required MLME extensions in KConfig
- MLME-TSCH-MODE.request/confirm (implies support for FFD/co-ordinator role to start a TSCH)
- Memory limits for slotframes, links and channel hopping sequences
- Selection of compile-time MAC PIB options (e.g. TSCH-CCA-mode, implicit broadcast)
- Extend the IEEE 802.15.4 driver API with a
get_attr()method as proposed in Add support to transport IEEE 802.15.4 PPDU + Padding between drivers instances and L2 - MAC #49775 . This would also enable proper headspace and FCS handling as proposed there by letting drivers communicate their headspace requirements and FCS handling approach to L2. - Neighbour Table
- Optional: Short address support for IEEE 802.15.4 security
- Structures to support per-neighbour TSCH link config and frame scheduling
- Implement TSCH PAN/Slotframe operation based on the Contiki-NG implementation which is well tested and can be largely re-used and adapted to Zephyr.
- 6.2.6 TSCH slotframe structure
- 6.2.10 Channel hopping
- 6.3.6 TSCH PAN formation
- 6.4.2 Additional disassociation behavior
- 6.5.4 Synchronization in TSCH PAN
- 6.7.1 Transmission: only one frame per slot if security is enabled
- 6.7.4.2 Acknowledgment
- 6.7.4.3 Retransmissions: deviating security procedure based on ASN
- 6.7.5/6 Transmission timing restrictions, guard time
- 7.2.1.3 Frame Pending field: extra behavior
- Chapter 9. Security: deviating behavior
- TSCH-specific CCA/CSMA:
- 6.2.5.1 Overview
- 6.2.5.2 TSCH CCA
- 6.2.5.3 TSCH CSMA
- Implementing timing should mostly be possible with the existing radio API. It is however probably that some minor changes to the API are required to support all features.
- Optional: Replace/deprecate CONFIG_IEEE802154_2015 (w/o breaking backwards compat):
- Better represent what this flag actually does. This flag is not meant to cover all -2015 features, it rather covers some very specific features (namely HW security, CSL) which should be named explicitly.
- Introduce a scalable configuration pattern (based on devicetree, Kconfig, net_mgmt - depending on the context) that can be extended to all -2015+ features and avoid further pollution of the configuration namespace by overly generic flags.
- Improve spec conformity of the IEEE 802.15.4-specific net_pkt content (e.g. wrt IEEE 802.15.4 frame version, ACK info, etc.).
- Optional: MAC data service extensions (MCPS-SAP, later on partly accessible via userland socket parameters) via the newly introduced net_pkt->ieee802154_attr, enabled by Kconfig feature switches.
- MCPS-DATA.request: NestedIeSubIdList, AckTx, SecurityLevel, KeyIdMode, KeySource, KeyIndex plus optionally HeaderIeList and PayloadIeList which are not strictly required for TSCH
- MCPS-DATA.confirm: Timestamp, PayloadIeList, AckPayload plus optionally HeaderIeList, NumBackoffs, return value: Status
- MCPS-DATA.indication: PayloadIeList, MpduLinkQuality, Timestamp, SecurityLevel, KeyIdMode, KeySource, KeyIndex plus optionally HeaderIeList, Dsn
- Optional: Socket extension
- Introduce AF_IEEE802154 specific sockets (additionally to the already introduced RAW/DGRAM versions) which allow binding, connection, socket options, etc. along the same line as Linux's AF_IEEE802154 socket.
- Extend & use socket_nm messages to configure L2 for TSCH, see https://elixir.bootlin.com/linux/latest/source/net/ieee802154/netlink.c#L84, https://elixir.bootlin.com/linux/latest/source/include/linux/nl802154.h#L11
- Optional: Introduce SOL_IEEE802154 socket option level: initially WPAN_WANTACK, WPAN_WANTLQI, WPAN_SECURITY, WPAN_SECURITY_LEVEL, see https://elixir.bootlin.com/linux/latest/source/net/ieee802154/socket.c#L873 plus additional TSCH-specific options.
UML
TSCH operation
IE Parser
Metadata
Metadata
Labels
Type
Projects
Status