project in distributed systems iperf for android developers: shir degani, yuval degani supervisors:...

16
PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Post on 19-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

PROJECT IN DISTRIBUTED SYSTEMSIPERF FOR ANDROID

Developers: Shir Degani, Yuval DeganiSupervisors: Prof. Roy Friedman, Alex Kogan

Page 2: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Project Goal

The project is based around a common open-source tool called "iperf", which is widely used for bandwidth measurement in Linux and Windows environments.

Our main goal is to port iperf to Android environment, so it can be used to measure performance across networks within a mobile device, running as a client or server.

Page 3: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Secondary Goals

Ability to perform iperf tests using the Android version with original versions running on a PC or laptop using Linux/Windows.

To provide all the functionality and features of the original PC version.

To provide the user with a friendly GUI for a mobile device and use the same parameters and commands as in the original version.

Page 4: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Tools used in the project

Android SDK as the standard environment.

Android NDK, Native Development kit, which allows integration of C code into the Java environment.

Page 5: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Basic Architecture

Our project consits of two parts: Modified source-code of iperf, configured to be

compiled using NDK, and run on Android. Java code of the Android application consisting

of a GUI and code for running the compiled iperf executable.

The advantages of this "Divide and Conquer" approach, is that we promise minimum changes to already working algorithms of iperf, and thus making it compatible with other machines running the original iperf.

Page 6: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Basic Architecture - Chart

Android Java application

iperf executable cross-compiled for Android ARM

enviroments.

iperf modified C source-code

Android NDK

“IperfTask“ class

Page 7: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Design Decisions

The main decision that had to be made was whether to rewrite the original code to java or to use the existing C code with modifications.

Since our intentions were to keep compatibility and reliability to the maximum, we have decided to use the original code.

Page 8: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

User interface

The user interface is designed to be as similar as possible to the original version, with small changes to make it touch-screen friendly.

Page 9: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

User interface - Screenshots

Page 10: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Class Diagram

Android application package (iperf.apk)

“iperf”iperf executable cross-compiled for Android.

“iperf_activity.xml”Layout properties of the application.

“IperfProject.java”Main source file for the application.

Initialization methods

GUI functionality

Class “IperfTask” Test Invocation

Page 11: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Class “IperfTask” Test invocation code - the interface between the

Android application and the iperf executable running in the background in a terminal.

This code consists of a special class called "IperfTask" which extends the class "AsyncTask".

AsyncTask is a built-in method of Android that allows running processes in the background and occasionally updates the GUI upon changes in output. With every test invocation, a new instance of this class is made so it can run in the background while the output streams correctly to screen.

Page 12: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Class “IperfTask” - continued

This special class allows this functionality with no harm to the performance of the test, as it is scheduled by the system when resources are free.

When a test ends, or aborted by the user, the process is terminated, clearing up memory for the next test to be run.

Before every test we also check the input from the user to match certain syntax that iperf supports, using a regular expression. This is done in order to prevent any exploitation of the shell interface.

Page 13: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Timing in Android environments Iperf measures bandwidth using simple computations

of time differences between submissions and retrievals of data packets.

This is done in the original code using “gettimeofday()” system function (sys/time.h).

In our modified version this is done in the same way, but an Android implementation is used when running.

In the Android version, the functionality is basically the same, since this is a system function that runs on the kernel outside of the Dalvik VM.

Our conclusion is that no difference should arise between the two versions, since Android provides the same functionality as being linux-like.

Page 14: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Changes to the original source code For compiling the code so it could run on

the Android platform, we used the linux 32bit configuration for x86 processors as a baseline.

We tested numrous additional configurations until we got it to compile and run on an Android ARM terminal with the exact functionality as running it on a linux terminal.

Page 15: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

Changes to the original source code - continued

To summarize the changes and additions that exist in the final version:

1. Application.mk - makefile to configure the filenames and working directories for NDK.

2. Android.mk - makefile for compile and build instructions for NDK.

3. Source files - we moved the original source files to a single directory that contains only the relevant code for this build.

4. changes in the files themselves revolved around correcting the system dependencies of the original code, mainly involving includes definitions.

We made a special effort not to change the code itself, thus we retain the original functionality of the source code. All the features of the original iperf remain the same, including multithreaded testing (-P), UDP testing (-U), etc.

Page 16: PROJECT IN DISTRIBUTED SYSTEMS IPERF FOR ANDROID Developers: Shir Degani, Yuval Degani Supervisors: Prof. Roy Friedman, Alex Kogan

The End.