Home

Awesome

Modified Wehe Command Line Client for MobileAtlas

This repository contains a modified version of the Wehe command-line client used to detect economic differentiation in mobile networks via traffic replaying using the MobileAtlas measurement platform.

A brief overview of both the Wehe and MobileAtlas projects can be found in the repository of the modified Wehe server.

Changes to the Client

Removal of Analysis Retrieval Logic

Since we are interested in economic differentiation and not in the throttling of network traffic, we do not use the analysis server provided by Wehe and thus removed the logic responsible for requesting/retrieving results from it.

Removing Randomised Test Runs

Wehe compares measured throughput information between two replays: One where recorded traffic is replayed unaltered and one where payloads are randomised. However, for our work on economic differentiation, we do not need these randomised replays since we only need to retrieve billing information from the MNO.

Support for multiple TCP and UDP conversations per test

Initially, Wehe supported only one TCP/UDP conversation per Test. Our changes make it possible to create tests from PCAP files that contain many TCP and UDP streams and thus allow tests to better reflect the behaviour of the actual applications.

<picture> <source media="(prefers-color-scheme: dark)" srcset="./graphics/ModifiedWehe-whitebg.svg"> <source media="(prefers-color-scheme: light)" srcset="./graphics/ModifiedWehe.svg"> <img alt="Portraits the support for multiple TCP/UDP conversations per test" src="./graphics/ModifiedWehe-whitebg.svg"> </picture>

Removal of Websocket Dependency/M-Lab

Since we do not use M-Lab for our tests we were able to remove the dependency on the Tyrus Websocket library which was only used in supporting M-Lab.

<!--config update-->

Adding new Tests

New tests can be created by following these steps:

  1. Follow the instructions found in the wehe-server repository to generate the necessary files.
  2. Move the generated file called <testname>.client_all.json into the res/ folder
  3. Add a new entry in the apps_list.json file:
    {
      "name": "<testname>",
      "time": <time before test times out in seconds>,
      "image": "<testname>",
      "category": "",
      "randomdatafile": "",
      "datafile": "<testname>.pcap_client_all.json"
    }
    

About the Code

Running the client

There are two ways to run the code:

  1. Run the jar file (wehe-cmdline.jar)
  2. Build from source (use Java 11)
  3. Use docker to build a container image

A compiled jar comes with the repo (wehe-cmdline.jar). This jar was compiled using Java 11.

Usage

Usage: java -jar wehe-cmdline.jar -s <SERVER_IPS> -n <TEST_NAME> [OPTION]...

Example: java -jar wehe-cmdline.jar -s 192.0.2.15,2001:db8::15 -n snapchat_misc -r results/ -l info

Options

-n TEST_NAME - The name of the test to run. Argument required. See below for list of test names.

-s SERV_NAME - The hostname or IP of server to run the tests. Default: wehe4.meddle.mobi.

-t RESR_ROOT - The resources root containing apps_list.json and the tests. No need to change this if using the jar or if you don't move the res/ directory. Default: res/.

-r RSLT_ROOT - The results root containing the output logs and info. Default: test_results/.

-l LOG_LEVEL - The level of logs and above that should be printed to console (all levels will be saved to logs on disk regardless of the level printed to console). Choose from wtf, error, warn, info, or debug. Default: none of these, only UI logs (what the user would see on screen when running the Android app) will be printed to the console.

-h - Print the help message.

-v - Print the version number.

Provided Tests

Test Names (-n arg)
fm4_favorite_1
fm4_flow_1
fm4_misc_1
fm4_misc_2
fm4_programme_1
fm4_radio_1
fm4_stories_scroll_1
fm4web_misc_1
fm4web_misc_2
iphone_idle
snapchat_chat_1
snapchat_map_1
snapchat_misc
snapchat_snap_video_1
snapchat_spotlight_1
whatsapp_incoming_call_1
whatsapp_incoming_video_1
whatsapp_misc
whatsapp_outgoing_call_1
whatsapp_outgoing_video_1
fm4web_live_1_android
fm4web_misc_1_android
messenger_chat_1
messenger_misc_1
messenger_chat_1_android
messenger_misc_1_android
messenger_chat_1_android_ipv4
messenger_misc_1_android_ipv4
messenger_android_z_p4

Output

Output is contained in RSLT_ROOT:

Exit Codes

Each error exit code corresponds to a specific spot in the code where execution of the tests was terminated. CTRL+F the exit status on the code base to find where each of these locations are located.

Exit CodeExit StatusExplanation
0SUCCESSNo errors occurred during the test.
1ERR_GENERALAn error occurred that does not fit any below.
2ERR_CMDLINEInvalid command line input.
3ERR_INFO_RDError reading from info.txt.
4ERR_INFO_WRError writing to info.txt.
5ERR_WR_LOGSError writing to the logs.
6ERR_CONN_IPError connecting to server because IP not found.
7ERR_CONN_INSTError getting instance of TCP or UDP socket to send data.
8ERR_CONN_IO_SERVIO issue with the SideChannel.
9ERR_CONN_WSError connecting to WebSocket.
10ERR_UNK_HOSTError connecting to the server.
11ERR_UNK_META_HOSTError connecting to metadata server.
12ERR_CERTError with the certificates.
13ERR_NO_IDNo random ID found.
14ERR_NO_TESTTest not found on client.
15ERR_PERM_REPLAYTest not found on server.
16ERR_PERM_IPAnother user with the same IP is running tests on the server.
17ERR_PERM_RESServer is low on resources.
18ERR_PERM_UNKUnknown server error.
19ERR_ANA_NULLNo analysis status returned.
20ERR_ANA_NO_SUCAnalysis did not succeed.
21ERR_ANA_HIST_CTInvalid analysis history count.
22ERR_RSLT_NULLNo result status returned.
23ERR_RSLT_NO_RESPResult succeed, but result was not sent.
24ERR_RSLT_NO_SUCResult not found.
25ERR_RSLT_ID_HCResult returned wrong random ID or history count.
26ERR_BAD_JSONJSON error.

NOTE: If the Exit Code is negative, then two errors occurred: the number in the Exit Code and ERR_WR_LOGS. For example, -24 means no result was found and the logs could not be written to disk.

Funding

This project is funded through the NGI0 PET Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825310.