A Middleware for Mobile Edge-Clouds
Total Page:16
File Type:pdf, Size:1020Kb
A Middleware for Mobile Edge-Clouds João Filipe Rodrigues Doutoramento em Ciência de Computadores Departamento de Ciência de Computadores 2019 Orientador Luís Miguel Barros Lopes, Professor Associado, Faculdade de Ciências Coorientador Fernando Manuel Augusto Silva, Professor Catedrático, Faculdade de Ciências D Dedicated to My mother, sister and little niece ii Acknowledgements I am deeply indebted to my advisors Profs. Fernando Silva and Lu´ısLopes and also to Prof. Eduardo Marques for their fundamental role during my doctoral work. They provided me with every bit of guidance, assistance, and expertise that I needed. I would like to thank, again, my advisors for offering me a research grant and a special thanks for their effort to provide all the material required to the success of this project. Also, I would like to thank, Prof. Rolando Martins for his assistance and guidance at the beginning of my work. I simple cannot imagine better advisors and colleagues to work with. It is a honour to work with such good people. I am thankful to the Funda¸c~aopara a Ci^enciae Tecnologia (FCT) for funding my research grant in the context of project HYRAX (CMUP-ERI/FIA/0048/2013), which supported this work for 48 months, and to the Centre for Research and Advanced Computing Systems (CRACS) for the travel funding through projects financed by ERDF (COMPETE 2020, POCI-01-0145- FEDER-006961), FCT (CMUP-ERI/FIA/- 0048/2013 and UID/EEA/ 50014/2013), and FEDER (NORTE 2020, NORTE-01- 0145-FEDER- 000020). To all my fellow colleagues from DCC-FCUP, specially F´abioDomingues, Sylwia Bugla and Joaquim Silva, I wish you much success for your professional and personal future. Finally, I would like to thank my family and friends for all the support during the last years, specially my mother and sister, that believed, trusted and supported me in every way they could. I am also specially grateful to my grandparents, Sildina and Manuel, whose way to life is really inspiring. iii iv Resumo Durante a ´ultimad´ecada,os dispositivos m´oveis tornaram-se ub´ıquos. Avan¸cosno processo de fabrico fizeram com que os pre¸cosde tais dispositivos baixassem significati- vamente enquanto aumentava a sua capacidade de processamento e de armazenamento. Tradicionalmente, esses dispositivos eram vistos como thin clients. No entanto, como anteriormente afirmado, os smartphones e tablets de hoje cont^emrecursos de hardware que permitem que software mais sofisticado seja instalado, permitindo a sua utiliza¸c~ao como thick clients ou mesmo pequenos servidores. Simultaneamente, novos standards e protocolos, como WiFi-Direct, foram desenvolvidos para permitir que os dispositivos m´oveis pudessem comunicar directamente entre si, em vez de ser atrav´esda Internet ou de pontos de acesso WiFi. Al´emdisso, esta tecnologia permite a comunica¸c~aoentre os dispositivos com alta largura de banda e ao mesmo tempo baixa lat^encia.Por fim, os dispositivos t^emagora incorporados v´ariossensores que lhes permitem "sentir" o ambiente, em redor, e alimentar aplica¸c~oese servi¸cosmais sofisticados. Todos estes desenvolvimentos est~aona base de um interesse renovado na ´areade edge- networks. Tais redes s~aocompostos por dispositivos m´oveis que formam entre si edge- clouds, trazendo parte da funcionalidade da cloud para a periferia da Internet. As edge-clouds s~aoportanto formadas por conjuntos de dispositivos m´oveis em estreita proximidade que fornecem servi¸cosque se baseiam na agrega¸c~aodos seus recursos computacionais e de armazenamento. O desenvolvimento de tais aplica¸c~oese servi¸cos ´e,contudo, dificultada pela pela complexidade da forma¸c~ao e manuten¸c~aodas redes, pela instabilidade intr´ınsecadas liga¸c~oessem fio e pela heterogeneidade do hardware e dos sistemas operativos dos dispositivos. Nesta tese, apresentamos o desenho e a implementa¸c~aode um middleware gen´erico para edge-clouds com a finalidade de fornecer aos programadores os procedimentos b´asicospara implementa¸c~aode aplica¸c~oesm´oveis para estas plataformas. Com esse objectivo, o middleware oferece ao programador uma API que lida com a complexidade de baixo n´ıvel tal como forma¸c~aoe gest~aode redes e a agrega¸c~aode recursos, de forma v a gerir situa¸c~oes como comunica¸c~aointermitente, mobilidade, churn e execu¸c~aosem infraestrutura. Tudo isto ´efornecido sem a necessidade de fazer root ao dispositivo, caso contr´arioseria inutiliz´avel no mundo real. Al´emda arquitectura e dos detalhes de implementa¸c~ao,fazemos uma avalia¸c~ao do desempenho, da escalabilidade do middleware e tamb´emuma breve discuss~aosobre as in´umerasaplica¸c~oese servi¸cosque t^emvindo a ser implementados recorrendo ao middleware. Al´emdisso, desenvolvemos e estudamos o comportamento de aplica¸c~oes reais para a distribui¸c~aoe partilha de v´ıdeoem infraestruturas desportivas, com ou sem infraestrutura de rede. vi Abstract In the last decade, mobile devices have become ubiquitous. Advances in manufacturing processes have significantly dropped the price tag of such devices whilst augmenting their storage and computational capabilities. Traditionally these devices were viewed as simple clients. However, as stated, smartphones and tablets today have hardware resources that allow more sophisticated software to be installed, allowing for their use as thick clients or even thin servers. Simultaneously, new standards and protocols, such as WiFi-Direct, have been developed that allow mobile devices to communicate directly with each other, as opposed to over the Internet or across WiFi access points. This technology enables low latency, high bandwidth device-to-device (D2D) commu- nication. Finally, the devices have now embedded multiple sensors that allow them to feel the environment and feed more sophisticated applications and services. These developments fostered the research on edge-networks, composed of such devices, and on mobile edge-clouds, where some traditional cloud computing functionality is provided by at the edge. Mobile edge-clouds are thus formed by sets of mobile de- vices in close proximity providing services that crowd-source their computational and storage resources. The development of such crowd-sourcing applications and services is, however, hampered by the complexity of network formation and maintenance, the intrinsic instability of wireless links and the heterogeneity of the hardware and operating systems in the devices. In this thesis, we present the design and implementation of a general purpose mid- dleware for edge-clouds that provides programmers with the basic building blocks for implementing mobile crowd-sourcing applications. Towards this goal, the middleware provides the programmer with an API that handles the low-level complexity of net- work formation and management and crowd-sourcing of resources, whilst handling problematic issues such as intermittent communication, device churn and untethered execution. All this is provided without the need for "rooting" the device, which would automatically devoid the approach of its applicability in the real world. vii Besides the architecture and implementations details, we provide an assessment of the performance and scalability of the middleware and discuss the, by now, numerous applications and services that have been implemented on top of it, including real-world apps for content sharing in sports venues or in infrastructure-deprived environments and general services for computation and storage. viii Acronyms 3G/4G Third/Fourth generation of wireless mobile telecommunications technology AP Access Point AODV Ad-hoc On-demand Distance Vector API Application Programming Interface Bluetooth LE Bluetooth Low Energy CC Cloud Computing D2D Device to Device DSDV Destination Sequence Distance Vector DSR Dynamic Source Routing GB Gigabyte Gbps Gigabit per second GHz Gigahertz GPS Global Positioning System IaaS Infrastructure as a Service iOS iPhone Operation System IoT Internet of Things IP Internet Protocol ISM Industrial, Scientific, and Medical radio band ix MCC Mobile Cloud Computing MAC Media Access Control MANET Mobile Ad-hoc Network Mbit Megabit Mbps Megabit per second MEC Mobile Edge Cloud NFC Near Field Communication MHz Megahertz OLSR Optimised Link State Routing Protocol OS Operation System OSI Open Systems Interconnection P2P Peer to Peer PaaS Platform as a Service RAM Random Access Memory RTC Real Time Communications SaaS Software as a Service SDK Software Development Kit SSD Solid State Disk TDLS Tunneled Direct Link Setup WPA WiFi Protected Access ZHLS Zone-based Hierarchical Link State Routing Protocol ZRP Zone Routing Protocol x Contents Resumo v Abstract vii Acronyms ix List of Tables xv List of Figures xviii 1 Introduction 1 1.1 Motivation . .2 1.2 Problem statement . .3 1.3 Contributions . .5 1.4 Thesis layout . .6 2 State of the art 7 2.1 Networking . .8 2.1.1 Technologies . .8 2.1.2 Network formation . 10 2.1.3 Routing . 14 2.2 Middleware . 17 xi 2.2.1 Generic Middlewares . 18 2.2.2 Special purpose . 23 2.3 Crowd-sourcing applications . 25 2.4 Discussion . 26 3 A Middleware for Edge-Clouds 29 3.1 Overview . 29 3.2 Link Layer . 31 3.2.1 Architecture . 32 3.2.2 Example . 34 3.2.3 API . 39 3.2.4 Implementation . 41 3.3 Network layer . 43 3.3.1 Architecture . 44 3.3.2 Examples . 46 3.3.3 API . 48 3.3.4 Implementation . 50 3.4 Discussion . 62 4 Middleware evaluation 63 4.1 Link layer . 63 4.1.1 Evaluation setup . 63 4.1.2 Latency of link actions . 64 4.1.3 Bandwidth measurements . 66 4.1.4 Resource consumption . 66 4.2 Network Layer . 70 xii 4.2.1 Evaluation setup . 71 4.2.2 Packet routing . 71 4.2.3 Network Formation . 87 4.3 Discussion . 94 5 Other Contributions 97 5.1 Wireless Technology Assessment . 97 5.2 User Generated Replays: Part I . 99 5.3 User Generated Replays: Part II . 100 5.4 Edge-Cloud Services and Apps . 102 5.4.1 Distributed Computing .