SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
Adding IEEE 802.15.4 and
6LoWPAN to an Embedded
Linux Device
FOSDEM 2017
2017-02-05, Brussels
Stefan Schmidt
stefan@osg.samsung.com
Samsung Open Source Group
Agenda
● Motivation
● Linux-wpan Project
● Hardware
● Configuration
● Communication with RIOT and Contiki
Motivation
IEEE 802.15.4
● IEEE specifications for Low-Rate Wireless
Personal Area Networks
● Not only low-rate, but also low-power
● Designed for small sensors to run months/years
on battery with the right duty cycle
● 127 bytes MTU and 250 kbit/s
● Sometimes confused with ZigBee as it is used
as PHY and MAC layer there
6LoWPAN
● Physical and MAC layer defined by IEEE 802.15.4
from 2003 onwards (latest update from 2015)
● Series of IETF specifications from 2007 onwards
(RFCs 4944, 6282, etc)
L3 Network Layer
L4 Transport Layer
L1 Physical Layer
L5 Application Layer
L2 Data Link Layer
IP
TCP | UDP | ICMP
Ethernet PHY
Application
Ethernet MAC
IPv6
UDP | ICMPv6
6LoWPAN
IEEE 802.15.4 PHY
Application
IEEE 802.15.4 MAC
The Header Size Problem
● Worst-case scenario calculations
● Maximum frame size in IEEE 802.15.4: 127 bytes
● Reduced by the max. frame header (25 bytes): 102 bytes
● Reduced by highest link-layer security (21 bytes): 81 bytes
● Reduced by standard IPv6 header (40 bytes): 41 bytes
● Reduced by standard UDP header (8 bytes): 33 bytes
● This leaves only 33 bytes for actual payload
● The rest of the space is used by headers (~ 3:1 ratio)
Frame Header (25) LLSEC (21) IPv6 Header (40) UDP Payload (33)
The Header Size Problem
● Worst-case scenario calculations
● Maximum frame size in IEEE 802.15.4: 127 bytes
● Reduced by the max. frame header (25 bytes): 102 bytes
● Reduced by highest link-layer security (21 bytes): 81 bytes
● Reduced by standard IPv6 header (40 bytes): 41 bytes
● Reduced by standard UDP header (8 bytes): 33 bytes
● This leaves only 33 bytes for actual payload
● The rest of the space is used by headers (~ 3:1 ratio)
Frame Header (25) LLSEC (21) IPv6 Header (40) UDP Payload (33)
The Header Size Solution
● IPv6 with link-local and UDP on top
● IPHC with NHC for UDP
● The 48 bytes IPv6 + UDP header could in
the best cases be reduced to 6 bytes
● That allows for a payload of 75 bytes (~ 2:3
ratio)
Frame Header (25) LLSEC (21) 6 Payload (75)
Dispatch (1) LOWPAN_IPHC (1) LOWPAN_NHC (1) UDP Ports (1) UDP Checksum (2)
Linux-wpan
● Platforms already running Linux would benefit from
native IEEE 802.15.4 and 6LoWPAN subsystems
● IEEE 802.15.4 transceivers can easily be added to
existing hardware designs
● Battery powered sensors on the other hand are
more likely to run an OS like RIOT or Contiki
● Example 1: Google OnHub AP which already comes
with, de-activated, IEEE 802.15.4 hardware
● Example 2: Ci40 Creator board as home IoT hub
Linux-wpan Project
Linux-wpan Project
● IEEE 802.15.4 and 6LoWPAN support in mainline
● Started in 2008 as linux-zigbee project, from 2012
mainline
● New project name to avoid confusion: linux-wpan
● Normal kernel development model
● Patches are posted and reviewed on the mailing list
● Small community: 2 core devs and ~4 additional people
for specific drivers
● Linux-wpan mailing list (~93 people), IRC (~29 people)
Current Status
● ieee802154 layer with softMAC driver for various
transceivers
●
6LoWPAN with fragmentation and reassembly (RFC 4944)
●
Header compression with IPHC and NHC for UDP
(RFC 6282), shared with Bluetooth subsystem
●
Link Layer Security
●
Testing between Linux, RIOT and Contiki
●
Mainline 4.1 onwards recommended
●
Active development, newer is better :-)
Development Boards
● MIPS based Ci40 Creator (CA-8210)
● Raspberry Pi with Openlabs shield (AT86RF233)
● Transceivers can be hooked up via SPI
(all drivers have devicetree bindings)
● ATUSB dongle
Werner Almesberger, CC-BY-SA 3.0
Permission granted by Imagination Technologies
Hardware
Hardware
Requirements
● Free SPI port
● Some additional free GPIO pins
● You can choose between off the shelf
modules or adding it directly to your
design
● Alternatively you could use USB
Devicetree Bindings
● Boards need
devicetree support
● All our drivers have
bindings
● Example for the
at86rf233:
&spi {
status = "okay";
at86rf233@0 {
compatible = "atmel,at86rf233";
spi-max-frequency = <6000000>;
reg = <0>;
interrupts = <23 4>;
interrupt-parent = <&gpio>;
reset-gpio = <&gpio 24 1>;
sleep-gpio = <&gpio 25 1>;
xtal-trim = /bits/ 8 <0x0F>;
};
};
Hardware Support
● Mainline drivers for at86rf2xx, mrf24j40,
cc2520, atusb and adf7242
● Pending driver for ca-8210
● Old out of tree driver for Xbee
● ATUSB dongle to be used on your
workstation
Transceiver Comparison
Chipset Interface Driver 2.4 GHz Sub GHz ARET IEEE specs
ADF7242 SPI or PMOD ✔ ✔ ✘ ✔ 2003-2006
AT86RF212 SPI + GPIO ✔ ✘ ✔ ✔ 2003-2006
AT86RF212b SPI + GPIO ✔ ✘ ✔ ✔ 2003-2011
AT86RF215 SPI + GPIO +
LVDS
✘ ✔ ✔ ✔ 2003-2011,
15.4g
AT86RF230 SPI + GPIO ✘ ✔ ✘ ✔ 2003
AT86RF231 SPI + GPIO ✔ ✔ ✘ ✔ 2003-2006
AT86RF233 SPI + GPIO ✔ ✔ ✘ ✔ 2003-2011
ATUSB (AT86RF231) USB ✔ ✔ ✘ ✔ 2003-2006
RZUSB (AT86RF230) USB ✔ ✔ ✘ ✔* 2003
CA8210 SPI + GPIO ✔* ✔ ✘ ✔ 2003-2006
CC2420 SPI + GPIO ✘ ✔ ✘ ✘ 2003
CC2520 SPI + GPIO ✔ ✔ ✘ ✘ 2003-2006
CC2531 USB ✘ ✔ ✘ ✘* 2003-2006
MRF24J40 SPI + GPIO ✔ ✔ ✘ ✔ 2003
XBee UART ✘* ✔ ✘ ✔ 2003??
Virtual Driver
● Fake loopback driver (similar to hwsim of wireless)
● Great for testing
● Support for RIOT and OpenThread to use this when
running as native Linux process
● Will help interoperation testing between the different
network stacks in an virtual environment
$ modprobe fakelb numlbs=4
$ Configure for Linux, RIOT, OpenThread and monitor
Configuration
Wpan-tools: iwpan
● Userspace configuration utility
● Netlink interface ideas as well as code borrowed from the
iw utility
●
Used to configure PHY and MAC layer parameters
● Including: channel, PAN ID, power settings, short address,
frame retries, etc
●
Packaged by some distributions (Fedora and Debian up to
date, Ubuntu on 0.5, OpenSUSE, Gentoo, Arch, etc
missing)
Wpan-tools: wpan-ping
● Ping utility on the IEEE 802.15.4 layer
● Not a full ICMP ping replacement, but good
enough for some basic testing and measurements
# run on server side
$ wpan-ping –-daemon
# run on client side
$ wpan-ping –-count 100 –-extended –-address
00:11:22:33:44:55:66:77
Interface Bringup
● The wpan0 interface shows up automatically
● Setting up the basic parameters:
$ ip link set lowpan0 down
$ ip link set wpan0 down
$ iwpan dev wpan0 set pan_id 0xabcd
$ iwpan phy phy0 set channel 0 26
$ ip link add link wpan0 name lowpan0 type lowpan
$ ip link set wpan0 up
$ ip link set lowpan0 up
Monitoring
● Setting up the interface in promiscuous mode:
$ iwpan dev wpan0 del
$ iwpan phy phy0 interface add monitor%d type monitor
$ iwpan phy phy0 set channel 0 26
$ ip link set monitor0 up
$ wireshark -i monitor0
● No automatic channel hopping (you can change the
channel manually in the background)
Communication with RIOT &
Contiki
RIOT
● “The friendly Operating System for the
Internet of Things” (LGPL)
● Testing against Linux-wpan is part of the
release testing process for RIOT
● Active developer discussions and bug
fixing between projects
Contiki
● “The Open Source OS for the Internet of Things”
(BSD)
● Very fragmented project
● Sadly many forks for academic or commercial
purpose which have a hard time to get merged
● Still an important role as IoT OS for tiny devices
Comparison
Feature Linux RIOT Contiki
IEEE 802.15.4: data and ACK frames ✔ ✔ ✔
IEEE 802.15.4: beacon and MAC command frames ✘ ✘ ✘
IEEE 802.15.4: scanning, joining, PAN coordinator ✘ ✘ ✘
IEEE 802.15.4: link layer security ✔ ✘ ✔
6LoWPAN: frame encapsulation, fragmentation, addressing (RFC 4944) ✔ ✔ ✔
6LoWPAN: IP header compression (RFC 6282) ✔ ✔ ✔
6LoWPAN: next header compression, UDP only (RFC 6282) ✔ ✔ ✔
6LoWPAN: generic header compression (RFC 7400) ✘ ✘ ✘
6LoWPAN: neighbour discovery optimizations (RFC 6775) Partial ✔ ✘
RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks ✔ ✔ ✔
Mesh link establishment draft ✘ ✘ ✘
Others
● mbed OS from ARM: network stack is
closed source, so nothing to test against
● Zephyr: new network stack not tested yet
● OpenThread: Open Source
implementation of the Thread protocol
Future
Linux-wpan Future
●
Implement missing parts of the IEEE 802.15.4 specification
● Beacon and MAC command frame support
● Coordinator support in MAC layer and wpan-tools
● Scanning
● Add better support for HardMAC transceivers
● Neighbour Discovery Optimizations (RFC 6775), started
●
Evaluate running OpenThread on top of linux-wpan
●
Configuration interface for various header compression
modules
●
Expose information for route-over and mesh-under protocols
Summary
Take away
● Running an IEEE 802.15.4 wireless
network under Linux is not hard
● Tooling and kernel support is already
there
● Border router scenario most likely use
case but nodes or routers also possible
Thank you!
http://www.slideshare.net/SamsungOSG
References
● IEEE 802.15.4 specification (PHY and MAC layer)
http://standards.ieee.org/about/get/802/802.15.html
● RFC 4944: Transmission of IPv6 Packets over IEEE 802.15.4 Networks
https://tools.ietf.org/html/rfc4944
● RFC 6282: Compression Format for IPv6 Datagrams over IEEE 802.15.4-Based Networks
https://tools.ietf.org/html/rfc6282
● RFC 7400: 6LoWPAN-GHC: Generic Header Compression for IPv6 over Low-Power Wireless
Personal Area Networks (6LoWPANs)
https://tools.ietf.org/html/rfc7400
● Linux-wpan source and project pages
https://github.com/linux-wpan
http://wpan.cakelab.org/
6LoWPAN Fragmentation
● IPv6 requires the link to allow for a MTU of at least 1280
bytes
● This is impossible to handle in the 127 bytes MTU of
IEEE 802.15.4
● 6LoWPAN 11 bit fragmentation header allows for 2048
bytes packet size with fragmentation
● But fragmentation can still lead to bad performance in
lossy networks, best to avoid it in the first place
IPv6 Header Compression (IPHC)
●
Defining some default values in IPv6 header
– Version == 6, traffic class & flow-label == 0, hop-limit only well-known values (1, 64, 255)
– Remove the payload length (available in 6LoWPAN fragment header or data-link header)
●
IPv6 stateless address auto configuration based on L2 address
– Omit the IPv6 prefix (global known by network, link-local defined by compression
(FE80::/64)
– Extended: EUI-64 L2 address use as is
– Short: pseudo 48 bit address based short address: PAN_ID:16 bit zero:SHORT_ADDRESS
Version
Source Address
(128 bit)
Destination Address
(128 bit)
Traffic Class Flow Label (20 bit)
Payload Length (16 bit) Next Header Hop Limit (8 bit)
Source Address
Dispatch
6LoWPAN Header IPHC multi-hop (7 bytes)
Hop LimitLoWPAN_IPHC
Destination Address
Dispatch
6LoWPAN Header IPHC link-local (2 bytes)
LoWPAN_IPHC
Next Header Compression
● NHC IPv6 Extension Header compression (RFC6282)
– Hop-by-Hop, Routing Header, Fragment Header, Destination
Options Header, Mobility Header
● NHC UDP Header compression (RFC6282)
– Compressing ports range to 4 bits
– Allows to omit the UDP checksum for cases where upper layers
handle message integrity checks
● GHC: LZ-77 style compression with byte codes (RFC7400)
– Appending zeroes, back referencing to a static dictionary and copy
– Useful for DTLS or RPL (addresses elided from dictionary)
Link Layer Security
Link Layer Security
● Specified by IEEE 802.15.4
● It defines confidentiality (AES-CTR), integrity (AES
CBC-MAC) and encryption and authentication (AES
CCM) security suites
● Key handling, key exchange, roll over, etc is not defined
● Tested Linux against Linux and Contiki 3.0
● No way to test against RIOT as they have no LLSEC
support right now
LLSEC Linux-wpan
● Needs the llsec branch in wpan-tools for
configuration
● CONFIG_IEEE802154_NL802154_EXPERIMENTAL
$ iwpan dev wpan0 set security 1
$ iwpan dev wpan0 key add 2 $KEY 0 $PANID 3 $EXTADDR
$ iwpan dev wpan0 seclevel add 0xff 2 0
$ iwpan dev wpan0 device add 0 $PANID $SHORTADDR $EXTADDR 0
0
LLSEC Contiki 3.0
● You need the following Contiki build options
configured in your project-conf.h to make use of
LLSEC with network wide key:
#define NETSTACK_CONF_LLSEC noncoresec_driver
#define LLSEC802154_CONF_SECURITY_LEVEL FRAME802154_SECURITY_LEVEL_ENC_MIC_32
#define NONCORESEC_CONF_KEY { 
0x00, 0x01, 0x02, 0x03, 
0x04, 0x05, 0x06, 0x07, 
0x08, 0x09, 0x0A, 0x0B, 
0x0C, 0x0D, 0x0E, 0x0F, 
}

Contenu connexe

Tendances

LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 

Tendances (20)

Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Introduction to IoT.JS
Introduction to IoT.JSIntroduction to IoT.JS
Introduction to IoT.JS
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Development Boards for Tizen IoT
Development Boards for Tizen IoTDevelopment Boards for Tizen IoT
Development Boards for Tizen IoT
 
P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
 
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPANLinux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201
 
LAS16-200: SCMI - System Management and Control Interface
LAS16-200:  SCMI - System Management and Control InterfaceLAS16-200:  SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control Interface
 
Ryu sdn framework
Ryu sdn framework Ryu sdn framework
Ryu sdn framework
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVA
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206
 
BKK16-213 Where's the Hardware?
BKK16-213 Where's the Hardware?BKK16-213 Where's the Hardware?
BKK16-213 Where's the Hardware?
 

En vedette

IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
adamdunkels
 
UL Consumer Technology
UL Consumer TechnologyUL Consumer Technology
UL Consumer Technology
Keith Gilbert
 
Power Management in Wireless Sensor Network
Power Management in Wireless Sensor NetworkPower Management in Wireless Sensor Network
Power Management in Wireless Sensor Network
Bhavik Panchal
 

En vedette (15)

IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
Arduino compatible layer (with 6LoWPAN) on Contiki
Arduino compatible layer (with 6LoWPAN) on ContikiArduino compatible layer (with 6LoWPAN) on Contiki
Arduino compatible layer (with 6LoWPAN) on Contiki
 
Toward "OCF Automotive" profile
Toward "OCF Automotive" profileToward "OCF Automotive" profile
Toward "OCF Automotive" profile
 
Linux introduction, class 1
Linux introduction, class 1Linux introduction, class 1
Linux introduction, class 1
 
Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network
 
6lowpan
6lowpan 6lowpan
6lowpan
 
IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
 
Guide to Open Source Compliance
Guide to Open Source ComplianceGuide to Open Source Compliance
Guide to Open Source Compliance
 
UL Consumer Technology
UL Consumer TechnologyUL Consumer Technology
UL Consumer Technology
 
WP1 Gateway HW Design & Implementation
WP1 Gateway HW Design & ImplementationWP1 Gateway HW Design & Implementation
WP1 Gateway HW Design & Implementation
 
Wireless Sensors and Control Networks
Wireless Sensors and Control NetworksWireless Sensors and Control Networks
Wireless Sensors and Control Networks
 
Power Management in Wireless Sensor Network
Power Management in Wireless Sensor NetworkPower Management in Wireless Sensor Network
Power Management in Wireless Sensor Network
 
Presentation 6lowpan
Presentation 6lowpanPresentation 6lowpan
Presentation 6lowpan
 
Clang: More than just a C/C++ Compiler
Clang: More than just a C/C++ CompilerClang: More than just a C/C++ Compiler
Clang: More than just a C/C++ Compiler
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
 

Similaire à Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device

Similaire à Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device (20)

6LoWPAN: An open IoT Networking Protocol
6LoWPAN: An open IoT Networking Protocol6LoWPAN: An open IoT Networking Protocol
6LoWPAN: An open IoT Networking Protocol
 
SFScon 21 - Stefan Schmidt - The Rise of IPv6 in IoT Protocols
SFScon 21 - Stefan Schmidt - The Rise of IPv6 in IoT ProtocolsSFScon 21 - Stefan Schmidt - The Rise of IPv6 in IoT Protocols
SFScon 21 - Stefan Schmidt - The Rise of IPv6 in IoT Protocols
 
Summit 16: How to Compose a New OPNFV Solution Stack?
Summit 16: How to Compose a New OPNFV Solution Stack?Summit 16: How to Compose a New OPNFV Solution Stack?
Summit 16: How to Compose a New OPNFV Solution Stack?
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
 
Stacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStackStacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStack
 
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
 
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
DPDK summit 2015: It's kind of fun  to do the impossible with DPDKDPDK summit 2015: It's kind of fun  to do the impossible with DPDK
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
 
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro NakajimaDPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
 
CodiLime Tech Talk - Adam Kułagowski: IPv6 - introduction
CodiLime Tech Talk - Adam Kułagowski: IPv6 - introductionCodiLime Tech Talk - Adam Kułagowski: IPv6 - introduction
CodiLime Tech Talk - Adam Kułagowski: IPv6 - introduction
 
L6 6 lowpan
L6 6 lowpanL6 6 lowpan
L6 6 lowpan
 
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchDPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...
DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...
DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install Environment
 
RouterOS v6
RouterOS v6RouterOS v6
RouterOS v6
 
2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANL2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANL
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
 
100 M pps on PC.
100 M pps on PC.100 M pps on PC.
100 M pps on PC.
 
100G Networking Berlin.pdf
100G Networking Berlin.pdf100G Networking Berlin.pdf
100G Networking Berlin.pdf
 

Plus de Samsung Open Source Group

Plus de Samsung Open Source Group (10)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
OIC AGL Collaboration
OIC AGL CollaborationOIC AGL Collaboration
OIC AGL Collaboration
 
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devicesIoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
 
IoTivity on Tizen: How to
IoTivity on Tizen: How toIoTivity on Tizen: How to
IoTivity on Tizen: How to
 

Dernier

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 

Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device

  • 1. Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device FOSDEM 2017 2017-02-05, Brussels Stefan Schmidt stefan@osg.samsung.com Samsung Open Source Group
  • 2. Agenda ● Motivation ● Linux-wpan Project ● Hardware ● Configuration ● Communication with RIOT and Contiki
  • 4. IEEE 802.15.4 ● IEEE specifications for Low-Rate Wireless Personal Area Networks ● Not only low-rate, but also low-power ● Designed for small sensors to run months/years on battery with the right duty cycle ● 127 bytes MTU and 250 kbit/s ● Sometimes confused with ZigBee as it is used as PHY and MAC layer there
  • 5. 6LoWPAN ● Physical and MAC layer defined by IEEE 802.15.4 from 2003 onwards (latest update from 2015) ● Series of IETF specifications from 2007 onwards (RFCs 4944, 6282, etc) L3 Network Layer L4 Transport Layer L1 Physical Layer L5 Application Layer L2 Data Link Layer IP TCP | UDP | ICMP Ethernet PHY Application Ethernet MAC IPv6 UDP | ICMPv6 6LoWPAN IEEE 802.15.4 PHY Application IEEE 802.15.4 MAC
  • 6. The Header Size Problem ● Worst-case scenario calculations ● Maximum frame size in IEEE 802.15.4: 127 bytes ● Reduced by the max. frame header (25 bytes): 102 bytes ● Reduced by highest link-layer security (21 bytes): 81 bytes ● Reduced by standard IPv6 header (40 bytes): 41 bytes ● Reduced by standard UDP header (8 bytes): 33 bytes ● This leaves only 33 bytes for actual payload ● The rest of the space is used by headers (~ 3:1 ratio) Frame Header (25) LLSEC (21) IPv6 Header (40) UDP Payload (33)
  • 7. The Header Size Problem ● Worst-case scenario calculations ● Maximum frame size in IEEE 802.15.4: 127 bytes ● Reduced by the max. frame header (25 bytes): 102 bytes ● Reduced by highest link-layer security (21 bytes): 81 bytes ● Reduced by standard IPv6 header (40 bytes): 41 bytes ● Reduced by standard UDP header (8 bytes): 33 bytes ● This leaves only 33 bytes for actual payload ● The rest of the space is used by headers (~ 3:1 ratio) Frame Header (25) LLSEC (21) IPv6 Header (40) UDP Payload (33)
  • 8. The Header Size Solution ● IPv6 with link-local and UDP on top ● IPHC with NHC for UDP ● The 48 bytes IPv6 + UDP header could in the best cases be reduced to 6 bytes ● That allows for a payload of 75 bytes (~ 2:3 ratio) Frame Header (25) LLSEC (21) 6 Payload (75) Dispatch (1) LOWPAN_IPHC (1) LOWPAN_NHC (1) UDP Ports (1) UDP Checksum (2)
  • 9. Linux-wpan ● Platforms already running Linux would benefit from native IEEE 802.15.4 and 6LoWPAN subsystems ● IEEE 802.15.4 transceivers can easily be added to existing hardware designs ● Battery powered sensors on the other hand are more likely to run an OS like RIOT or Contiki ● Example 1: Google OnHub AP which already comes with, de-activated, IEEE 802.15.4 hardware ● Example 2: Ci40 Creator board as home IoT hub
  • 11. Linux-wpan Project ● IEEE 802.15.4 and 6LoWPAN support in mainline ● Started in 2008 as linux-zigbee project, from 2012 mainline ● New project name to avoid confusion: linux-wpan ● Normal kernel development model ● Patches are posted and reviewed on the mailing list ● Small community: 2 core devs and ~4 additional people for specific drivers ● Linux-wpan mailing list (~93 people), IRC (~29 people)
  • 12. Current Status ● ieee802154 layer with softMAC driver for various transceivers ● 6LoWPAN with fragmentation and reassembly (RFC 4944) ● Header compression with IPHC and NHC for UDP (RFC 6282), shared with Bluetooth subsystem ● Link Layer Security ● Testing between Linux, RIOT and Contiki ● Mainline 4.1 onwards recommended ● Active development, newer is better :-)
  • 13. Development Boards ● MIPS based Ci40 Creator (CA-8210) ● Raspberry Pi with Openlabs shield (AT86RF233) ● Transceivers can be hooked up via SPI (all drivers have devicetree bindings) ● ATUSB dongle Werner Almesberger, CC-BY-SA 3.0 Permission granted by Imagination Technologies
  • 15. Hardware Requirements ● Free SPI port ● Some additional free GPIO pins ● You can choose between off the shelf modules or adding it directly to your design ● Alternatively you could use USB
  • 16. Devicetree Bindings ● Boards need devicetree support ● All our drivers have bindings ● Example for the at86rf233: &spi { status = "okay"; at86rf233@0 { compatible = "atmel,at86rf233"; spi-max-frequency = <6000000>; reg = <0>; interrupts = <23 4>; interrupt-parent = <&gpio>; reset-gpio = <&gpio 24 1>; sleep-gpio = <&gpio 25 1>; xtal-trim = /bits/ 8 <0x0F>; }; };
  • 17. Hardware Support ● Mainline drivers for at86rf2xx, mrf24j40, cc2520, atusb and adf7242 ● Pending driver for ca-8210 ● Old out of tree driver for Xbee ● ATUSB dongle to be used on your workstation
  • 18. Transceiver Comparison Chipset Interface Driver 2.4 GHz Sub GHz ARET IEEE specs ADF7242 SPI or PMOD ✔ ✔ ✘ ✔ 2003-2006 AT86RF212 SPI + GPIO ✔ ✘ ✔ ✔ 2003-2006 AT86RF212b SPI + GPIO ✔ ✘ ✔ ✔ 2003-2011 AT86RF215 SPI + GPIO + LVDS ✘ ✔ ✔ ✔ 2003-2011, 15.4g AT86RF230 SPI + GPIO ✘ ✔ ✘ ✔ 2003 AT86RF231 SPI + GPIO ✔ ✔ ✘ ✔ 2003-2006 AT86RF233 SPI + GPIO ✔ ✔ ✘ ✔ 2003-2011 ATUSB (AT86RF231) USB ✔ ✔ ✘ ✔ 2003-2006 RZUSB (AT86RF230) USB ✔ ✔ ✘ ✔* 2003 CA8210 SPI + GPIO ✔* ✔ ✘ ✔ 2003-2006 CC2420 SPI + GPIO ✘ ✔ ✘ ✘ 2003 CC2520 SPI + GPIO ✔ ✔ ✘ ✘ 2003-2006 CC2531 USB ✘ ✔ ✘ ✘* 2003-2006 MRF24J40 SPI + GPIO ✔ ✔ ✘ ✔ 2003 XBee UART ✘* ✔ ✘ ✔ 2003??
  • 19. Virtual Driver ● Fake loopback driver (similar to hwsim of wireless) ● Great for testing ● Support for RIOT and OpenThread to use this when running as native Linux process ● Will help interoperation testing between the different network stacks in an virtual environment $ modprobe fakelb numlbs=4 $ Configure for Linux, RIOT, OpenThread and monitor
  • 21. Wpan-tools: iwpan ● Userspace configuration utility ● Netlink interface ideas as well as code borrowed from the iw utility ● Used to configure PHY and MAC layer parameters ● Including: channel, PAN ID, power settings, short address, frame retries, etc ● Packaged by some distributions (Fedora and Debian up to date, Ubuntu on 0.5, OpenSUSE, Gentoo, Arch, etc missing)
  • 22. Wpan-tools: wpan-ping ● Ping utility on the IEEE 802.15.4 layer ● Not a full ICMP ping replacement, but good enough for some basic testing and measurements # run on server side $ wpan-ping –-daemon # run on client side $ wpan-ping –-count 100 –-extended –-address 00:11:22:33:44:55:66:77
  • 23. Interface Bringup ● The wpan0 interface shows up automatically ● Setting up the basic parameters: $ ip link set lowpan0 down $ ip link set wpan0 down $ iwpan dev wpan0 set pan_id 0xabcd $ iwpan phy phy0 set channel 0 26 $ ip link add link wpan0 name lowpan0 type lowpan $ ip link set wpan0 up $ ip link set lowpan0 up
  • 24. Monitoring ● Setting up the interface in promiscuous mode: $ iwpan dev wpan0 del $ iwpan phy phy0 interface add monitor%d type monitor $ iwpan phy phy0 set channel 0 26 $ ip link set monitor0 up $ wireshark -i monitor0 ● No automatic channel hopping (you can change the channel manually in the background)
  • 26. RIOT ● “The friendly Operating System for the Internet of Things” (LGPL) ● Testing against Linux-wpan is part of the release testing process for RIOT ● Active developer discussions and bug fixing between projects
  • 27. Contiki ● “The Open Source OS for the Internet of Things” (BSD) ● Very fragmented project ● Sadly many forks for academic or commercial purpose which have a hard time to get merged ● Still an important role as IoT OS for tiny devices
  • 28. Comparison Feature Linux RIOT Contiki IEEE 802.15.4: data and ACK frames ✔ ✔ ✔ IEEE 802.15.4: beacon and MAC command frames ✘ ✘ ✘ IEEE 802.15.4: scanning, joining, PAN coordinator ✘ ✘ ✘ IEEE 802.15.4: link layer security ✔ ✘ ✔ 6LoWPAN: frame encapsulation, fragmentation, addressing (RFC 4944) ✔ ✔ ✔ 6LoWPAN: IP header compression (RFC 6282) ✔ ✔ ✔ 6LoWPAN: next header compression, UDP only (RFC 6282) ✔ ✔ ✔ 6LoWPAN: generic header compression (RFC 7400) ✘ ✘ ✘ 6LoWPAN: neighbour discovery optimizations (RFC 6775) Partial ✔ ✘ RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks ✔ ✔ ✔ Mesh link establishment draft ✘ ✘ ✘
  • 29. Others ● mbed OS from ARM: network stack is closed source, so nothing to test against ● Zephyr: new network stack not tested yet ● OpenThread: Open Source implementation of the Thread protocol
  • 31. Linux-wpan Future ● Implement missing parts of the IEEE 802.15.4 specification ● Beacon and MAC command frame support ● Coordinator support in MAC layer and wpan-tools ● Scanning ● Add better support for HardMAC transceivers ● Neighbour Discovery Optimizations (RFC 6775), started ● Evaluate running OpenThread on top of linux-wpan ● Configuration interface for various header compression modules ● Expose information for route-over and mesh-under protocols
  • 33. Take away ● Running an IEEE 802.15.4 wireless network under Linux is not hard ● Tooling and kernel support is already there ● Border router scenario most likely use case but nodes or routers also possible
  • 35. References ● IEEE 802.15.4 specification (PHY and MAC layer) http://standards.ieee.org/about/get/802/802.15.html ● RFC 4944: Transmission of IPv6 Packets over IEEE 802.15.4 Networks https://tools.ietf.org/html/rfc4944 ● RFC 6282: Compression Format for IPv6 Datagrams over IEEE 802.15.4-Based Networks https://tools.ietf.org/html/rfc6282 ● RFC 7400: 6LoWPAN-GHC: Generic Header Compression for IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) https://tools.ietf.org/html/rfc7400 ● Linux-wpan source and project pages https://github.com/linux-wpan http://wpan.cakelab.org/
  • 36. 6LoWPAN Fragmentation ● IPv6 requires the link to allow for a MTU of at least 1280 bytes ● This is impossible to handle in the 127 bytes MTU of IEEE 802.15.4 ● 6LoWPAN 11 bit fragmentation header allows for 2048 bytes packet size with fragmentation ● But fragmentation can still lead to bad performance in lossy networks, best to avoid it in the first place
  • 37. IPv6 Header Compression (IPHC) ● Defining some default values in IPv6 header – Version == 6, traffic class & flow-label == 0, hop-limit only well-known values (1, 64, 255) – Remove the payload length (available in 6LoWPAN fragment header or data-link header) ● IPv6 stateless address auto configuration based on L2 address – Omit the IPv6 prefix (global known by network, link-local defined by compression (FE80::/64) – Extended: EUI-64 L2 address use as is – Short: pseudo 48 bit address based short address: PAN_ID:16 bit zero:SHORT_ADDRESS Version Source Address (128 bit) Destination Address (128 bit) Traffic Class Flow Label (20 bit) Payload Length (16 bit) Next Header Hop Limit (8 bit) Source Address Dispatch 6LoWPAN Header IPHC multi-hop (7 bytes) Hop LimitLoWPAN_IPHC Destination Address Dispatch 6LoWPAN Header IPHC link-local (2 bytes) LoWPAN_IPHC
  • 38. Next Header Compression ● NHC IPv6 Extension Header compression (RFC6282) – Hop-by-Hop, Routing Header, Fragment Header, Destination Options Header, Mobility Header ● NHC UDP Header compression (RFC6282) – Compressing ports range to 4 bits – Allows to omit the UDP checksum for cases where upper layers handle message integrity checks ● GHC: LZ-77 style compression with byte codes (RFC7400) – Appending zeroes, back referencing to a static dictionary and copy – Useful for DTLS or RPL (addresses elided from dictionary)
  • 40. Link Layer Security ● Specified by IEEE 802.15.4 ● It defines confidentiality (AES-CTR), integrity (AES CBC-MAC) and encryption and authentication (AES CCM) security suites ● Key handling, key exchange, roll over, etc is not defined ● Tested Linux against Linux and Contiki 3.0 ● No way to test against RIOT as they have no LLSEC support right now
  • 41. LLSEC Linux-wpan ● Needs the llsec branch in wpan-tools for configuration ● CONFIG_IEEE802154_NL802154_EXPERIMENTAL $ iwpan dev wpan0 set security 1 $ iwpan dev wpan0 key add 2 $KEY 0 $PANID 3 $EXTADDR $ iwpan dev wpan0 seclevel add 0xff 2 0 $ iwpan dev wpan0 device add 0 $PANID $SHORTADDR $EXTADDR 0 0
  • 42. LLSEC Contiki 3.0 ● You need the following Contiki build options configured in your project-conf.h to make use of LLSEC with network wide key: #define NETSTACK_CONF_LLSEC noncoresec_driver #define LLSEC802154_CONF_SECURITY_LEVEL FRAME802154_SECURITY_LEVEL_ENC_MIC_32 #define NONCORESEC_CONF_KEY { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, }