6LoWHAM TAP device agent
The purpose of this application is to open a TAP device on the Linux host
and pipe the Ethernet traffic between there and
It is intended to be run as a child process which then passes the Ethernet frames to it. It uses a simple byte-stuffed protocol to encapsulate the Ethernet frames and maintain synchronisation with the parent process.
libnlversion 3.x (tested against 3.4.0)
- Linux kernel headers in
Right now only Linux is supported.
There's scope there for supporting other OSes. In theory we could support
MacOS X and BSD by implementing the
tun.h interface for that OS.
Windows may be a bit tricky because they don't use a "file descriptor" type model like Unix does. I'm no Windows expert and consider it a legacy OS. If you can get it working, and have a patch to share, I'll include it on the proviso that it doesn't break existing supported platforms.
Command line arguments
-a: Sets the MAC address to the provided colon-separated address.
-m: Sets the MTU on the interface
-n: Sets the interface name
- All frames start with a
0x02) and end with an
STXbyte within the frame is replaced with the sequence
ETXbyte within the frame is replaced with the sequence
DLEbyte within the frame is replaced with the sequence
- The first byte of every frame gives the type of frame being sent.
Device Detail (
The device detail is sent by the agent to the parent, and is the very first frame sent. It carries the following fields:
- 6 bytes: MAC address
- 2 bytes: MTU (big endian)
- 4 bytes: interface index (big endian)
- 1 byte: length of name field
- remainder: name field
This frame MUST be
ACKed by the parent on receipt.
Exit agent (
This causes the agent to immediately shut down. No
ACK is returned.
Keep-alive ping (
This may be used to see if the parent or child is "stuck". Response should
be an immediate
Ethernet frame data (
The payload is a raw Ethernet frame as it would be sent over the network.
If sent from the parent to the child, this tells the child to transmit that
frame. It should
ACK on success, or
NAK if the send fails.
If sent by the child to the parent, this is an Ethernet frame that was
received. It must be
NAKed by the parent.
0x06) and Rejection (
These indicate successful processing of a frame, or rejection of a frame due to an error in handling.