On Friday, January 25, 2013 18:12:38 Martin Hundebøll wrote:
Network coding exploits the 802.11 shared medium to allow multiple packets to be sent in a single transmission. In brief, a relay can XOR two packets, and send the coded packet to two destinations. The receivers can decode one of the original packets by XOR'ing the coded packet with the other original packet. This will lead to increased throughput in topologies where two packets cross one relay.
In a simple topology with three nodes, it takes four transmissions without network coding to get one packet from Node A to Node B and one from Node B to Node A:
- Node A ---- p1 ---> Node R Node B
- Node A Node R <--- p2 ---- Node B
- Node A <--- p2 ---- Node R Node B
- Node A Node R ---- p1 ---> Node B
With network coding, the relay only needs one transmission, which saves us one slot of valuable airtime:
- Node A ---- p1 ---> Node R Node B
- Node A Node R <--- p2 ---- Node B
- Node A <- p1 x p2 - Node R - p1 x p2 -> Node B
The same principle holds for a topology including five nodes. Here the packets from Node A and Node B are overheard by Node C and Node D, respectively. This allows Node R to send a network coded packet to save one transmission:
Node A Node B
| \ / | | p1 p2 | | \ / | p1 > Node R < p2 | | | / \ | | p1 x p2 p1 x p2 | v / \ v / \
Node C < > Node D
More information is available on the open-mesh.org wiki[1].
This patch adds the initial code to support network coding in batman-adv. It sets up a worker thread to do house keeping and adds a sysfs file to enable/disable network coding. The feature is disabled by default, as it requires a wifi-driver with working promiscuous mode, and also because it adds a small delay at each hop.
[1] http://www.open-mesh.org/projects/batman-adv/wiki/Catwoman
Signed-off-by: Martin Hundebøll martin@hundeboll.net
v3:
- Changed and updated copyright years
Makefile | 2 ++ Makefile.kbuild | 1 + gen-compat-autoconf.sh | 1 + main.c | 6 ++++ main.h | 4 ++- network-coding.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ network-coding.h | 48 ++++++++++++++++++++++++++++++ soft-interface.c | 3 ++ sysfs-class-net-mesh | 8 +++++ sysfs.c | 6 ++++ types.h | 14 +++++++++ 11 files changed, 173 insertions(+), 1 deletion(-)
Applied in revision 2f92809.
Thanks, Marek