Skip to content

Kernel module to create a fake 6LoWPAN interface that connects to a character device for sending a receiving frames. Includes a user-space connector example for a serial radio.

License

Notifications You must be signed in to change notification settings

PalmaITEM/6lochar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

6lochar

Kernel module to create a fake 6LoWPAN interface that connects to a character device for sending a receiving frames.

Tested with 4.x.y Linux Kernel releases.

Why?

Even though 6LoWPAN is mostly used for IEEE 802.15.4 devices, other devices/radios can also benefit from the defined compression mechanisms.

The goal of this project was to demonstrate 6LoWPAN over a resource-constrained VHF link under the scope of the H2020 MSCA IF SINet project

How?

This kernel module registers a character device that can be read or written into, which in turn reads and writes 802.15.4 frames from and to the created wpan interface.

More details on why and how available on https://sinet.item.ntnu.no

Getting started

Load Module

Simply compile the kernel module with make and run ./load_module.

This should create a new lowpan interface with a random short address in the pan_id 0xbeef.

The load_module script loads the compiled kernel module and searches the last 5 lines for the path of the registered character device that will used for communication with the 802.15.4 stack. After creating the character device a new lowpan interface is added to wpan0.

Caveats

  1. The script "assumes" that no other wpan0 device already exists and should be adapted otherwise.

  2. Sometimes the Kernel never creates an initial address to the lowpan interface and the cause is unknown. In this event an error will be returned by iproute when running ./load_module. In this case, the only solution is to unload and load the module again.

  3. Caveat number 2 is only relevant when full IPHC is desired, otherwise it works fine despite the error.

Connect 6lochar to a radio/application

To connect the newly created interface to a radio or even an application reading and writing IEEE 802.15.4 frames, in the folder utils a connector example can be found and used as inspiration.

Specifically, this example provides the option to connect to the OWL radio, using the NGHAM-SPP protocol in the serial port /dev/ttyUSB0, if completed with a parser for NGHAM-SPP frames.

To-do list

Apart from a better organisation of some structures, the character device creation follows an outdated method, and should be changed.

About

Kernel module to create a fake 6LoWPAN interface that connects to a character device for sending a receiving frames. Includes a user-space connector example for a serial radio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published