Rethinking Host Network Stack Architecture Using a Dataflow Modeling Approach
Total Page:16
File Type:pdf, Size:1020Kb
DISS.ETH NO. 23474 Rethinking host network stack architecture using a dataflow modeling approach A thesis submitted to attain the degree of DOCTOR OF SCIENCES of ETH ZURICH (Dr. sc. ETH Zurich) presented by Pravin Shinde Master of Science, Vrije Universiteit, Amsterdam born on 15.10.1982 citizen of Republic of India accepted on the recommendation of Prof. Dr. Timothy Roscoe, examiner Prof. Dr. Gustavo Alonso, co-examiner Dr. Kornilios Kourtis, co-examiner Dr. Andrew Moore, co-examiner 2016 Abstract As the gap between the speed of networks and processor cores increases, the software alone will not be able to handle all incoming data without additional assistance from the hardware. The network interface controllers (NICs) evolve and add supporting features which could help the system increase its scalability with respect to incoming packets, provide Quality of Service (QoS) guarantees and reduce the CPU load. However, modern operating systems are ill suited to both efficiently exploit and effectively manage the hardware resources of state-of-the-art NICs. The main problem is the layered architecture of the network stack and the rigid interfaces. This dissertation argues that in order to effectively use the diverse and complex NIC hardware features, we need (i) a hardware agnostic representation of the packet processing capabilities of the NICs, and (ii) a flexible interface to share this information with different layers of the network stack. This work presents the Dataflow graph based model to capture both the hardware capabilities for packet processing of the NIC and the state of the network stack, in order to enable automated reasoning about the NIC features in a hardware-agnostic way. It also describes the implementation of the Dragonet network stack which uses the dataflow model to support the diversity and complexity in the NICs. Dragonet enables effective use of the available hardware features in a portable way by using the dataflow model to share the packet pro- cessing capabilities of a particular NIC configuration with the runtime system, which can then automatically specialize the network stack based on this information. Furthermore, the dataflow model enables systematic exploration of the hardware configuration space and allows reasoning about the hardware capabilities in the context of application requirements. Thus, allowing policy-based management of the NIC’s resources. The dissertation shows the effectiveness of the dataflow model by implementing several high-level policies for managing different hard- ware resources on two separate NICs. Kurzfassung Mit der wachsenden Diskrepanz zwischen der Geschwindigkeit des Netzwerks und der CPU-Leistung ist Software nicht mehr in der Lage alle eingehenden Daten ohne jegliche Hilfe von der Hardware zu bewältigen. Netzwerk Interface Controller (NIC) entwickeln sich da- her ständig weiter und können mittlerweile den Systemen helfen, hö- here Skalierbarkeit bezüglich eingehender Pakete zu erreichen, Quality- of-Service (QoS) Garantien bereitzustellen oder die CPU-Last zu re- duzieren. Modernen Betriebssystemen fehlt allerdings die Unterstüt- zung um diese Erweiterungen moderner NICs effizient auszunutzen und verwalten zu können. Das Hauptproblem in diesem Zusammen- hang ist die Architektur des Netzwerkstapels in Schichten sowie zu inflexible Schnittstellen. Diese Dissertation argumentiert, dass für die effektive Nutzung vielfältiger und komplexer NIC-Hardware sowohl eine Repräsentati- on der Paketverarbeitung existieren muss, die unabhängig von der ver- wendeten Hardware ist, als auch eine flexible Schnittstelle um diese Information in allen Schichten des Netzwerkstapels verfügbar zu ma- chen. Diese Arbeit präsentiert ein auf einem Dataflow-Graph basierende Modell, welches sowohl die Fähigkeiten der Hardware im Bezug auf die Paketverarbeitung eines NIC als auch den Status des Netzwerksta- pels darstellt. Dies erlaubt die automatische, hardware-unabhängige Auswahl der verfügbaren Fähigkeiten der NIC-Hardware. Des Wei- teren beschreibt die Arbeit die Implementierung des Dragonet Netz- werkstapels, welcher das Dataflow-Modell benutzt um die Vielfalt und Komplexität der NICs optimal zu unterstützen. Dragonet erlaubt mit Hilfe des Dataflow-Modells, die Fähigkei- ten der Hardware plattformunabhängig und effektiv einzusetzen um die Paketverarbeitung zwischen der Laufzeitumgebung und des NIC aufzuteilen. Die Laufzeitumgebung kann dann automatisch den Netz- werkstapel aufgrund dieser Informationen spezialisieren. Des Weiteren erlaubt das Dataflow-Modell die systematische Er- schließung aller möglichen Hardware-Konfigurationen und erlaubt es zu beurteilen, wie die verschiedenen Hardware-Fähigkeiten im Kon- text von verschiedenen Anwendungen eingesetzt werden können. Diese Dissertation zeigt die Effektivität des Dataflow-Modells durch die Implementierung von mehreren abstrakten Strategien zur Verwal- tung von unterschiedlichen Hardware-Ressourcen mit zwei unterschied- lichen NICs. Acknowledgments First of all, I thank my advisor Timothy Roscoe, for giving me the opportu- nity to do the research, and the valuable guidance and advise. I also thank Kornilios Kurtis and Antoine Kaufmann for the collaborative work on the Dragonet project. I thank Gustavo Alonso, Kornilios Kurtis and Andrew Moore for being part of my examination committee, and giving me valuable feedback on the the- sis. I am grateful to the whole Barrelfish team, in particular Stefan, Gerd, Si- mon, David, Reto and Jana for all the help throughout my PhD. In addition, I thank Claude, Besmira, Darko, Anja and Frank for their valuable feedback on the thesis. Further, I thank Simonetta for all the support in administra- tive issues and helping me improve the English of my thesis. I also thank Indrajit Roy, and Kimberly Keeton from HPELabs for their guidance and help during and after my internship. I extend my gratitude to everyone in the Systems group for the great time I had here. I thank Nina for the company, and for trying to cheer me up in the difficult times. I am grateful to my family, for supporting me to reach here, and for setting me free to explore. Finally, I thank the reader for the interest in this work. Contents 1 Introduction1 1.1 Motivation...........................1 1.2 Thesis.............................3 1.3 Contribution..........................3 1.4 Dissertation Structure.....................4 1.5 Collaborative work......................5 1.6 Related Publications.....................6 2 Background7 2.1 The state of NIC hardware..................7 2.1.1 Lack of standards and abstractions.......... 10 2.2 The state of OS network support............... 10 2.2.1 Motivation to rethink network stack design..... 12 2.2.2 NIC capabilities as first class OS resources..... 13 2.3 Layers in traditional network stacks............. 14 2.3.1 Limitations of layered architecture in network stack. 14 2.3.2 Background on flexible network stack design.... 16 2.4 Case Study: Programmable NICs............... 17 2.4.1 Background...................... 17 2.4.2 Motivation for programmable NICs......... 18 2.4.3 Evaluation...................... 18 2.4.4 Observations about using programmable NIC.... 28 2.5 Discussion........................... 29 3 Dragonet 31 3.1 Introduction.......................... 31 3.2 Background.......................... 33 3.2.1 Modeling packet processing as graphs........ 33 3.2.2 DSL to capture hardware capabilities........ 34 3.3 Dataflow Modeling...................... 35 3.3.1 Network state..................... 37 3.3.2 Logical Protocol Graph (LPG)............ 38 3.3.3 NIC capabilities................... 40 3.3.4 Physical Resource Graph (PRG)........... 40 3.3.5 Attributes....................... 44 3.3.6 Unicorn........................ 45 3.3.7 Example: Modeling the i82599 with Unicorn.... 47 3.4 Exploring the configuration space.............. 51 3.4.1 Hardware oracle................... 53 3.5 Understanding application requirements........... 54 3.5.1 Interfaces based on dataflow model......... 54 3.5.2 Network flow management interface......... 55 3.6 Policy-based resource allocation............... 56 3.6.1 Cost functions: Hardware agnostic policies..... 57 3.6.2 Searching the PRG configuration space....... 59 3.7 Dataflow-based Interfaces................... 60 3.7.1 Interface based on the C-PRG............ 61 3.7.2 Embedding using node labels............ 62 3.7.3 Using predicates for flow analysis.......... 64 3.8 Conclusion.......................... 65 4 Dragonet runtime system 67 4.1 Background.......................... 67 4.2 Creating a specialized network stack............. 68 4.2.1 Creating partitions.................. 71 4.2.2 Alternate approaches................. 73 4.3 Runtime system........................ 73 4.3.1 Data Plane...................... 75 4.3.2 Control Plane..................... 80 4.3.3 Device driver layer.................. 83 4.3.4 Application Interaction with Dragonet........ 84 4.4 Putting it all together..................... 85 4.5 Conclusion.......................... 86 5 Queue management with Dragonet 87 5.1 Introduction.......................... 87 5.2 Motivation and Background................. 89 5.2.1 Network hardware.................. 89 5.2.2 Diversity and Configurability of filters........ 90 5.2.3 System software................... 92 5.2.4 Discussion...................... 96 5.3 Modeling HW Complexity.................. 97 5.3.1 Filter configuration space............... 97 5.3.2 PRG oracle implementation............. 100 5.4 Policy-based queue management............... 101 5.4.1 Capturing