IRC

#linux-wpan on irc.freenode.net

wpan-tools

To access the nl802154 netlink inteface and also for checking the network connectivity you will need the wpan-tools.

Dependencies:

These tools contains:

iwpan

based on the wireless iw tool.

wpan-ping

Ping utility on IEEE 802.15.4 level.

Download

For the last release check out releases page:

Supported Hardware

Table 1. Supported 802.15.4 Hardware
Transceiver Supported Driver Bus Where to buy

adf7242

yes

adf7242

SPI or PMOD

Analog

at86rf212

yes

at86rf230

SPI

aliexpress

at86rf212b

yes

at86rf230

SPI

digikey

at86rf230

no

at86rf230?

SPI

at86rf231

yes

at86rf230

SPI

atben Out of stock. Mailto linux-wpan and Werner to produce maybe new ones. Or contact qi-hardware.

at86rf233

yes

at86rf230

SPI

openlabs, digikey

atusb

yes

atusb

USB

atusb Out of stock. Mailto linux-wpan and Werner to produce maybe new ones. Or contact qi-hardware.

cc2420

no

SPI

aliexpress

cc2520

yes

cc2520

SPI

aliexpress

cc2531

no

USB

aliexpress

mrf24j40

yes

mrf24j40

SPI

aliexpress

RZUSBstick

experimental, WIP

atusb

USB

element14

Xbee

no

out of tree

??

sparkfun

Table 2. Boards with Transceivers
Name Transceiver Website

Ci40

ca8210

kickstarter

blixten

cc2520

jopee

How-To’s

This section describes various How-To’s. Per default you should have already a node type wpan interface.

6LoWPAN

Set some valid pan_id, 802.15.4 default is 0xffff which means not assigned:

iwpan dev wpan0 set pan_id 0xbeef

Currently you need to setup the 6LoWPAN interface manually:

ip link add link wpan0 name lowpan0 type lowpan

That’s it! Now you have some lowpan0 interface with a 6LoWPAN 1280 MTU which runs on top the wpan interface. As default you have a default link-local address based on the MAC (extended address).

Setup a 6LoWPAN test network

Let’s assume you want to setup a 6lowpan test network of six nodes. Each of them will be created in their own net namespace to avoid local IPv6 optimizations. Each netns is named according to the wpan interface which available in the net namespace.

#!/bin/sh

# we need some Private Area Network ID
panid="0xbeef"
# number of nodes
numnodes=6

# include the kernel module for a fake node, tell it to create six
# nodes
modprobe fakelb numlbs=$numnodes

# initialize all the nodes
for i in $(seq 0 `expr $numnodes - 1`);
do
        ip netns delete wpan${i}
        ip netns add wpan${i}
        PHYNUM=`iwpan dev | grep -B 1 wpan${i} | sed -ne '1 s/phy#\([0-9]\)/\1/p'`
        iwpan phy${PHYNUM} set netns name wpan${i}

        ip netns exec wpan${i} iwpan dev wpan${i} set pan_id $panid
        ip netns exec wpan${i} ip link add link wpan${i} name lowpan${i} type lowpan
        ip netns exec wpan${i} ip link set wpan${i} up
        ip netns exec wpan${i} ip link set lowpan${i} up
done

Now let us send some data over our network:

ip netns exec wpan0 wireshark -kSl -i lowpan0 &
# ping all nodes
ip netns exec wpan0 ping6 ff02::1%lowpan0

Now watch wireshark and all the nice ICMP packets there.

Sniffing

To sniff first remove all wpan interface which sits on top of the wpan phy. You will get a list of all current running phy interface with:

iwpan dev

then delete all interfaces with:

iwpan dev $IFNAME del

Finally create a monitor interface:

iwpan phy phy0 interface add monitor%d type monitor

Then bring this interface up and run wireshark, tcpdump, etc… on it. Running a wireshark as sniffing frontend on the $HOST and connect to a $TARGET like Raspberry Pi which have some ethernet ssh connection, you can try:

ssh root@$TARGET 'tshark -i monitor0 -w -' | wireshark -k -i -

This will pipe all sniffing frames from $TARGET side to $HOST running wireshark application. Note you need maybe to change the "$TARGET" and "montior0" to your settings.

Developing

Current developing repository is bluetooth-next. All patches should be send to <linux-wpan@vger.kernel.org> and based on bluetooth-next.

For wpan-tools checkout the wpan-tools repository. Also send patches to <linux-wpan@vger.kernel.org> for it with a "wpan-tools" tag. The same for wpan-misc.

Open Tasks

  • There is a lot of missing features for enum definition to some string definition in iwpan which can be lookup in 802.15.4 standard. Words say more than numbers…

    • channel/page to frequency

    • cca modes/opts

    • etc

  • Missing features which wireless has and wpan not. Since we based our implementation on wireless we should sync "good patches" from wireless branch.

    • Whatever you want and find

  • rework

    • missing features in nl802154, crypto etc.

    • new frame parsing style in mac802154 and ieee802154 based on mac80211 frame parsing design. Draft is mac802154 rx. Crypto need to be done at first, otherwise I can’t test it.

    • remove cb context from dev_hard_header and introduce generic header generation functions like header_ops. Here too, crypto need to be done at first.

  • systemd

    • add basic functionality for nl802154 and 6lowpan setup in systemd-networkd

  • network-manager

  • devicetree extended addr setting, draft is here ieee802154: add usual way to get extended address via device tree

  • RPL? - not our job, need to go through ipv6 netdev community, but we should do something to have a "started" mainline solution.

  • cleanup/fix 802.15.4 af raw/dgram socket code. We should use bluetooth socket code as example.

  • In wireless exists a "station dump", we need something similar "node dump" with all neighbour nodes and their last LQI value, addresses, etc. information.

Rework

Currently a rework of 802.15.4 subsystem is in progress.

The rework will contains a new netlink API and a general handling about frame creation and parsing.

Table 3. Work status
Milestone Description state

1. nl802154

new netlink framework

mostly done

2. crypto-layer

accessable over nl802154 and tools

TODO

3. frame parsing

remove bugs, more generical

TODO

NOTE we need to finish rework state 2. before we can start 3 or anything else which touch the frame parsing/generation.

For the nl802154 framework you will need the wpan-tools, older kernels need lowpan-tools but this is not recommended.

Changing the Website

If you want to take part in developing this website, do the following:

git clone https://github.com/linux-wpan/wpan-misc.git
cd wpan-misc/website
git checkout -b myproposal
# Change this page to whatever you like.
$EDITOR index.txt
git commit -s -a
# be sure to be registered to linux-wpan@vger.kernel.org before sending the
# patch
git send-email --to linux-wpan@vger.kernel.org -1

Next wait for the reactions on the mailinglist and if your change is integrated.