AirTube for Android

AirTube - service oriented mesh network solution for Android applications

AirTube is a platform which realizes an "Internet of Services" - simply and flexibly. The number of WiFi enabled appliances, which can be connected to smartphones, are becoming endless. "Connecting services" is getting more important than "connecting devices" for the network of these WiFi enabled appliances and smartphones. AirTube is an Open Source library, which is built to "connect services" on Android devices and other Java platforms.

Technically, AirTube is a networking library for Android providing Service Discovery, Publish/Subscribe Asynchronous Messaging, and Application Layer Mesh Networking functionality. AirTube network requires no server. With its simple and easy to use API, AirTube shortens the development cycle of network applications for mobile devices. For example, applications to share multimedia content, such as camera, microphone, speaker, or sensors among multiple Android devices, can be developed in a very short time frame.

AirTube is free and licensed under the LGPL v3.

If you are designing or developing an Android based network product or system, AirTube is for you!

AirTube network: Peer to peer service connection for local network and also for remote network over the Internet

One of the most commonly used "service discovery" protocols today is Apples "Bonjour" or more technically "DNS-SD over multicast DNS". Another one is Qualcomm's AllJoyn. AirTube, by targeting Android, provides application developers and product designers with an optimal service oriented solution for mobile devices. It has mesh networking capability built in, which realizes the unique features described below.

We have built AirTube from our more than 10 years of experience and effort in the mesh technology field. With the flexibility of the AirTube mesh, you can expand your service over the network in various forms.


  • AirTube source code: GitHub
  • Developer documentation: GitHub


 Technical Overview

What is AirTube

AirTube is a networking library especially designed for service oriented solutions. It can run on any Java platform, but is optimized especially for the Android platform while maintaining the same programming interface for both. On Android, AirTube is implemented as an Android service (not to be confused with a service in AirTube) which can be used by several Activities at the same time thru Androids "Binder" IPC. This is shown below. 

Key Features:

  • Distributed peer-to-peer overlay mesh network independent of IP addresses
  • Distributed service discovery by "name" and JSON description
  • Asynchronous message-oriented networking optimized for multimedia data
  • Efficient and small library (~250KB) for Android and any Java platform

By combining these features into a small and dedicated library, AirTube frees application developers from networking details like topologies, IP addresses and port numbers, and simply lets them discover "services" and receive data from it.

The core of AirTube is the unique implementation of a hybrid application layer mesh routing protocol offering a lot of flexibility in network topologies.  Additionally, the integration of service discovery and asynchronous messaging makes it very easy to discover and connect to "services", be it local, remote or anywhere in the global AirTube mesh "cloud".  More details are described below.


How AirTube works

Service Discovery

AirTube takes a service-oriented view and its service discovery helps applications to find all available instances of services on demand. Every device in an AirTube network can announce one or more services which are identified by an "AirTubeID". The AirTubeID is composed of "Device ID" and an integer value, which is dynamically assigned when the service is registered with AirTube. This is equivalent to the combination of IP address and port in a IP network. Below shows a screenshot of the AirTubeMonitor and, for example, 3/15086... is the AirTubeID for the "test" service.


The SERVICES panel shows the list of available services in this AirTube network.In this example, there are 5 services on remote peers:

  • video: AirTubeID[11/c04a..] provides this service, ToS is VIDEO
  • audio: AirTubeID[3/1508..] provides this service, ToS is VOICE
  • test: AirTubeID[5/5e53..] provides this service, ToS is NORMAL
  • video: AirtubeID[2/5e53..] provides this service, ToS is VIDEO
  • cv/people-count: AirTubeID[1/5e53..] provides this service, ToS is NORMAL


As this example shows, a single Android device can provide multiple services and there can be more than one service providers for the same service name. For example, the "cv/people-count" service provides a "computer vision" service which is counting the number of people by our CV algorithm and sends the result (the number of people detected) to the clients. Each client has its own threshold to start subscribing the video service from this service peer. 

Clients interested in a certain service can search for a "service name" and will be notified of any service which is available with that name. In the screenshot, there exist five services which are represented as "video", "audio", "test",  "video" and "cv/people-count" respectively.  Service can further be described by a service-specific JSON string (e.g:  { "codec": "h264", "width": 640, "height": 480 }) and the service can choose a particular transmission type and its type of service (ToS/QoS). These service descriptions are spread thru the mesh network. Services themselves don't need to manage clients' state, they just publish their data and AirTube takes care of distributing the data. All data transmission and service subscription is done efficiently and asynchronously on a message (packet) basis using the Java NIO framework.

Different from the conventional approach, AirTube service discovery is designed to work especially for services on mobile devices, where services are likely to have a dynamic and adhoc nature. In the AirTube implementation, we strategically focused on the integration of mesh routing and service discovery, to solve this issue.

Next, we describe different network topologies where this flexible service oriented network solution can work.

AirTube Topology

AirTube creates a peer-to-peer network in (1) a single LAN, (2) over local Layer 3 (IP) network and (3) over the Internet without a server device. To realize this, AirTube provides an "overlay" mesh network feature on the application layer ("OSI Layer 7").

One of the core AirTube technologies is "overly mesh network" which connects the AT nodes across routers by exploring the best route to reach each destination AT node. AirTube implements its own hybrid routing protocol on Layer 7, which combines an improved distance-vector (DV) protocol with an on-demand (OD) routing protocol.

The next image shows a simple topology composed of a single LAN network. A blue box indicates "AirTube running on Android" and a light blue box indicates "AirTube running on non-Android platform". All AirTube (AT) nodes are direct neighbours to each other and multihop relaying is not necessary in this simple case.

 Note: Case 3, adhoc mode, refer to our work on 802.11 IBSS mode on Android here

The next image shows a topology example over a routed local L3 network. Case 1: AT nodes are connected either by using "ProxyAT" or by an AT enabled router. "ProxyAT" is an AT node connected to remote ATs over "TCP tunnel": packets are delivered between ProxyAT and its connecting remote AT nodes through the tunnel. In general, a ProxyAT node runs on stable equipment with JVM platform, for instance a PC. An AT enabled router can be built on an embedded PC or open architecture router such as OpenWRT.


The next image shows the AirTube peer-to-peer network over the Internet. "ProxyAT" functionality is also used in this case and it is located at a certain location in the public cloud. Case 1 shows how ProxyAT works to connect two remote AirTube networks. As soon as one AT node in each network has a tunnel to the ProxyAT node, all other AT nodes in the same network are automatically connected to the remote nodes by the mesh technology. How they can reach each other is shown by the red arrows.

AT nodes connected over 3G/LTE network can also join the AirTube peer-to-peer network via a ProxyAT node. Once it gets connected to the ProxyAT node, it is connected to all AT nodes reachable by the ProxyAT node instantaneously.

In case 2, two ProxyAT nodes are connected. This configuration can be useful for administrative flexibility, for providing better throughput, load balancing, and for higher reliability as each ProxyAT can be used as a fallback for the other. 


 Finally, the following AirTube Monitor GUI screeshots show the state of multihop connections.

  • Peer list: This AT node has 6 remote nodes (peers), 4 of them are "neighbours" direclty connected. 88 is reached via 77 (2 hops). 15086 is reached via 77 and 88 (3 hops).
  • Traceroute: Showing that 88 is now reachable via 77.



Services in the AirTube network follow the "publish/subscribe" paradigm. Any participant in the network can announce "services" which are found by "name" (String) and are further described by service-specific JSON. Once a service has been found, clients can subscribe to the service in order to receive the service data (e.g. video stream) or to send data to the service.

To make the data sending and receiving simple and efficient for its users, AirTube provides an asynchronous message-oriented networking abstraction. Services can simply specify the type of data transmission they want (e.g. UDP, TCP or Broadcast) and then simply pass data packets to AirTube, which will transport them over the best path to the destination.


What is the benefit of AirTube

For Android based network product designers

AirTube, with its embedded mesh capability gives freedom for product designers to deal with various network topologies. AirTubes flexibility can integrate any pre-existing or sponateously formed network topology into its "overlay mesh" network, be it local Ad-hoc (IBSS mode) Wi-Fi networks, Access Points, Ethernet, 3G/LTE mobile data connections or public servers. There is no limit for service expansion, by adding needed services, whatever sensor data or video data integration, from anywhere in the world, or locally without any server, you can do as you wish.

In addition to topology freedom, AirTubes architecture, optimized for a mobile environment, will give product designers freedom in "connecting services". Service can be anywhere, service can "come and go" at any time and services don't need to care about clients status. So product designers can design coordination among services flexibly. In contrast to "cloud" services which always require Internet connectivity and big servers somewhere on Internet, AirTube forms its own "cloud" which can exist only locally, while also offering the possiblity to interconnect over the Internet.

For Android based network application developers

By combining flexible service discovery with an overlay peer-to-peer mesh networking protocol and asynchronous message-oriented networking AirTube frees application developers from worrying about underlying networking technologies. Services and clients can simply specify the type of data transmission they want (e.g. UDP, TCP or Broadcast) and then pass data packets to AirTube, which will transport them over the best path to the destination.

Since most of the complicated things are solved inside AirTube, its API is quite simple and easy to use.

A service simply registers a certain ServiceDescription ("name" and the data transmission type) with AirTube and gets assigned its unique AirTubeID. It can then send "ServiceData" and AirTube takes care of where to distribute this data to. A client on the other hand, does not announce, but search for a certain service by "name" and will be notified of any matching service. It can then subscribe to one or more of them and receive its data.


What Thinktube can do

Our expertise is with wireless networks, including mesh protocols, architecture design and implementation in the embedded Linux field. We believe AirTube will bring great benefit to your Android network product development. According to your request, we hope to provide services, including technology transfer, consulting and implementation support, applying AirTube technology.