Skip to the content.

license license license

Table of Contents

Introduction

Codebase Organization

Platform Requirements

Data Release

For Developers

Introduction

This repository contains our continuous monitoring infrastructure (based on a customized Android system dubbed SubCell) for recording fine-grained observability data when users engage with mobile apps using underground cellular networks, as well as our efforts for mitigating Video Stream Stalls (VSSes) in subways on Android devices. We also release a portion of our measurement data (with proper anonymization). Our latest SubCell system is built upon vanilla Android 13/14. Therefore, you’ll be able to run codes in this repo by patching these modifications to proper framework components.

[The entire codebase and sample data are available in our Github repo.]

Codebase Organization

Continous Monitoring Infrastructure

Our modifications to the vanilla Android mainly consist of three parts, as shown in Monitor. First, we add SubwayDetection.java to detect when a device boards a subway. Second, once the device is confirmed to be in a subway environment, SubCell initiates our dedicated data recording service (SubwayDataCollection.java) to log the network states we are concerned with (as listed here). Third, to monitor the frame rate of the foreground app and detect VSSes, we modify the graphics layer compositor of Android by adding a timer task (MonitorFrameRate) in SurfaceFlinger.cpp and updating onPostComposition in Layer.cpp for the statistics of composed layers.

File Key Changes Purpose Location in AOSP
SubwayDetection.java A new class Indentify subway scenarios packages/services/Telephony/src/com/android/phone/SubwayDetection.java
SubwayDataCollection.java A new class Collect cross-layer data packages/services/Telephony/src/com/android/phone/SubwayDataCollection.java
SurfaceFlinger.cpp MonitorFrameRate (added) Count the number of composed graphics layers from the foreground app frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
Layer.cpp onPostComposition (changed) Notify SurfaceFlinger when a graphic layer from the foreground app is composed frameworks/native/services/surfaceflinger/Layer.cpp

System-level Enhancement

We provide our Time-Inhomogeneous State Space Model (TISSM) that leverages a time-varying multi-order state space to finely characterize the underground signal attenuation, enabling Android’s cellular management to find the optimal handover timing. As shown in TISSM_Model, SubCell updates the TISSM-based signal attenuation model when new signal strength measurements are obtained. Leveraging the model, the system then estimates future signal attenuation to determine whether to trigger handover.

App-level Enhancement

We provide our code of the radio/link state collection module in Collection_Module. We encapsulate this functionality into a system-level component named RadioLinkMonitor, which runs within the telephony framework and continuously collects fine-grained radio and link metrics. We expose this module via a binder-based callback interface by extending TelephonyManager to expose a new API registerRadioLinkMetricsCallback. Apps can subscribe to per-second updates by implementing the callback interface and invoking this API.

Platform Requirements

For Android-related modifications, currently our code is run and tested in Android 13 and Android 14 (AOSP). Note that despite quite a number of changes have been made in Android 14 since Android 13, our code is applicable to both given that concerned tracing points remain unchanged.

Data Release

We release a portion of data here, which provides continuous measurements covering entire subway rides. This dataset includes measurements collected from three subway lines in Beijing, spanning 26.5 hours of subway travel and capturing 676 VSS events.
Each record contains the following information:

Information Description
ts Recording time
rtt Round-trip time (ms)
pkgLossRat Packet loss rate
dlThroughput Downlink throughput (MBps)
ulThroughput Uplink throughput (MBps)
dnsLatency DNS query latency (ms)
dnsSuccessRate DNS query success rate
rsrp Reference Signal Received Power
rsrq Reference Signal Receiving Quality
snr Signal-to-Noise Ratio
mimoLayer The MIMO layer
mcs Modulation and Coding Scheme
rat Radio Access Technology, 14 for 4G and 20 for 5G
cid Cell Identity
label The VSS label (1 for VSS and 0 for non-VSS).

In addition, we provide a complementary dataset which contains data segments around VSS occurrences for reference, including critical network, cellular, and device information:

Information Description
UID Unique ID generated to identify a user (cannot be related to the user’s true identity)
TIME UNIX timestamp when recording for this segment starts
OS Android version
MODEL Device model
APN Current access point name
APP The foreground app
DATA Detailed data recorded every second within a short window around each VSS event, with each second’s data arranged in the following order: round-trip time (RTT), packet loss rate, DNS query success rate, DNS query latency, uplink bandwidth, downlink bandwidth, Radio Access Technology (RAT, 14 stands for 4G and 20 stands for 5G), Reference Signal Received Power (RSRP), Signal-to-Noise Ratio (SNR), Cell Identity (CID), Modulation and Coding Scheme (MCS, 4 for QPSK, 16 for 16 QAM, and 64 for 64 QAM), MIMO layers, and the VSS label (1 for VSS and 0 for non-VSS).

For Developers

Our code is licensed under Apache 2.0 in accordance with AOSP’s license. Please adhere to the corresponding open source policy when applying modifications and commercial uses.