Modern mobile devices are equipped with multiple network interfaces, including 3G/LTE and WiFi. Bandwidth aggregation over LTE and WiFi links offers an attractive opportunity for supporting bandwidth-intensive services, such as high-quality video streaming, on mobile devices.
GreenBag project introduces an energy-efficient bandwidth aggregation middleware that supports real-time data-streaming services over asymmetric wireless links, requiring no modification to the existing Internet infrastructure. The paper was published on the 34th IEEE Real-Time Systems Symposium (RTSS '13).
GreenBag was designed to download via LTE and WiFi but current version does not automatically detect those network interfaces in the system. Therefore, you need to add the interface names to the corresponding lookup lists in lookup_if_names.c. On a desktop with multiple network interfaces, you need to specify one into the LTE list and the other into the WiFi list.
This source code can be built for Android and Linux desktop platforms. The following build commands for desktops were tested with gcc 5.4.0 on Ubuntu 16.04. You can build on Android by using gcc in Android NDK.
-
Standalone mode: In this mode, GreenBag works like a typical downloader, such as wget.
make standalone
-
Proxy mode: In this mode, GreenBag acts as a proxy to between the server and the video player. GreenBag was orignally designed to work on this mode, but it requires some additional setup steps.
make
I tested with an Apache2 server which allows an unlimited maximum number of requests during a persistent connection. Because GreenBag sends a lot of requests over persistent connections, you need to set MaxKeepAliveRequests large enough on the server's configuration file (e.g., /etc/apache2/apache2.conf
)
Although Android will automatically set up routing tables correctly when there are multiple network interfaces in the system, desktop Linux distributions typically do not. You can set up the routing tables on Linux using setup_routing_tables.sh.
Run GreenBag with fixed segment sizes (-F 1
), each segment is 2048 KB large (-S 2048
)
./gb http://143.248.140.50:8088/files/Gangnam.mp4 -F 1 -S 2048
The first argument is the URL to download, and later arguments are options for GreenBag. The performance mode (not energy-saving mode) is used by default.
More options could be found in gbsession.c.
The download time should be faster than when using wget to download over a single link:
wget http://server.com/files/1GB
wget --bind-address=$ip0 http://server.com/files/1GB
wget --bind-address=$ip1 http://server.com/files/1GB
If the speed of GreenBag is not faster than wget, you may check the traffic over network interfaces using nload. The traffic of both network interfaces should be high. If network traffic flows through only one interface, please check the routing table settings.
In case that the network bottleneck is on the middleboxes or the server side, bandwidth aggregation will not be faster than single-link downloading.
You can also throttle bandwidth for testing by using tcconfig. An example script is limit_bandwidth_for_testing.sh.
- Does not automatically determine the optimal segment sizes. Future versions should support flexible segment sizes and be adaptive to the changing network conditions such as bandwidth and RTT.
- Does not automatically detect network interfaces in the system.
- Does not automatically determine whether a network interface is LTE or WiFi.
- Uses disk to store in-progress file parts. Future versions should try to store them in memory.
- Requires large MaxKeepAliveRequests on the server side. Future versions should reduce number of requests sent over each persistent connection.
- Does not determine bitrates of videos automatically.
- Does not setup routing tables on client automatically.
In order to enable LTE and WiFi simultaneously you need to modify the ConnectivityService of Android Framework. On proprietary phones where the source code of the Android Framework is not available, you may need to reverse engineer and modify the ConnectivityService module.
More details are available in How to Enable Multiple Network Interfaces on Android.