iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📖

re:Invent 2024: Deep Dive into the Evolution and Performance Improvements of the AWS Nitro System

に公開
2024/12/09

Introduction

By transcribing various overseas lectures into Japanese articles, we aim to make hidden, high-quality information more accessible. The presentation we will be covering in this project, which operates under that concept, is as follows!

📖 AWS re:Invent 2024 - Dive deep into the AWS Nitro System (CMP301)

In this video, Ali Saidi, a Senior Principal Engineer at AWS, provides a detailed explanation of the AWS Nitro System. He explains the history of the Nitro System's development, which began in 2013, and how it has significantly improved networking, storage, and security features by migrating traditional hypervisor functions to dedicated chips. In particular, he highlights concrete performance improvements, such as the increase in network bandwidth via Nitro Cards from 1 Gbps to 200 Gbps, and the evolution of EBS bandwidth from 2 Gbps to 100 Gbps. Additionally, he details the realization of a Root of Trust via the Nitro Security Chip and the construction of a robust security posture through the elimination of operator access.
https://www.youtube.com/watch?v=YKZbNcOU77c

  • This article was automatically generated from the video. Please watch the original video for accurate information, as there may be typos, omissions, or incorrect content.
  • Clicking on an image will take you to the corresponding scene in the video.

For transcription articles related to re:Invent 2024, information is summarized in this Spreadsheet. Please check it out as well!

Main Content

Overview of the AWS Nitro System and Reasons for Developing Proprietary Chips

Thumbnail 0

Thumbnail 30

Thumbnail 40

I would like to explain the details of the AWS Nitro System. I am Ali Saidi, Senior Principal Engineer at AWS. Today, I will talk about Nitro, why we chose this approach, and what benefits it provides. At AWS, we have been developing silicon chips in multiple areas, including core computing and machine learning. Our first investment in silicon development was the Nitro System, where we migrated traditional hypervisor functions to dedicated chips. This began in 2013 as a collaboration with a startup called Annapurna Labs, which AWS would later acquire.

Thumbnail 70

Thumbnail 90

Most of this lecture is about the Nitro System, but before that, I would like to talk a little about other areas where we are investing in silicon development. The first is AWS Graviton. This is a host CPU that delivers the best price-performance on AWS for a wide range of cloud workloads. Today, customers like Epic Games, Stripe, Pinterest, Datadog, and even SAP are running workloads on Graviton. Some of these customers are running the vast majority of their computing on Graviton. Our third investment in custom silicon is AWS Inferentia and AWS Trainium, developed from the ground up to provide the best price-performance for machine learning inference and training workloads. Customers such as Databricks utilize these.

Thumbnail 110

Thumbnail 120

So, why do we develop our own chips? The answer is simple: we develop our own chips when it delivers direct value to our customers. By developing our own chips, we can specialize them for our use cases. Specialization at AWS means focusing on the operation of the AWS environment and tailoring the design to our specific needs. You might think, "Surely any silicon chip is customized for a specific market?" Typically, when developing a chip, you want to apply it to as many markets as possible to amortize the development costs. However, this often leads to the need to pack in various features. In our case, by focusing solely on our own use cases, we optimize for performance and power efficiency.

Thumbnail 170

Thumbnail 190

The second benefit is speed. By owning the entire development process—from concept ideation to deployment in the data center and delivery to customers—we can execute more rapidly. This allows us to bring technology to our customers faster. By owning this process, we can shorten the time from concept to deployment. The third benefit is innovation. By developing our own chips, we can realize more innovation and create more value. Because the teams developing silicon, motherboards, servers, firmware, hypervisors, racks, and infrastructure are all under one roof, we can break down traditional silos to build optimal solutions and realize optimizations that would have been impossible if we had only looked at individual components.

Thumbnail 220

Thumbnail 240

Thumbnail 250

And finally, security. Nitro provides the means to enhance server security through hardware Root of Trust, verification of server firmware, and limited interaction with the host via authenticated and auditable APIs. Nitro is a fundamental reimagining of virtualization in the cloud. The Nitro System includes Nitro Cards that provide networking, storage, and security functions, as well as host processors. On top of that, we run the Nitro Hypervisor, and above that, our customers' VMs and applications operate. Today, I will talk about how this isolation has provided better security and enabled the development of new features.

Evolution of the Nitro System: Innovations in Networking and Storage

Thumbnail 280

Before that, I would like to talk about how we reached this point. Everything started with a simple question: if we were to leverage the experience gained from spending nearly 10 years developing EC2, how could we change the existing system? To this question, there were many proposals. There were proposals on the performance side, such as increased throughput, simplification of the hypervisor, reduction of latency and jitter, and bare-metal performance. And on the security side, features such as transparent encryption, hardware Root of Trust, elimination of operator access, and an auditable, limited set of APIs were proposed. Nitro gave us the opportunity to realize all of these.

Thumbnail 310

This gave us the opportunity to realize comprehensive improvements through a combination of hardware and software, including the chips we develop at AWS and the firmware that runs on them. Since introducing Nitro with C5 instances in 2017, we have developed five generations of chips. This journey actually began in 2013 with C3 instances, where we introduced Enhanced Networking and began migrating functions that were previously hypervisor-based to dedicated chips. This resulted in higher performance networking, lower latency, and improvements in host CPU utilization.

Thumbnail 370

Over time, we have expanded to handle I/O operations beyond networking, such as storage, using new Nitro Cards. We built a hypervisor capable of significant feature reduction and have been using the Nitro System for all EC2 instances launched since 2017. In the system before Nitro, customer instances ran on the Xen hypervisor. While Xen was effective, it handled many functions: memory management, CPU scheduling, device simulation, limiters, and the application of Security Groups. Furthermore, the privileged dom0 contained a full Linux userspace, and all these functions consumed the host's CPU resources.

Thumbnail 410

Thumbnail 420

Thumbnail 450

We started with networking, offloading these functions to dedicated devices. We developed a family of Nitro Cards for different purposes—some handling networking, some managing storage, and others performing both functions. The Nitro Card for VPC has a PCIe-like connector on one side with virtual functions that provide ENI devices connected to the instance, and a network adapter on the other side. This offloaded VPC data plane functions that were previously run in the hypervisor, such as ENI attachments, Security Groups, Flow Logs, routing, DNS, and DHCP.

New versions of the Nitro Card support transparent network traffic encryption using 256-bit AES when enabled in VPC, without impacting performance. The Elastic Network Adapter (ENA) has undergone impressive evolution, starting at 10 Gbps networking and progressing to 25 Gbps, 100 Gbps, and now 200 Gbps, all while maintaining the same device model and drivers. It is truly an amazing achievement to have increased performance by an order of magnitude while maintaining compatibility.

Another significant advancement for Nitro Cards in VPC networking was the Elastic Fabric Adapter (EFA). EFA is specifically designed for HPC and machine learning workloads that require both low latency and high bandwidth. To achieve this, we implemented a technology developed by AWS called Scalable Reliable Datagram (SRD), which distributes traffic across multiple network paths to reduce congestion and avoid hotspots.

Traditional network protocols typically use a single path within the network, leading to slow reactions to congestion and even slower responses to failures. However, in a Clos network, there are multiple paths between points. By using the SRD implemented on Nitro Cards, we can detect and avoid congestion and utilize more bandwidth simultaneously. This operates at data center scale time, not internet scale time.

The SRD on the Nitro Card provides a foundation for using numerous paths simultaneously, distributing bandwidth across all paths, quickly detecting congestion, moving traffic to congestion-free paths, and avoiding paths with link issues to reduce tail latency and increase bandwidth. In these distributed applications, where computation, networking, and network messaging are often bulk-synchronous—starting computation again after messages are exchanged—tail latency is particularly important. In such systems, P100 latency (tail latency) is more critical than median or average latency.

Let's look at how SRD has performed. The graph shows the number of cores on the X-axis and scaling on the Y-axis. Ideally, we should see the red line, which is perfect scaling. Without EFA, it follows the purple line. Scaling begins and reaches about 400 cores, but then flattens and even drops off. With EFA, it continues to scale almost linearly for a much longer period. The first version of EFA supported up to 100 Gbps networking, while the second version provides up to 200 Gbps networking and 30% lower latency.

Security and Performance Improvements with the Nitro System

Another area where SRD is used is in general networking. However, before that, let me explain how TCP reacts to networks. TCP expects packets to be delivered in order. Traditionally, flows are hashed to a single path in the network and arrive in order through that path. Sometimes, a large flow is hashed to the same path as another flow, causing congestion even in over-provisioned networks. As shown in yellow here, a switch might fail to handle the load and drop packets. This causes TCP to back off, and bandwidth decreases even though traffic continues to flow.

In the scenario shown in red, a link issue might occur. TCP congestion control can handle a certain amount of packet loss, but if a link is completely lost, TCP does not handle it well at all. It must wait for a connection timeout, re-establish a new connection, and then continue processing. One might think that if there are multiple paths in the network, we should just use them all. However, TCP has the premise of in-order delivery. If you send traffic over multiple paths, packets arrive out of order, and the congestion control algorithm determines there is a network issue and reduces the bandwidth.

With ENA Express, we offload these processes to the Nitro Card. TCP cannot handle out-of-order segments well, so we take the TCP traffic, and the Nitro Card uses SRD to distribute the traffic across the entire network. The network reconstructs the packets in order on the receiving side and delivers them to the application. This allows you to leverage the benefits of SRD and multi-pathing without modifying the application at all.

This is particularly beneficial for workloads like file systems, in-memory databases, and media encoding. Single-flow bandwidth has increased fivefold from 5 Gbps to 25 Gbps, and tail latency benchmarks under high load have shown improvements of up to 85%. It is easy to configure; you simply enable ENA Express for the ENA Device via an API or console toggle. Within the same Availability Zone, it works transparently for TCP and UDP, providing significant performance gains.

Performance gains in networking have been remarkable. When EC2 first launched, 1 Gbps networking was common, and that remained mostly unchanged for about 10 years. Today, it has evolved significantly from 10 Gbps to 25, 50, 100, and 200 Gbps, and we now even offer instances capable of multiple terabits. The increase in network bandwidth and performance over these last few years has been truly astonishing.

The Nitro System was then applied to the field of storage.

Next, we applied the Nitro System to the field of storage. As I mentioned earlier, the Nitro Card provides a set of NVMe devices. NVMe is an excellent standard protocol with standardized drivers; the Nitro Card exposes an NVMe interface on one side and translates it to the EBS data plane on the other. Similar to networking, when you enable EBS volume encryption, it is handled transparently on the Nitro Card without any performance degradation, so you don't need to consider any trade-offs when deciding whether or not to enable encryption. Also, as I touched upon with networking, we use SRD here as well. By sending storage requests along multiple paths to the storage server, we are improving tail latency for storage workloads.

Like networking, we are seeing significant performance improvements. Looking back 10 years, EBS bandwidth was 2 Gbps. Today, we offer up to 100 Gbps of bandwidth and 400,000 IOPS. EBS is a great solution and the best choice for most customers; you get better durability and snapshot features, but some workloads require local storage. That is one of the areas where we made further investments with the Nitro System.

Before I explain how this works, I need to provide a little background on how flash memory and SSDs operate. SSDs have two important components. The first is NAND, where bits are stored. However, NAND has a special property; if you want to change 1 byte or 1 bit, you cannot simply change it. To write to NAND, you must erase the entire block, which is usually in megabytes. To address this, we have what is called a Flash Translation Layer (FTL). It manages the mapping of logical to physical addresses, garbage collection, and wear leveling, which evens out consumption because flash has a limited lifespan and a maximum number of write cycles.

If you think about it, this is very similar to database write logging. You write data and clean up the garbage later. Like databases, every SSD vendor has its own FTL implementation, and even if they all provide the same external NVMe API, each acts a little differently. In the average case, they all perform well, but in our experience, they sometimes exhibit strange, unexpected behavior. For example, garbage collection might start at the worst possible time, causing requests to stall suddenly. Such behavior makes it difficult to achieve consistent performance or run workloads that require consistent latency, like databases.

So how can we achieve the necessary performance? We integrated the FTL into the Nitro Card. This allows for up to 60% latency reduction, improved reliability, and encryption with ephemeral keys. Just yesterday, we announced the I4g instance with third-generation SSDs. Compared to the I4g instance from two years ago, it delivers up to 65% higher real-time storage performance and 50% lower latency variability.

With this, we moved away from the hypervisor and host CPU to dedicated hardware for networking and storage functions. You can see that Dom0, the privileged domain in Xen, has now been significantly offloaded, and most of its functions are handled by the Nitro System. After performing this I/O offload, we were able to revisit the features that the hypervisor actually needed. This resulted in a lightweight hypervisor that removed many of the features I described earlier. It allocates memory and CPU, and then just stays out of the way. There is no SSH, systemd, or network stack. It is very compact, and being compact is a wonderful thing. It uses few resources and, as long as you don't ask anything of it, it won't get in your way.

Advanced Security Features and Independent Evaluation of the Nitro System

This gives us near-bare-metal performance. You usually cannot feel the difference in performance even when comparing a bare-metal instance to a virtualized instance of the same size. It is virtually the same as bare metal. Furthermore, we added the Nitro Security Chip to our servers. Motherboards have components that measure fan speed and temperature, but we wanted the ability to update all of these. These components must be monitored and confirmed to be running the latest firmware version.

With the Nitro Security Chip, we are now able to measure the contents of the flash device on the motherboard, verify that it matches our expectations, and update it out-of-band. This allows us to move management and security monitoring to the Nitro Cards and switch to using the Nitro Hypervisor.

I have explained performance and security, but I would like to introduce one more important aspect of the Nitro System: its modular design. There are various cards that can be installed in different servers, allowing us to build different configurations. Looking back, it took 11 years to reach 70 instance types from one. However, after the introduction of the Nitro System, we increased that from 70 to about 850 today. This represents a massive increase in the number of instances, providing customers with flexibility regarding various storage configurations, network configurations, and accelerators that were not possible before the Nitro System.

We have discussed networking and storage, so let's look at security in a little more detail. AWS security is based on a shared responsibility model. AWS is responsible for the security of the cloud. This means we operate, manage, and control all components, from the host software and virtualization layer to the physical security of the facilities where we operate the services. On the other hand, customers are responsible for security in the cloud. This includes implementing necessary security configurations, such as setting up Security Groups, maintaining the OS in an up-to-date state, and configuring VPCs.

There has been a lot of interest in computing over the past few years, but it has also caused confusion. We view this from the perspective of protecting customer code and data. The first question I often get is who we are protecting it from—usually, we are protecting code and data from other customers and from the cloud provider itself. We call this the first dimension, and Nitro builds mechanisms to protect customer code and data from external access. This has been a fundamental design decision for Nitro.

Let's look back at these protective features. Nitro provides physical separation between the customer's code running on the CPU and our code running primarily on the Nitro Cards. When the system boots, the Nitro Cards equipped with the Nitro Security Chip measure and verify the contents of the server firmware. Only after that do we unlock the server storage and run the customer's instance. We can perform live updates of all software without system downtime. This software is developed by teams distributed around the world, undergoes multi-party code reviews and testing, is cryptographically signed by automated build pipelines, is deployed by a deployment system that defines deployment policies and schedules, is monitored during deployment, and triggers a rollback if an anomaly is detected.

Most importantly, there is no remote access to the hypervisor—there is no SSH server. Only APIs that are encrypted, authenticated, authorized, and logged exist, and these APIs contain no way to access customer content. The second dimension is splitting customer workloads into components with higher and lower levels of trust. This separation limits operator access and protects against data exposure from application bugs. A common example is placing private signing keys inside an Enclave so that even if an application has a bug, it cannot access those keys.

If you have all the protection features of a normal Nitro instance, what do Enclaves provide? It is a separate instance where the parent provides some CPU and memory. The Nitro Hypervisor creates a new VM, and that VM has no persistent storage. It cannot be accessed via SSH, either. It is very restricted and has only a small path to the parent. The parent cannot access the processes running within it. However, the parent can obtain an attestation report for that Enclave, and the Enclave contains a private key, with the attestation report containing the public key.

You can use this to encrypt data sent to the Enclave, and the parent instance cannot access it. This allows you to securely protect your most sensitive data, such as signing keys or PII, within that Enclave.

We recently added several features to Nitro instances. One of them is UEFI Secure Boot. UEFI allows you to boot instances in an immutable way. Customers have been using Secure Boot on-premises, and they requested to use similar functionality on AWS as well. Secure Boot measures the bootloader and the OS, compares those measurements against UEFI variables, and boots the system only if they match. This provides a multi-layered defense against threats that could persist after a reboot, because only software signed with a key registered in the UEFI variables can be booted.

We also added support for a Trusted Platform Module (TPM). We provide a standard TPM 2.0 interface for instances. When an instance boots, measurements are recorded in the TPM. These measurements include platform identification information, which can be used to generate encrypted data. This data can be used to unlock LUKS, BitLocker, or custom applications created by customers.

I have briefly discussed the security of the Nitro System so far, but we have a detailed whitepaper on this topic. We have implemented a unique architecture that limits access to customer data by operators, and we explain the details in this whitepaper. Furthermore, the NCC Group recently conducted an independent architecture review of the Nitro System and confirmed that there is no mechanism for cloud service provider employees to log into the underlying host or access customer content stored on instance storage or EBS volumes.

The Big Picture and EC2 Instance Implementation of the Nitro System

Let's integrate all of this to see the end-to-end big picture. Here, I will use a Graviton4 server as an example. This server can run many VMs or host one or two bare-metal instances. The host has an independent lifecycle and is managed by one of the Nitro Cards. Many people tend to think of the host CPU as the center of the server, but our system completely flips that thinking on its head. The Nitro Card is the center of the system. These cards measure all firmware and verify that what is expected is running before controlling the boot of the host CPU.

Graviton 2 was the first instance in EC2 to implement DRAM encryption. With the release of Graviton4, we extended this encryption to other interfaces as well. The interface between the Graviton4 CPU and the Nitro Card, as well as communications between coherent Graviton4 sockets, are now also newly encrypted.

To summarize all of this, on the left side, we have the EC2 control plane. When you call Start Instances or Run Instances, you communicate with this control plane. Here, there are multiple services that authenticate the request, identify the capacity pool that fits the request size, Availability Zone, and Placement Group, and finally identify the server to host the instance. On the right side, we have the Nitro Cards and Nitro Controllers. In this example, we are running a c8g.24xlarge instance with 1,092GB of RAM and 96 cores.

When you request the creation of an instance to the control plane, the control plane first sends a message to the Nitro Controller to request the allocation of resources for this instance. Then, a message is sent to the Nitro Hypervisor, requesting it to create a shell for an instance with 96 cores and 1,092GB of RAM. Now the resources are reserved. Next, the control plane requests the Nitro Cards to connect basic devices to that instance. This includes storage, networking, ENA devices, and EBS volumes, and those are connected. Now the devices are connected directly to the instance. The Nitro Hypervisor does not intervene and communicates directly with the Nitro Cards. Then, the control plane gives the instruction to boot, and the instance boots up. The firmware finds the EBS volume and starts the operating system, the instance begins execution, and the initialization process completes.

When an instance is running, the configuration looks very similar even in the case of a Metal instance. Actually, it is almost the same here as well. You have the control plane and the Nitro Cards, and the only difference is that the Nitro Hypervisor does not exist. This is because all the features of VPC networking and EBS are built into the Nitro Cards. Whether it is bare metal or a virtual instance, they have the same instances, the same I/O devices, look the same, feel the same, and use the same monitoring features.

And we can also create Mac instances using this same mechanism. There are many developers who want to use Macs to build and sign software for iOS, iPad, and Mac. We wanted to provide the same flexibility and configurability that can be achieved in EC2. So, we used Nitro Controllers, installed a Thunderbolt to PCIe bridge, and connected it to a Mac mini with a Thunderbolt cable. This resulted in an instance that looks the same and feels the same as other instances, while also living in a VPC and taking advantage of EC2's benefits.

Thank you for listening. As we cannot do Q&A using a microphone in this session, I would like to take questions in the hall. Thank you for joining us.

Discussion