WPANTAP - A TAP Interface for WPAN
Our goal: to bridge simulated WPAN devices together.
- Implement file system read
- Implement file system write
- Implement file system polling
- Replace device lookup loop with a specific device pointer
- Optimize FCS
- Tested on Ubuntu 18.04 (Kernel: Linux 4.15.0-99-generic)
- Need to install wpan-tools for tests to work.
The kernel module source is under
cd kmodule # cleans the build files sudo make clean # uninstall the symlink in kernel module folder sudo make uninstall # build the module sudo make build # install the module (create symlink) sudo make install
sudo make install, to update the kernel module, we only need to call
sudo make build.
- To show more debug message, set the kernel log level with
dmesg -n 8
dmesg -wto monitor logs at real time.
- Build test programs in
- The kernel module creates one WPAN interface called
wpan0. To set up the interface, call
sudo ip link set wpan0 up.
- In the testing folder, run
af_packet_txto send some packets to WPAN interface
test_readto read packets from file system node. You can use
sudo ./test_read | xxdto see the hex output.
test_writeto write packets to the file system node. Use wireshark to monitor if the packet can be captured.
test_selectto test the
selectsystem call. One can run
af_packet_txto send some message via the WPAN interface.
ping Test between two VMs
Now we are able to run ping test between two VMs.
- On both VMs, compile, install and run
- On both VMs, run
./test/lowpan_setup.shto configure lowpan network. (If you encounter an error, run this script multiple times.)
- Configure the IP address for VPN programs using JSON file (according to README in VPN folder).
- Run wireshark with
ip netns exec wpan0 wireshark -kSl -i lowpan0 &
- On both VMs, run VPN program with
- Run ping utility with
ip netns exec wpan0 ping6 ff02::1%lowpan0