Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / PhantomNet / OEPC-Protected / Facebook status update in PhantomNet

Facebook status update in PhantomNet

Overview


This tutorial will walk you through the steps to build and install test Android applications that control a Facebook application to do certain tasks programmably.

In particular, Alice uploads a photo to Facebook every 3 minutes for 10 times and Bob (a friend of Alice on Facebook) continuously updates for the photos. We measure the time to complete a post and the time for a photo to be fetched from Facebook servers.

This tutorial will be done in the PhantomNet (https://www.phantomnet.org) testbed using two Nexus 7 tablets attached to an Ip.access E-40 small cell and a OPEN EPC core network instant.

This functionality might be useful for users who want to understand how real applications function under various network conditions, or how mobile network protocol changes impact a smartphone application.  

 

Git repository 


The tutorial is packaged in a Git repository. Clone the repository:

git clone git@gitlab.flux.utah.edu:binh/android-sdk-facebook.git && cd android-sdk-facebook

The cloned folder consists of 3 sub-folders:

  • apk: includes Facebook apks and scripts to re-sign the apk.
  • scripts: includes the scripts for the tutorial.
  • test-blackbox: includes Java source code of the test applications. 

 

Experiment topology 


Figure 1 shows the topology of the experiment in PhantomNet. The topology is described here in the ns file.

In the radio side of the network, two Nexus 7 tablets running Android 4.4.2 are attached to a Ip.Access (E-40) LTE small cell base station via LTE.

In the core side of the network, an OpenEPC instance consists of EPC components needed for a LTE/ECP network (i.e, SGW, MME, PGW, HSS). PGW is the gateway connecting the core network to the Internet (and Facebook servers). 

Note: the ns file only consists of a EPC core network and the Ip.access eNB. The 2 Nexus 7 tablets are not declared in the ns file as they are automatically attached to the eNB if they are in the physical coverage range of the eNB. Currently PhantomNet has not released supports for experiments with real devices and Ip.access eNBs which will be enabled in a near future.

Figure 1. Tutorial topology

 

Resign and install Facebook application 


We need zipalign to sign the Facebook application:

sudo apt-get install zipalign

In this tutorial we use Facebook 25.0.0.19.30. The original apk could be found in apk/Facebook- 25.0.0.19.30.apk 

Since we need to control the Facebook apk without knowing the source code of it, we need to re-sign the apk using a debugger key. While you can use any key to re-sign the apk, we will use Android's default debugger key that comes with the standard SDK to sign the apk: 

bash apk/signapk.sh apk/Facebook-25.0.0.19.30.apk apk/debug.keystore android androiddebugkey

After this step, a re-signed apk will be created in the apk folder named apk/signed_Facebook- 25.0.0.19.30.apk. We’ll use this apk throughout this tutorial. 

Before installing this apk to the Nexus devices, we need to obtain the device IDs: 

$> adb devices
List of devices attached 
0fabdc5e device
1fab7f8a device

Install the apk to the devices using the device IDs above: 

adb -s 0fabdc5e install apk/signed_Facebook-25.0.0.19.30.apk
adb -s 1fab7f8a install apk/signed_Facebook-25.0.0.19.30.apk

 

The test applications 


We need two test applications for Alice and Bob that launch and control Facebook apk to do predefined tasks: Alice uploads a photo to Facebook and Bob continuously fetches the photo. 

The two applications are Android test applications and their apk could be found in apk/alice.apk and apk/bob.apk.

Note: If you would like to see how the apks were implemented, please refer to test-blackbox folder. In short, Alice opens the Facebook apk, touches on update status button and post a photo every 3 minutes for 10 times; Bob opens Facebook apk, scrolls down the main feed screen to fetch new updates from Alice.

During execution, Alice measures the time to post a photo (i.e, the elapsed time between touching the post button and the moment the progress bar disappears); Bob records the moment that photo appears on Bob’s main feed. The fetching time is the elapsed time between the moment the photo was posted by Alice and the moment it appears on Bob’s screen. 

 

Install and run the test applications 


Finally, we need to install the test apks (i.e, alice.apk and bob.apk) to the 2 Nexus tablets and run them. There is a script to wakeup and unlock the devices, install and launch those Alice and Bob apks:

bash scripts/alice-bob.sh

 

Gathering results 


After running the test applications, two log files are created inside the scripts folder: scripts/alice.logcat and scripts/bob.logcat. alice.logcat records the moment Alice clicks on the post status button and the moment the photo is posted. bob.logcat records the moment the photo appears on Bob’s screen. 

Note: each photo comes with a unique hash text that is used to distinguish them.

To get the elapsed times, run:

bash scripts/process_delta_time.sh

The output of this script is status|post time|fetch time, where post time is the elapsed time to post a photo on Alice in millisecond and fetch time is the time for Bob to fetch the photo in millisecond. 

 

Conclusions


This tutorial showed you the steps to run test applications to control Facebook apk and observe the interactions between Facebook and a LTE/EPC network. Similarly, you can build your own test applications to control other apk such as Youtube, Twitter to understand how the apps interact with the LTE/EPC network or how the LTE/EPC network performance could affect the apps.