Practical Measurements of Wi-Fi Direct in Content Sharing, Social and Gaming Android Applications
Total Page:16
File Type:pdf, Size:1020Kb
Practical Measurements of Wi-Fi Direct in Content Sharing, Social and Gaming Android Applications by Daniël Schoonwinkel Thesis presented in partial fulfilment of the requirements for the degree of Master of Science in Electric and Electronic Engineering in the Faculty of Engineering at Stellenbosch University Department of Electric and Electronic Engineering, University of Stellenbosch, Private Bag X1, Matieland 7602, South Africa. Supervisor: Prof G-J van Rooyen March 2016 Stellenbosch University https://scholar.sun.ac.za Declaration By submitting this thesis electronically, I declare that the entirety of the work contained therein is my own, original work, that I am the sole author thereof (save to the extent explicitly otherwise stated), that reproduction and pub- lication thereof by Stellenbosch University will not infringe any third party rights and that I have not previously in its entirety or in part submitted it for obtaining any qualification. Signature: . D Schoonwinkel 2015/09/28 Date: . Copyright © 2016 Stellenbosch University All rights reserved. i Stellenbosch University https://scholar.sun.ac.za Abstract Practical Measurements of Wi-Fi Direct in Content Sharing, Social and Gaming Android Applications D Schoonwinkel Department of Electric and Electronic Engineering, University of Stellenbosch, Private Bag X1, Matieland 7602, South Africa. Thesis: MEng (E&E) December 2015 Wi-Fi Direct is a recent expansion to the very successful 802.11 Wi-Fi tech- nology. According to Wi-Fi Alliance, Wi-Fi Direct is being broadly adopted, among others by Google’s Android (since version 4.0 Ice Cream Sandwich). However, to the authors’ knowledge no formal testing of Wi-Fi Direct through- put, latency, packet loss and energy use on smartphones has been performed. This thesis presents practical measurements of Wi-Fi Direct capabilities on Android smartphones in practical use-case driven applications. It was found that Wi-Fi Direct would be well suited to content sharing applications and possibly also gaming applications. Furthermore, tests showed that Wi-Fi Di- rect is more sensitive to communication range and uses more energy compared to standard Wi-Fi. However, with some improvements to this technology, also discussed in this thesis, and on-going development in Android, Wi-Fi Di- rect could become a reliable and ubiquitous device-to-device communication medium. ii Stellenbosch University https://scholar.sun.ac.za Uittreksel D Schoonwinkel Departement Elektriese en Elektroniese Ingenieurswese, Universiteit van Stellenbosch, Privaatsak X1, Matieland 7602, Suid Afrika. Tesis: MIng (E&E) Desember 2015 Wi-Fi Direct is ‘n nuwe uitbreiding tot die 802.11 Wi-Fi tegnologie. Volgens Wi-Fi Alliance, word Wi-Fi Direct al hoe meer ingesluit in elektroniese toe- stelle, veral in nuwer Android selfone. Android word ontwikkel deur Google, en sluit Wi-Fi Direct funksionaliteit in vanaf weergawe 4.0 Ice Cream Sandwich. Egter, Android se Wi-Fi Direct datatempo, pakkie vertraging, pakkie verlies en energie verbruik is nog nie in ‘n formele akademiese werk gemeet nie. In hierdie tesis word die vermoeëns van Wi-Fi Direct getoets in praktiese Android toepassings. Die toetse het getoon dat Wi-Fi Direct gepas is vir foto- en videoverspreiding toepassings. Speletjie toepassings kan moontlik ook ondersteun word deur Wi-Fi Direct. Daar is gevind dat Wi-Fi Direct meer sensitief is vir kommunikasie afstand en meer energie intensief is as stand- aard Wi-Fi. Egter, met sekere verbeteringe (ook bespreek in hierdie tesis) en voordurende ontwikkeling deur Android, kan Wi-Fi Direct as ‘n betroubare en alomteenwoordige ewe-knie kommunikasie medium uitblink. iii Stellenbosch University https://scholar.sun.ac.za Acknowledgements I would like to express my sincere gratitude to the following people and organ- isations: • My lecturer, Prof Gert-Jan van Rooyen for humour, insight and guidance. • The Medialab and all my friends and colleagues. • Manrich van Greunen, my best friend, for working, thinking, and sweat- ing together. • My family, for supporting me through the easy and difficult times. iv Stellenbosch University https://scholar.sun.ac.za Dedications Aan my Hemelse Vader, wat vir my krag en inspirasie gee elke dag. v Stellenbosch University https://scholar.sun.ac.za Terms of Reference This project was commissioned by the MIH Media Lab and DSTV / Multi- choice, and the following specific objectives were placed on the project: • Investigate the capabilities of Wi-Fi Direct, possibly as an alternative physical layer that could support content distribution. • Design and implement a framework that supports distribution of pro- motional content in places of confluence for example shopping malls, classrooms or conferences. vi Stellenbosch University https://scholar.sun.ac.za Contents Declaration i Abstract ii Uittreksel iii Acknowledgements iv Dedications v Terms of Reference vi Contents vii List of Figures ix List of Tables xi Nomenclature xii 1 Introduction 1 1.1 Background . 1 1.2 Problem Statement . 2 1.3 Related Work . 3 1.4 Objectives . 4 1.5 Summary . 5 2 Literature Study 6 2.1 Network Technologies . 6 2.2 Networking Protocols . 8 2.3 Network Metrics . 9 2.4 Android Operating System . 10 2.5 General Design patterns . 11 2.6 Apple iOS . 12 2.7 Summary . 12 vii Stellenbosch University https://scholar.sun.ac.za CONTENTS viii 3 System Design 13 3.1 Use-cases . 13 3.2 Framework Requirements . 14 3.3 Mobile Operating System Platform . 16 3.4 Framework Design Choices . 18 3.5 Framework Components . 19 3.6 Using the Framework . 24 4 Detail Design 28 4.1 Wi-Fi P2P Framework Implementation . 28 4.2 Summary . 36 5 Application Implementation 39 5.1 Content Sharing using FTP Server and FTP Client . 39 5.2 Gaming Using the PongWifiP2P App . 43 5.3 Chatting Using the WifiP2P_Chat App . 43 5.4 Modular Design . 45 5.5 Using the Framework . 45 5.6 Summary . 47 6 Testing 48 6.1 Testing Devices . 48 6.2 Confidence Interval on the Mean . 49 6.3 Testing of Throughput . 49 6.4 Testing of Latency, Jitter and Packet loss . 56 6.5 Testing of Chat App . 65 6.6 Testing of Power Usage . 66 6.7 Testing of Connection Time . 69 6.8 Summary . 72 7 Conclusions 74 7.1 Summary of Work . 74 7.2 Evaluation of the Wi-Fi P2P Framework . 76 7.3 Suitability Analysis of Wi-Fi P2P for Different Applications . 77 7.4 Summary . 78 7.5 Future Work . 78 7.6 Android Wi-Fi P2P pitfalls . 79 7.7 Future of Wi-Fi Direct . 80 Bibliography 81 Appendices 87 App Screenshots 88 Stellenbosch University https://scholar.sun.ac.za List of Figures 3.1 Content sharing use case. 14 3.2 Gaming use case. 14 3.3 Chatting use case. 15 3.4 Wi-Fi P2P framework block diagram. 20 3.5 Wi-Fi P2P environment. 21 3.6 Start-up sequence of the P2PFramework. 22 3.7 P2P Connect as Consumer. 23 3.8 P2P Connect as Provider. ...................... 24 3.9 Using the framework via IP address. 25 3.10 Using the framework and the generic TCP channel. 27 4.1 Wi-Fi P2P framework implementation block diagram. 29 4.2 IP2PConnectorService: AIDL interface to the P2P framework. 30 4.3 P2PConnectorService: The framework core process responsible for managing and starting all related Wi-Fi P2P processes. 31 4.4 WifiP2PManager: The Android system service responsible for man- aging physical layer hardware of Wi-Fi P2P protocol. 33 4.5 ServerThread: All the classes responsible for the TCP connection server-side. 34 4.6 ClientThread: All the classes responsible for the TCP client-side. 35 4.7 WifiP2PApp structure. 37 5.1 Swiftp application structure. 40 5.2 WifiP2P_FTP application structure. 42 5.3 PongWifiP2P application structure . 44 5.4 WifiP2P_Chat application structure . 46 6.1 FTP throughput comparison between Wi-Fi P2P and Wi-Fi. 51 6.2 FTP throughput comparison between Wi-Fi P2P, Wi-Fi and Wi-Fi P2P with three devices. 52 6.3 Bluetooth FTP throughput. 55 6.4 Latency comparison between Wi-Fi P2P and standard Wi-Fi with outliers shown. 57 ix Stellenbosch University https://scholar.sun.ac.za LIST OF FIGURES x 6.5 Jitter comparison between Wi-Fi P2P and standard Wi-Fi with outliers shown. 58 6.6 Latency comparison between Wi-Fi P2P and standard Wi-Fi. 59 6.7 Jitter comparison between Wi-Fi P2P and standard Wi-Fi. 60 6.8 Packet loss comparison between Wi-Fi P2P and standard Wi-Fi. 61 6.9 Power measurement setup. 67 6.10 Connection time distribution with outliers shown. 71 6.11 Connection time distribution with outliers hidden. 72 1 WifiP2PApp screenshot. 88 2 Swiftp screenshot. 89 3 WifiP2P_FTP screenshot. 90 4 PongWifiP2P screenshot. 91 5 WifiP2P_Chat screenshot. 92 Stellenbosch University https://scholar.sun.ac.za List of Tables 2.1 Comparison of popular communications technologies . 8 3.1 Summary of Wi-Fi P2P terms . 16 6.1 Device technical specifications summary. 49 6.2 Wi-Fi P2P and Wi-Fi Signal-to-Noise Ratios for FTP tests. 52 6.3 Summary of Wi-Fi P2P and Wi-Fi throughput mean and ME. 53 6.4 Bluetooth throughput mean and margin of error. 56 6.5 Wi-Fi P2P and Wi-Fi Signal-to-Noise Ratios for Pong tests. 61 6.6 Pong Wi-Fi P2P and Wi-Fi latency mean and margin of error. 63 6.7 Pong Wi-Fi P2P and Wi-Fi jitter mean and margin of error. 63 6.8 Pong Wi-Fi P2P and Wi-Fi packet loss percentages. 64 6.9 Deletion and transposition count of P2P Chat between three devices. 66 6.10 Samsung Mini power usage during different states of P2P connection. 67 6.11 Throughput to power ratio.