ALICE – Mobile Experiment Engine

Cellular networks are becoming the primary or only Internet point of access for an ever larger fraction of users. Nearly a quarter of current web traffic is mobile and recent industry studies have estimated a fourfold increase on global mobile data traffic by 2018, mainly driven by the content demands and growing number of smart phones and tablets. Measuring cellular networks is difficult since most networks operate prevent external traffic from entering, and thus measuring their networks. Measurements from mobile end-hosts is required, but suffers from severe coverage problems and inconsistency due to the spatial and temporal variations in wireless traffic.

We have developed a powerful, programmable mobile experiment engine called Alice (A Lightweight Interface for Controlled Experiments) for Android devices. Alice is designed with the following goals in mind:

  • Able to be easily incorprated into multiple mobile applications. The short-term usage patterns of mobile applications mean that no single mobile application will be able to satisfy long-term user recruitment needs. Alice is encapsulated as a libary, and can be added to existing applications with only a single line of Java code.
  • Low impact for resource constrained mobile devices. Mobile devices have many restrictions such as power and network resources. Alice is designed to minimize the power consumption of each experiment run by running many probes in parallel. In addition, Alice follows quotas for network resources in order to limit the total amout of mobile data used by an individual device.
  • Shared among multiple research partners. The distribution model of Alice is being packaged with multiple mobile applications. Therefore, all researchers using Alice will benefit by its proliferation. Alice allows for all instances to be shared in a common pool, and share experiments among all participating researchers.
  • Versatile and easy to program. Alice is designed to be powerful, flexible and easy to program. Unlike many other existing experiment engines, Alice experiments are programmed in Javascript, and allow experiments to be reactive to current conditions, as well as to chain experiment probes together.

Technical Descriptions

Below we describe the technical details of the Alice impementation for Android. Alice is a mobile experimentation libary which enables large-scale experimentation from mobile end hosts, with a powerful, programmable experiment interface.

The basic abstraction within Alice the Experiment. Each experiment consists of a unique experiment ID, temporal properties such as when, how often and how many times the experiment should run, and the experiment script itself. Multiple experiments can be (and often are) run on each device at any given point and time.

Engine Capability

Alice currently operates under the Dasu model, with discrete probes being launched from the experiment in both parallel and serial versions. The following probes are implemented in Alice:

  • DNS (active) – Allows DNS lookup functionality similar to dig.
  • HTTP Get (active) – Performs an HTTP Get request for a specified URL.
  • IPerf (active) – Bandwidth testing tool with various control parameters.
  • Device Info (active) – Records device specific information such as the device unique identifier and available radios and sensors.
  • NDT (active) – Network Diagnostic Tool is an existing robust network performance testing suite implemented in Java.
  • Network Info (active) – Records the active and available network interfaces (i.e. WiFI, 3g, 4g).
  • Ping (active) – A ping probe which measures the RTT for a specified IP address.
  • Traceroute (active) – A traceroute probe.
  • Traffic Stats (active) – Records the bytes used by each registered application, similar to running /proc/stat/net.
  • GPS (context) – Records a user’s current location at cell tower granularity.
  • Cellular Signal Strength (context) – Records the measured cellular signal from the device for a specified time inter- val.
  • Wifi Scan (context) – Performs a WiFi access point scan.

Each active probe exists as a serial and parallel probe. When each parallel probe is executed, it is added to that probe’s queue in the Alice runtime, and then immediately returns. Each probe queue is allowed to run a maximum number of parallel tasks; additional probes wait in the queue until a previous probe finishes. Each serial probe blocks during its execution, and returns the probes result as a JSON object. This JSON object can be used by subsequent logic within the same experiment script.

Experiments in Alice are written in Javascript and run within a Android WebView. This allows Alice to isolate each experiment script within the WebView, while adding probe capabilities by binding Java code to the Javascript methods through the WebView.

Sample Scripts

% Comments are prefaced with percent sign %
% Experiment parameters such as ‘id’ are separated with =


% White spaces are ignored

%experiment code written in <script> tags

<script type=”text/javascript”>

function store(key,value) {


function get_a_record_ip(dnsresponse) {


var dnsservers = [“local”, “”, “”];
var hosts = [“”, “”, “”,
“”, “”, “”, “”,

for (var j=0; j < dnsservers.length; j++) {

var ana_string = AndroidMeasurementEngine.getDeviceId() + “”;
var ana_ret = AndroidMeasurementEngine.doJsDns(ana_string, “”);
var ana_resp = JSON.parse(ana_ret);

store(“ana”, ana_resp);

var google_ana_ret = AndroidMeasurementEngine.doJsDns(ana_string, “”);
var google_ana_resp = JSON.parse(google_ana_ret);

store(“ana-google”, google_ana_resp);
var opendns_ana_ret = AndroidMeasurementEngine.doJsDns(ana_string, “”);
var opendns_ana_resp = JSON.parse(opendns_ana_ret);

store(“ana-opendns”, opendns_ana_resp);

var resolver_ip = get_a_record_ip(ana_resp);
var server_ip = ana_resp.server;

if (resolver_ip != null) {

if (server_ip != null) {

var google_ip = get_a_record_ip(google_ana_resp);
if (google_ip != null) {

var opendns_ip = get_a_record_ip(opendns_ana_resp);
if (opendns_ip != null) {




Get Alice

Please contact John Rula for information about obtaining the Alice Android library.