Implementation in microPython of SCHC as specified in RFC 8724 [1].
MIT License, Copyright (c) 2022 Orange, by Quentin Lampin
Releases of microSCHC are available on PyPI. To install microSCHC, run
pip install microschc
Latest (pre-release) microSCHC versions can be built from source using hatch
and installed using the wheel (.whl) file generated in the dist/
folder.
build:
hatch build -t wheel
installation:
pip install dist/microschc-<version>-py3-none-any.whl
microSCHC aims at implementing the SCHC Compression/Decompression (C/D) and Fragmentation/Reassembly (F/R) routines described in RFC 8724 [1].
The initial focus of this effort is on the Compression/Decompression (C/D) routines and parsers for typical IoT protocol stacks, i.e. based on IPv6 [2], UDP [3], CoAP [4], lwM2M.
Current features:
-
Parsers
- IPv4
- IPv6
- UDP
- CoAP (partial test coverage: options missing)
- CoAP over UDP over IPv6 stack parser
- lwM2M ( when not using CoAP options, i.e. CoAP payloads) --> postponed to after full SCHC C/D implementation
-
Matching Operators (MO)
- equal
- ignore
- MSB(x)
- match-mapping
-
Compression/Decompression Actions (CDA)
-
Compression
- not-sent
- value-sent
- mapping-sent
- LSB
- compute-* (e.g. UDP-checksum)
- devIID
- AppIID
-
Decompression counterparts
- not-sent
- value-sent
- mapping-sent
- LSB
- [-] compute-* (e.g. UDP-checksum)
- UDP Checksum
- UDP Length
- IPv6 Payload Length
- IPv4 Payload Length
- devIID
- AppIID
-
-
Rules
- rule data model
- rule matching algorithm
- YANG model interpreter
-
Compression
- field (left-)packet
- field residues concatenation
- length of variable length field encoding
- packet compression
-
Context Management
- Definition & implementation of custom SCHC Context (not specified in RFCs)
- [1] "RFC 8724 SCHC: Generic Framework for Static Context Header Compression and Fragmentation" , A. Minaburo et al.
- [2] "RFC 8200 Internet Protocol, Version 6 (IPv6) Specification, S. Deering et al."
- [3] "RFC 768 User Datagram Protocol, J. Postel"
- [4] "RFC 7252 The Constrained Application Protocol (CoAP), Z. Shelby et al."