Giter VIP home page Giter VIP logo

openschc's Introduction

What is OpenSCHC ?

OpenSCHC

OpenSCHC is a OpenSource Implementation of SCHC (Static Context Header Compression) currently being standardized by the LPWAN Working Group at the IETF. Oversimplifying, this is essentially IPv6 compression and fragmentation intended for low datarate, long range IoT networks.

The short/medium term goal is to organize SCHC Hackathons that occur at the IETF meetings.

The long term wish is to have a stable, open-source, reference codebase for the SCHC protocol (in Python)

OpenSCHC is developed to work with micropython.

ToDo - See branches here : https://github.com/openschc/openschc/network .

OpenSCHC is licensed under the MIT License .

Further documentation about OpenSCHC is available following https://github.com/openschc/openschc/wiki .

Understanding the architecture

A global architecture of openSCHC implementation is shown below:

OpenSCHC Architecture

The Rule Manager stores a set of Rules and provides methods to install or retreive Rules.

Rules are composed of two elements:

  • A RuleID which identifies the Rule by its number, and
  • A content which contains an array of fields. For details, refer to the SCHC protocol

The App 1 ... App n are the applications that invoke the SCHC Orchestrator to run the necessary SCHC operations, which are briefly defined below:

Compression is used on the sender side to compress the header of a packet provided by the App, using a specific rule (identified by its RuleID). Decompression: on the receiver side, upon receiving a compressed packet, the Decompresser is invoked to rebuild the original packet, using the Rule identified by the RuleID carried in the compressed packet.

Fragmentation is invoked on the sender side with a RuleID to generate a set of fragments out of a packet (compressed or uncompressed). Reassembly is used on the receiver side to reconstruct the packet out of the set of fragments.

Fragmentation modes and the associated parameters are described in the SCHC protocol .

Network Connector interfaces to a physical model to a real LPWAN network such as LoRa or Sigfox, or to a link simulator.

Installing the environment

Setting up the environment using Python3

Step 1 : Make sure you have a Python3 version installed. Check your python version with the following command and update the python version, if necessary:

python --version

Step 2: Clone the OpenSCHC repository .

Step 3: For testing a simple example using SCHC under different scenarios, see https://github.com/openschc/openschc/blob/master/src/README.rst.

Setting up the environment using micropython

Micropython is Python3 for microcontrollers, but it also runs on Windows/Linux/Unix machine. Ues this to test your code on a computer before trying on an embedded device.

Step 1: install micropython. Some pointers are indicated below. For more details, please refer to the relevant documentation.

Step 2: download the needed micropython modules.

Modules to be installed in order to run SCHC are:

  • argparse.py : ./micropython -m upip install micropython-argparse
  • copy.py : ./micropython -m upip install micropython-copy
  • types.py : ./micropython -m upip install micropython-types

Libs are located under ~/.micropython/lib

Step 3: Test the SCHC C/D and F/R

The following command line will simulate a simple ICMPv6 echo request/response using the SCHC protocol between the SCHC device and the gateway. The input JSON files are part of the SCHC orchestrator configuration (as you can see in the architecture figure above), and the loss parameters configure the link simulator to simulate packet drops on the radio link.

As you can see from the results of the below command, the 1st and the 2nd SCHC fragments are lost. Therefore, when the sender transmits the last fragment that includes the MIC, the receiver MIC check fails. Consequently, the sender retransmits the 1st and 2nd fragments and when the receiver receives all the fragments with the MIC, the transmission is successful:

micropython $youropenschcdirectory/src/test_newschc.py --context \
example/context-100.json --rule-comp example/comp-rule-100.json \
--rule-fragin example/frag-rule-101.json --rule-fragout \
example/frag-rule-102.json --data-file test/icmpv6.dmp \
--loss-mode list --loss-param 1,2

File classification

Refer to the :doc:`Source/File_Classification` for an overview of the source code repository.

openschc's People

Contributors

tanupoo avatar adjih avatar bernard-a avatar dbarthel-ol avatar ltn22 avatar jia200x avatar sandoche2k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.