- ask for motes available At least two motes to attach to the usb ports and two virtual machines are needed (or one with two modules)
- ask for what code is already available in the testbed
- hierarchical routing over lowipv6
- neighbour discovery over low6pan
- Blip tutorial
- protocol 802.15.4 from IEEE
- tep 119 on collections in tinyos
- tinyos documentation for telosb
- mailing list of blip users
- how to write udev rules
- Using libpcap to filter and sniff network traffic, see (scapy for a python higher level interface)
- Computing the checksum of a packet
- libnl, used for manipulating core network link functions
- pcap, capture and manage packets
- example on raw sockets!!
One way is to create a rule with udev, like here:
I have this in my /etc/udev/rules.d/10-udev-rules
# N.B.: Using := prevents later rules modifying parameters,
# 50-dev-rules will reset device permissions to 600.
KERNEL=="tun", NAME="net/%k",MODE:="666"
Another way is to use openvpn to generate it
openvpn --mktun --dev tunX
- try to use TUN/TAP drivers
- see how to send packets over the network, see 6lowpan for examples
- check the routing protocols already present in tinyos evaluating what’s best to do
- try out the IPBaseStation and see how it’s implemented
read on the TUN device can read only one packet at a time, and is also blocking. It’s only needed to allocate a buffer with the maximum length of the IPv6 header.
Using a tap device we would have directly the ethernet packet, while using the tun device we’re one layer upper. One possible advantage in using directly ethernet is that the packets can be much smaller and then we could have less problems in splitting them.
Proto | Header | Payload Max |
---|---|---|
IPv6 | 65k | |
ethernet |
- ipv6 autoconfig, ipv6 can setup automatically unicast addresses
Routing must be done bidirectionally, in tinyos is already present CTP, one idea is to use it twice in both directions.
- Using TUN to send messsages to the application instead of the
- change the routing table
- enable the low-power mode for the mote in cc2420
# On one mote we have to program the IPBaseStation
# After having compiled the necessary
cd $TOSROOT/apps/IPBaseStation
make telosb blip install /dev/ttyUSB0 # for example
# then we need to start the ip-driver
sudo driver/ip-driver /dev/ttyUSB0 telosb
# on the other mote we program the UDP server
cd $TOSROOT/apps/UDPEcho
make telosb blip install.ID
# where the ID will be the address of the client
# to check that everything is working just
ping6 fec0::<ID>
# and as soon as there is communication it should work fine
We can use those interfaces in user-land mode also.
Userland application can write IP frame to /dev/tunX and kernel will receive this frame from tunX interface. In the same time every frame that kernel writes to tunX interface can be read by userland application from /dev/tunX device.
Main purpose of TUN/TAP driver is tunneling. Here is the tun tap driver for OSX for example.
The TUN is Virtual Point-to-Point network device. TUN driver was designed as low level kernel support for IP tunneling. It provides to userland application two interfaces:
- /dev/tunX - character device;
- tunX - virtual Point-to-Point interface.
The TAP is a Virtual Ethernet network device. TAP driver was designed as low level kernel support for Ethernet tunneling. It provides to userland application two interfaces:
- /dev/tapX - character device;
- tapX - virtual Ethernet interface.
In the Linux/Unix/Solaris world, the TUN/TAP driver presents a single character device in the /dev directory (either /dev/tun or /dev/tap). Opening this creates a NEW device (/dev/tun0, tun1, etc) using the next available name, and returns a filehandle to it. An associated pseudo-network device is created at the time of the open.
In the OSX TUN/TAP driver, a preset number of tun and tap char devices (/dev/tun0 - /dev/tun15 and /dev/tap0 - /dev/tap15) are PRECREATED when the driver is installed. You must open the specific char device you want in order to get a filehandle to it. An associated pseudo-network device is created at the time of the open.