Linux-wpan: IEEE and 6LoWPAN in Linux

Similar documents
Introduction to Linux-wpan and Potential Collaboration. Stefan Schmidt Samsung Open Source Group

Linux-based 6LoWPAN border router

IPv6 Stack. 6LoWPAN makes this possible. IPv6 over Low-Power wireless Area Networks (IEEE )

IoT Roadmap in the IETF. Ines Robles

Lesson 4 RPL and 6LoWPAN Protocols. Chapter-4 L04: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Mobile Communications

Outline. Introduction. The Internet Architecture and Protocols Link Layer Technologies Introduction to 6LoWPAN The 6LoWPAN Format Bootstrapping

Outlook on IEEE ZigBee Implications IP Requirements IPv6 over Low Power WPAN (IEEE ) Conclusions. KRnet /21

NGS IoT Bone (rev. MRF-1)

Networked Embedded Systems: 6LoWPAN

Networked Embedded Systems: 6LoWPAN

IoT related MAC layers, header compression and routing protocols

6LoWPAN (IPv6 based Low Power WPAN)

Evaluation of 6LoWPAN Implementations

Integration of Wireless Sensor Network Services into other Home and Industrial networks

Proposed Node and Network Models for M2M Internet

L o g o. IPv6 in IoT. Network Information Center Institute of Network Technology BUPT. Website: niclab.bupt.edu.cn

UG103.11: Thread Fundamentals

Loosely Coupled Actor Systems

Compression of IPsec AH and ESP Headers for Constrained Environments dra%-raza-6lo-ipsec-04

ZigBee IP update IETF 87 Berlin. Robert Cragie

RF and network basics. Antonio Liñán Colina

Implementation of SNMP Protocol with ContikiOS [Kur10] for WSN430 targets

Lithe: Lightweight Secure CoAP for the Internet of Things

Lithe: Lightweight Secure CoAP for the Internet of Things

CIP over 6LoWPAN. Technical Track. Prepared by Dayin Xu, Paul Brooks, Yi Yu, David Brandt Presented by Paul Brooks.

By Nick Giannaris. ZigBee

CASAN: A New Communication Architecture for Sensors Based on CoAP

Analysis and Integration of IEEE Networks on Linux

CHAPTER 3. 6LoWPAN 3.1 INTRODUCTION

Internet of Things: Latest Technology Development and Applications

Getting Started with IPv6 in Low-Power Wireless Personal Area Networks (6LoWPAN)

Packetization Layer Path Maximum Transmission Unit Discovery (PLPMTU) For IPsec Tunnels

Introduction to IPv6. IPv6 addresses

TinyOS meets IP -- finally

Design Considerations for Low Power Internet Protocols. Hudson Ayers Paul Crews, Hubert Teo, Conor McAvity, Amit Levy, Philip Levis

Introduction to IEEE and IPv6 over (6LowPAN)

Introduction! Overview! Signal-driven I/O for Sockets! Two different UDP servers!

Communication and Networking in the IoT

Design Considerations for Low Power Internet Protocols

Module 1: Wireless Sensor Networks

IoT on Fedora Using Fedora as a base for the IoT Revolution

TTCN-3 in the Internet of Things(IoT), Testing in lossy environments

Zigbee protocol stack overview

NanoStack Manual. NanoStack Manual. v Sensinode Ltd. 1/16

Implementation and Evaluation of the Enhanced Header Compression (IPHC) for 6LoWPAN

WPAN/WBANs: ZigBee. Dmitri A. Moltchanov kurssit/elt-53306/

System Architecture Challenges in the Home M2M Network

Lesson 3. IPv4 and IPv6 Protocols. Chapter-4 L03: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

mbed OS Update Sam Grove Technical Lead, mbed OS June 2017 ARM 2017

CMPE 257: Wireless and Mobile Networking

ICS 351: Networking Protocols

Wireless Embedded InterNetworking Foundations of Ubiquitous Sensor Networks 6LoWPAN David E. Culler University of California, Berkeley June 2008

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Ref: A. Leon Garcia and I. Widjaja, Communication Networks, 2 nd Ed. McGraw Hill, 2006 Latest update of this lecture was on

Computer Networks Security: intro. CS Computer Systems Security

An Industry view of IPv6 Advantages

Internet of Things 2017/2018

Module 1: Wireless Sensor Networks

Network Layer/IP Protocols

Design and Implementation of a Multi-hop Zigbee Network

Lesson 5 TCP/IP suite, TCP and UDP Protocols. Chapter-4 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

How to develop and validate a scalable mesh routing solution for IEEE sensor networks Altran Benelux

Lecture 8. Network Layer (cont d) Network Layer 1-1

Transmission of IPv6 Packets over Near Field Communication

CSCI-1680 Network Layer:

Introduction to Computer Networks. CS 166: Introduction to Computer Systems Security

Reliable Wireless Sensor Networks in Smart Homes Master of Science Thesis in Programme Computer Systems and Networks.

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

Introduction to IPv6. IPv6 addresses

A smart Home Security system based on ARM9

User Datagram Protocol

WIRELESS TECHNOLOGIES FOR THE INTERNET OF THINGS

TCP/IP Protocol Suite

Smart Waste Management using Internet of Things Architecture

Internet based IoT connectivity Technologies

IPSO 6LoWPAN IoT Software for Yocto Project* for Intel Atom Processor E3800 Product Family

IPv6 over MS/TP Networks

TSIN02 - Internetworking

CMPE 257: Wireless and Mobile Networking

IPv6 Protocols and Networks Hadassah College Spring 2018 Wireless Dr. Martin Land

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

Interoperability. Luca Mottola slides partly by Simon Duquennoy. Politecnico di Milano, Italy and Swedish Institute of Computer Science

Communication Systems DHCP

Requirements for new work on fragments in 6lo (mesh) networks

ETSI Plugtests Guide V1.0.0 ( ) 6LoWPAN Plugtests; Berlin, Germany; July 2013

Politecnico di Milano Advanced Network Technologies Laboratory. 6LowPAN

Internetworking/Internetteknik, Examination 2G1305 Date: August 18 th 2004 at 9:00 13:00 SOLUTIONS

Jonas Green, Björn Otterdahl HMS Industrial Networks AB. February 22, 2017

Transmission of IPv6 Packets over Near Field Communication

Wireless Connectivity Options for IoT. By: MIST Makers John Varela and Nicholas Landy

The IoT and Thread in PHYTEC Nodes. Jonas Remmert July 15th, 2016

Protocol Layers & Wireshark TDTS11:COMPUTER NETWORKS AND INTERNET PROTOCOLS

cs144 Midterm Review Fall 2010

Business Data Networks and Security 10th Edition by Panko Test Bank

CS-435 spring semester Network Technology & Programming Laboratory. Stefanos Papadakis & Manolis Spanakis

Low-Rate Wireless Personal Area Networks IEEE Fernando Solano Warsaw University of Technology

Freescale Helps Ease Interoperability Challenges for the Internet of Things

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Implementation of 6LoWPAN Border Router (6BR) in Internet of Things

Transcription:

Linux-wpan: IEEE 802.15.4 and 6LoWPAN in Linux Linaro Connect BUD17 2017-03-06, Budapest Stefan Schmidt stefan@osg.samsung.com Samsung Open Source Group

Agenda Motivation Linux-wpan Project Hardware Configuration Communication Edge Node OS

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 A series of IETF specifications, started in 2007 IPv6 over LoWPAN (IEEE 802.15.4) Direct IP addressing of nodes Adaptation layer between data-link and network layer Address autoconfiguration Frame encapsulation and fragmentation Header compressions

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) L5 Application Layer L4 Transport Layer L3 Network Layer L2 Data Link Layer L1 Physical Layer Application TCP UDP ICMP IP Ethernet MAC Ethernet PHY Application UDP ICMPv6 IPv6 6LoWPAN IEEE 802.15.4 MAC IEEE 802.15.4 PHY

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 (~96 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 :-)

Hardware

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 96 board with on-board transceiver? Werner Almesberger, CC-BY-SA 3.0 Permission granted by Imagination Technologies

Hardware Requirements Very easy to add to your current dev board or product Free SPI port plus some additional free GPIO pins (number varies by transceiver) Off the shelf modules or directly added 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 Driver for MCR20A in the works 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 e.g. 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 with 0.7, Ubuntu and OpenEmbedded older versions)

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

AF_INET6 Socket Can be used like a normal IPv6 socket Transparently handled in adaptation sd = socket(pf_inet6, SOCK_DGRAM, 0); dst.sin6_family = AF_INET6; sendto(sd,...);

AF_IEEE802154 Socket Direct IEEE 802.15.4 communication Short and extended addressing schemes as well as network PAN ID handling sd = socket(pf_ieee802154, SOCK_DGRAM, 0); dst.family = AF_IEEE802154; dst.addr.pan_id = 0x0023; dst.addr.addr_type = IEEE802154_ADDR_LONG; memcpy(&dst.addr.hwaddr, long_addr, IEEE802154_ADDR_LEN); or dst.addr.addr_type = IEEE802154_ADDR_SHORT; dst.addr.short_addr = 0x0002; sendto(sd,...);

Edge Node OS

Edge Node OS Linux most likely to serve as border router of such networks Different operating system running on the smaller edge nodes of a network Picked the ones with IEEE 802.15.4 and 6LoWPAN support

Operating Systems Contiki: very fragmented project, many academic or commercial forks RIOT: community driven project, testing against Linux-wpan is part of the release testing process Zephyr: new network stack not tested yet, something for this week :-) mbed OS: Nanostack network stack is closed source, no incentive to test on my side OpenThread: open source Thread implementation

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

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/