Edinburgh Research Explorer
Total Page:16
File Type:pdf, Size:1020Kb
Edinburgh Research Explorer The Serverkernel Operating System Citation for published version: Larrea, J & Barbalace, A 2020, The Serverkernel Operating System. in Proceedings of the Third ACM International Workshop on Edge Systems, Analytics and Networking. ACM Association for Computing Machinery, New York, NY, USA, pp. 13–18, 3rd International Workshop on Edge Systems, Analytics and Networking, Heraklion, Crete, Greece, 27/04/20. https://doi.org/10.1145/3378679.3394537 Digital Object Identifier (DOI): 10.1145/3378679.3394537 Link: Link to publication record in Edinburgh Research Explorer Document Version: Peer reviewed version Published In: Proceedings of the Third ACM International Workshop on Edge Systems, Analytics and Networking General rights Copyright for the publications made accessible via the Edinburgh Research Explorer is retained by the author(s) and / or other copyright owners and it is a condition of accessing these publications that users recognise and abide by the legal requirements associated with these rights. Take down policy The University of Edinburgh has made every reasonable effort to ensure that Edinburgh Research Explorer content complies with UK legislation. If you believe that the public display of this file breaches copyright please contact [email protected] providing details, and we will remove access to the work immediately and investigate your claim. Download date: 30. Sep. 2021 The Serverkernel Operating System Jon Larrea Antonio Barbalace University of Edinburgh University of Edinburgh [email protected] [email protected] ABSTRACT shop, familiar items like speakers or lamps come with integrated With the idea of exploiting all the computational resources that an voice assistant capabilities (e.g., Amazon Echo with Alexa support)! IoT environment with multiple mostly-idle interconnected devices From a compute capacity perspective, this scenario opens the door offers, the serverkernel is presented as a new operating system (OS) to a world that provides a broad set of network interconnected pro- architecture that blends ideas from Unikernels and RTOSes. These cessing units that remains the majority of the time in idle status. IoT ideas are further mixed with a FaaS-like programming model to lamps and lighting devices prove the truthfulness of this statement: provide a server in which a user can remotely offload computations their integrated processing units, commonly part of a System on and get the result. Such OS architecture is minimalistic – a bare- Chip (SoC), leaves the idle status only when a new turn-on/turn-off metal OS in which only drivers for CPU, network, and accelerators command arrives from the WiFi chip. Ergo, creating a substrate of are required in order to provide service. compute devices that can be opportunistically exploited to offload To demonstrate the advantages of the serverkernel, jonOS, an computations – especially when they are not energy-constrained, open-source C implementation of this architecture for Raspberry Pi, or have enough power to still correctly functioning for what they is provided. Compared with traditional OSes used in IoT devices, the have been built. serverkernel achieves an improvement ratio of 1.5 in CPU time, 2.5 At this point is where this research work comes into the scene, in execution time, and around 9 times better in network processing. providing a high-performance solution to delegate load on mostly- idle IoT and generic embedded devices. The serverkernel is presented KEYWORDS as a new OS architecture that takes advantage of this multi-device scenario allowing remote computation offloads, efficiently and se- Operating Systems, Serverkernel, IoT, Unikernel, FaaS curely. This new OS architecture mixes ideas from Unikernels, Func- ACM Reference Format: tion as a Service, and Cyclic Executive. Jon Larrea and Antonio Barbalace. 2020. The Serverkernel Operating System. jonOS is the result of implementing the serverkernel OS on real In 3rd International Workshop on Edge Systems, Analytics and Networking hardware targeting high performance. After exhaustive bench- (EdgeSys ’20), April 27, 2020, Heraklion, Greece. ACM, New York, NY, USA, jonOS 6 pages. https://doi.org/10.1145/3378679.3394537 marks, demonstrated better performance of using traditional operating systems, namely Linux, in the described targe scenario. 1 INTRODUCTION In the last years, the demand for IoT devices has grown exponen- 2 BACKGROUND tially, stimulating vendors to broaden the offer of available devices Minimal OSes. Recently, there has been a returned interest in on the market. With more IoT devices on the market, vendors minimal operating systems with Unikernels [18] in the domain of compete for higher performance, smaller physical sizes (miniatur- cloud computing, and little real-time OSes in the domain of IoT ization), lower power consumption, etc. while the per-device price [5, 6]. These fundamentally differ from the well documented tradi- dropped down. Thus, IoT devices are today part of our life; they can tional multi-user/task OS architectures described in [25] – which be found in our city (e.g., intelligent hospital), workplace, home, Linux [13] is a reference implementation. Linux has many variants and on our body (e.g., smartwatch). As a consequence, there are that provide a complete solution for all kinds of scenarios, including research and development to further make IoT devices part of our embedded systems [31]. Thus, it is preferred in several deployments lives, including their integration in wearable and textiles [9, 16, 30], because it may reduce the time to market, and also because it is as well as into medical devices and prothesis [17, 28], which are backed by a large development community that makes it easy to supported by innovative production mechanisms, such as replacing find people trained on Linux. the traditional silicon wafer with flexible materials7 [ ]. Moreover, Unikernels are somewhat derived by the Exokernel OS design [14]. as many of these devices are battery-powered, but batteries cannot Such design strives to provide the closest access to hardware re- easily be charged, energy-harvesting technologies, which aims to sources to the application itself, enabling the application developer implement power-independent platforms that can reap energy from to make low-level decisions. In an Exokernel OS most of the oper- movements or the environment, are at raise [20, 22, 27, 29]. ating system services are deployed into a user-space library, called Now we have an uncommon scenario with many devices at- libOS, which is linked with the application itself. A Unikernel is tached to everyday objects. No one gets surprised when, at the quite similar; in fact, it also provides a libOS that is linked with the application itself. Of the libOS, only the functionalities that EdgeSys ’20, April 27, 2020, Heraklion, Greece © 2020 Association for Computing Machinery. are strictly required by the application to run are used, the oth- This is the author’s version of the work. It is posted here for your personal use. Not ers are discarded during the compilation process – reducing the for redistribution. The definitive Version of Record was published in 3rd International trusted computing base (TCB), and improving security [19]. Thus, Workshop on Edge Systems, Analytics and Networking (EdgeSys ’20), April 27, 2020, Heraklion, Greece, https://doi.org/10.1145/3378679.3394537. Unikernels are tailored to fit the specific needs of an application. Additionally, the application and the libOS run in the same address EdgeSys ’20, April 27, 2020, Heraklion, Greece Jon Larrea and Antonio Barbalace space, which is kernel-space for a Unikernel. Due to the single The serverkernel is a single-address space mono-task OS. The address space, a unikernelized application does not cross address- OS kernel and the application code – which has been received via space boundaries and has direct access to (potentially) all devices the network, reside both in kernel-space to avoid context switch- on a platform – thus, it can access them with the maximum perfor- ing overhead. At the same time, to do not expose the hardware to mance. security risks, application code is run in a shielded environment, Besides the security and performance advantages brought by and a watchdog periodically checks for OS liveliness. For the sake Unikernels, Unikernels were not designed to run on bare-metal, of minimality, the serverkernel offers a limited set of functionalities. but atop a hypervisor that exposes standard virtualized devices. Only device drivers for network cards, CPU, and accelerators (in- Running a hypervisor is not always an option on embedded de- cluded security engines) are necessary to achieve high-performance vices [23], and when it is, it may introduce non-trivial overheads, executions. not just because of the hardware but also due to the software [21]. This could be thought of as a Unikernel, which is also single- Unikernels usually support a very narrow set of devices, hence address space, but its main functionality is a server. However, a are not a good fit for embedded devices, including IoT. Therefore, serverkernel cannot be optimized according to just one application’s most IoT devices today adopt little real-time operating systems [26] requirements because it has been designed to run generic appli- (RTOS). Such OSes offer time guarantees for applications that need cation code. From the functionality perspective, the proposed OS to process data as it comes to the device – i.e., producing an answer sounds similar to a FaaS runtime, but the latter runs in user-space, in a specific amount of time from when the data is received. How- not integrated within the OS kernel. Moreover, the dispatching of ever, most RTOS today are bloated with additional code to support application code to the serverkernel is directed by the client itself, multimedia, multi-tasking, etc., incorporating design traits from while in FaaS it is the responsibility of the data-center provider. traditional multi-user/task OS architectures. Hence, less suitable Hence, the serverkenel borrows concepts from Unikernels and FaaS, for maximum performance.