This repository contains code for the 2013 Maniac Challenge (API and Strategies) held at the Free University of Berlin.
The MANIAC Challenge is a competition to better understand cooperation and interoperability in ad-hoc networks. Competing teams students/researchers come together to form a wireless ad-hoc network, while simultaneously connected to a backbone of access points. The organizers generate traffic coming from the backbone, destined to somewhere in the network. A hop-by-hop bidding contest decides the path of each data packet towards its destination.
The specific focus of the MANIAC Challenge 2013 is on developing and comparatively evaluating strategies to offload infrastructure access points via customer ad hoc forwarding using handhelds (e.g., smartphones, tablets). The incentive for customers is discounted monthly fees, and the incentive for operators is decreased infrastructure costs. The idea is to demonstrate scenarios/strategies that do not degrade user experience while offering significant mobile offloading on the infrastructure.
- For the
Backbones
, we used between 8 and 23 nodes of the DES-testbed. All Backbone routers were connected to one central server, theMaster
. Tha Master tols the Backbones to announce traffic and logged every packet the Backbones picked up. - As
Clients
, we used Google's Nexus 7 tablets running Android 4.2.1.
We used Google's ProtocolBuffer to serialize the data that is sent between Backbones and Clients.
The actual routing was done by OLSRd, the daemon for the Optimized Link State Routing Protocol.
The API for the tablets was entirely written in Java (since there's Android running on them).
The Eclipse project contains a file called protoPackets.proto
in its /src
folder which specifies our protobuf message format, as well as the .java files compiled from it.
To get the ad-hoc mode running on the Nexus 7, you first have to install CyanogenMod, then build your own Kernel and finally install the ManetManager, written by the SPAN-Team, but you have to root your device to use it. And finally, you have to write an App which uses the API. We provided a very simple dummy app, so can get an idea of how it can look like/work.
The task of all backbones is to start auctions and report all traffic they notice to the master. To accomplish this, they maintain >= 3 connections:
- a TCP Connection to the master
- a UDP Socket listening for traffic and forwarding everything to the Master for logging
- a TCP ServerSocket listening for Connections by Clients
- a TCP Socket for every Client connected to the Backbone. The Backbone will periodically send Check packets containing Banking info (i.e. their new balance and the amount they gained/list in the last 5 seconds, and the TransactionID of the transaction in which they lost it) to the Client, while the Client will send copies of the BidWins they're boradcasting to to their Backbone to make sure this is logged by the Master.
The code that ran on the backbones was written in Python 2.7, and we used Twisted, an "event driven networking engine" which does a lot of magic for you.
In the backbone
folder, you'll also find a file called protoPackets_pb2.py
, which is the python code complied from the .proto file mentioned in Clients. Do not touch this, as this is machine generated code. If you want to learn how to write and compile your own protobuf messages, read the protobuf installation manual.
A quick note about the routers from some people who learned it the hard way: Check the version of your Wifi driver. You do not want to mess with a 4 year old implementation of Ad Hoc mode.
The Code for the Master-Server was written in Go
We built a LiveLog so can see live what the state of the handhelds is. This was written in every language you can imagine when it comes to creating a webpage.
We hope this will help you to get started. For more detailed information about Message formats etc please consult the Wiki. If you have any questions, do not hesitate to contact us. Happy Hacking!