EuroBSDCon
Moving TLS encryption from the host CPU to inline network interface cards eliminates the memory bandwidth bottleneck that caps software-based streaming at 240 Gbps.
AI-assisted summary of Serving Netflix Video at 400Gbps on FreeBSD by Drew Gallatin — original source. Check the original for full context.
Source published:
Key ideas
- Netflix reached 380 Gb/s of TLS-encrypted video delivery from a single FreeBSD server powered by an AMD EPYC processor and Mellanox ConnectX-6 Dx NICs, falling just short of the 400 Gb/s wire target. (26:48)
- Software kTLS hit a hard memory bandwidth wall at ~240 Gb/s because each payload byte crosses the memory bus four separate times (storage to RAM, RAM to CPU, CPU to RAM, RAM to NIC), requiring 200 GB/s of bandwidth against a 150 GB/s physical ceiling. (3:45)
- Offloading encryption inline to the NIC bypassed the host CPU memory detour entirely, reducing bus traversals to the equivalent of serving unencrypted video and allowing total output to surge past 300 Gb/s. (16:47)
- Production deployments require dynamic fallback mechanisms because TCP retransmissions force the NIC to re-DMA full TLS records from byte zero to reconstruct cipher state, turning packet loss into a severe PCIe bus penalty. (20:09)
Detailed notes
## Background Presented by Drew Gallatin of Netflix and published by EuroBSDCon on YouTube on September 27, 2021, this conference presentation examines the engineering push to serve TLS-encrypted video at 400 Gb/s from a single FreeBSD server. According to the talk description, Gallatin covers memory bandwidth bottlenecks in software kTLS, PCIe challenges with hardware crypto offload, NUMA topology optimizations, and comparative benchmark results across AMD Rome, AMD Milan, Ampere Altra arm64, and Intel Ice Lake platforms.
## TL;DR Drew Gallatin details Netflix's architectural journey to scale TLS-encrypted video streaming from 200 Gbps up to a 400 Gbps target on single-socket FreeBSD systems. After hitting a 240 Gbps host memory bandwidth ceiling caused by multi-pass software encryption, Netflix transitioned to inline NIC kTLS on Mellanox ConnectX-6 Dx adapters to eliminate the CPU crypto detour and cut memory bus traffic in half. Gallatin recounts overcoming critical production firmware hurdles—including PCIe Relaxed Ordering defects, session thrashing 'tar pits', and TCP retransmission bandwidth penalties—by pairing hardware offload with network-centric NUMA siloing. The resulting optimizations pushed AMD EPYC systems to 380 Gbps while yielding key architectural insights across alternative Ampere Altra arm64 and Intel Ice Lake configurations.
## Atmosphere & style The presentation carries a candid, pragmatic, and refreshingly unvarnished systems engineering tone, marked by seasoned war stories and wry humor. Gallatin eschews corporate gloss to speak directly as an operating system practitioner, openly dissecting frustrating firmware roadblocks like vendor 'tar pits' and locked-down 'BIOSes from hell'. Watching the talk feels like sitting beside a veteran kernel engineer walking through real hardware counter logs, blending rigorous data analysis with genuine excitement for low-level performance tuning and open-source community collaboration.
## Bulletin - [26:48](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1608s) Netflix reached 380 Gb/s of TLS-encrypted video delivery from a single FreeBSD server powered by an AMD EPYC processor and Mellanox ConnectX-6 Dx NICs, falling just short of the 400 Gb/s wire target. - [03:45](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=225s) Software kTLS hit a hard memory bandwidth wall at ~240 Gb/s because each payload byte crosses the memory bus four separate times (storage to RAM, RAM to CPU, CPU to RAM, RAM to NIC), requiring 200 GB/s of bandwidth against a 150 GB/s physical ceiling. - [16:47](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1007s) Offloading encryption inline to the NIC bypassed the host CPU memory detour entirely, reducing bus traversals to the equivalent of serving unencrypted video and allowing total output to surge past 300 Gb/s. - [20:09](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1209s) Production deployments require dynamic fallback mechanisms because TCP retransmissions force the NIC to re-DMA full TLS records from byte zero to reconstruct cipher state, turning packet loss into a severe PCIe bus penalty.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=0s) Netflix aims to maximize single-server efficiency running FreeBSD Current and NGINX to deliver 400 Gb/s of TLS-encrypted video across four 100 GbE interfaces. - [03:45](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=225s) Software kTLS requires 200 GB/s of memory bandwidth to sustain 400 Gb/s of traffic due to four separate memory bus crossings per byte, capping an AMD Rome system at 240 Gb/s. - [06:46](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=406s) Saturating the NUMA interconnect with bulk streaming data acts like highway traffic congestion, delaying urgent cross-domain atomic operations and stalling CPU execution cores. - [10:20](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=620s) Uncoordinated NUMA allocation can force up to four cross-node interconnect traversals per packet, generating up to 200 GB/s of fabric traffic and severely choking throughput. - [12:05](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=725s) Network-centric siloing aligns socket memory, file buffers, and worker threads directly with the incoming NIC port, outperforming disk-centric organization and lifting software kTLS to 280 Gb/s. - [16:47](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1007s) NIC kTLS (hardware inline offload) eliminates the CPU memory detour by having the network card encrypt TLS records directly on transmit across the PCIe bus. - [20:09](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1209s) Handling TCP retransmissions in hardware kTLS incurs a heavy PCIe bandwidth penalty because the NIC must re-DMA the entire TLS record from byte zero to regenerate intermediate cipher state. - [23:17](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1397s) Early ConnectX-6 beta firmware created a 'tar pit' where session state paging across PCIe degraded sustained per-NIC throughput down to 75 Gb/s without triggering health check alerts. - [26:48](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1608s) Fixing PCIe Relaxed Ordering and enabling Mellanox's tls_optimized firmware setting elevated aggregate system delivery to 380 Gb/s at roughly 60% CPU utilization. - [30:24](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1824s) A protective kernel policy that evicts lossy connections exceeding a 1% retransmission threshold to software kTLS caused aggregate throughput to drop from 380 Gb/s to 350 Gb/s. - [34:02](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2042s) Ampere Altra arm64 systems reached 320 Gb/s with hardware kTLS after enabling 8-bit PCIe Extended Tags to increase outstanding in-flight bus transactions. - [37:07](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2227s) Intel Ice Lake testing was constrained by locked firmware knobs preventing relaxed ordering and an artificial processor memory clock clamp to 2933 MHz. - [42:30](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2550s) Netflix rejects full TCP Offload Engines (TOE) to retain complete kernel control over TCP congestion control and transport logic, which is critical for Quality of Experience (QoE). - [44:37](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2677s) FreeBSD's kTLS architecture encapsulates an entire TLS record within a single mbuf, simplifying zero-copy driver handling during TCP packet retransmissions.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=0s) Serving 400 Gbps: Motivation, Workload, and Platform
Drew Gallatin introduces his role at Netflix, where his work focuses directly on CPU efficiency and maximizing the delivery capacity of single-server nodes. He summarizes the overarching mission bluntly: “basically CPU efficiency and trying to serve as many customers as we can from as little hardware as we can, both to save the environment and to save ourselves some costs.” Having spent the preceding period pushing hardware limits, he sets out to explain how close Netflix can get to delivering 400 Gbps of TLS-encrypted traffic out of a single FreeBSD machine. Since 2020, Netflix has deployed production servers capable of serving 200 Gbps of encrypted video. However, those deployed appliances physically house four 100 GbE network interfaces, sparking the engineering effort to determine whether all four could be driven concurrently at full line rate.
The production software stack runs FreeBSD Current (staying within a few weeks of FreeBSD head) and powers the NGINX web server. Netflix serves almost all video content via `sendfile()`, making Kernel TLS (kTLS) an essential design requirement. By handling encryption directly inside the kernel's `sendfile()` pipeline, the system avoids extra boundary crossings where content would otherwise be pulled from storage, transferred into user space for encryption, and then copied back to the kernel. Software kTLS alone yields roughly a 60% savings in CPU utilization.
The core production platform used throughout these benchmarks is built around an AMD EPYC 7502P “Rome” processor featuring 32 cores running at 2.5 GHz. Gallatin notes that conversions between networking units (gigabits per second) and storage/memory bandwidth (gigabytes per second) require tracking an eight-fold factor. The platform includes: - An AMD EPYC 7502P (Rome) 32-core single-socket processor (2.5 GHz). - 8 channels of DDR4-3200 memory, providing 150 GB/s (roughly 1.2 Tbps) of rated memory bandwidth. - 128 PCIe Gen4 lanes, providing approximately 2 Tbps of aggregate I/O throughput. - 2 Mellanox ConnectX-6 Dx network interface cards (NICs), each utilizing a PCIe Gen4 x16 link and providing two 100 GbE ports (for a total of four 100 GbE ports). - An array of PCIe Gen3 NVMe solid-state drives, which were specced prior to the availability of full-speed Gen4 options.
---
[03:45](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=225s) The Memory Bandwidth Wall of Software kTLS
Initial testing on the Rome platform using software kTLS capped server output at approximately 240 Gbps, running straight into a memory bandwidth wall. To prove this ceiling without relying on guesswork, Gallatin tracked memory usage using `amd-pcm` (AMD Processor Counter Monitor), a tool available online that reads system performance counters directly. The measurements confirmed that the machine exhausted its theoretical system memory bandwidth right at 240 Gbps, at which point performance began to collapse.
To illustrate how software encryption devours memory bandwidth, Gallatin maps the end-to-end data lifecycle of a typical client streaming session. When a user streams video, the client-side algorithm issues a request to stay buffered a few megabytes ahead (for instance, requesting the next 2 megabytes). NGINX receives the HTTP request and triggers a `sendfile()` call to fulfill it: 1. **Disk to Memory Read:** The NVMe drives stream raw video data into system memory buffers (aggregating 50 GB/s to sustain a 400 Gbps network pipe). 2. **Memory to CPU Read:** The CPU pulls the data out of the page cache to perform encryption. Gallatin notes an important structural constraint: file data cannot be encrypted in-place. If an in-place transformation occurred on a shared page cache buffer, a subsequent stream to another client would be double-encrypted with mismatched keys, producing garbled data. Consequently, the CPU must allocate a separate kTLS crypto buffer. 3. **CPU to Memory Write:** The encrypted ciphertext is written back into memory at 50 GB/s. 4. **Memory to NIC DMA:** The network interface card reads the encrypted buffer across the memory bus via DMA to push it onto the wire at 50 GB/s.
Because each byte traverses the memory bus four separate times, sustaining a target wire speed of 400 Gbps (50 GB/s) requires a staggering 200 GB/s (1.6 Tbps) of aggregate memory bandwidth—far exceeding the platform's 150 GB/s physical memory limit.
```mermaid flowchart TD accTitle: Memory Bandwidth Multiplier in Software kTLS accDescr: Diagram tracing the four memory crossings required to serve and encrypt file data via software kTLS.
subgraph Storage["NVMe Storage"] D["NVMe SSDs"] end
subgraph Memory["Host Memory (RAM)"] PC["Page Cache Buffer"] CB["TLS Crypto Buffer"] end
subgraph Compute["Host Processor"] CPU["CPU Core (Crypto Engine)"] end
subgraph Network["Network Interface"] NIC["Mellanox ConnectX-6 Dx (Wire)"] end
D -->|"1. DMA Read (50 GB/s)"| PC PC -->|"2. Read to Core (50 GB/s)"| CPU CPU -->|"3. Write Ciphertext (50 GB/s)"| CB CB -->|"4. DMA to NIC (50 GB/s)"| NIC ```
---
[06:46](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=406s) NUMA Topologies and Interconnect Bottlenecks
Facing memory bandwidth exhaustion in flat memory configurations, Gallatin explored whether non-uniform memory architecture (NUMA) tuning could extract more performance. AMD EPYC platforms allow configuring memory controllers in different NUMA topologies. Public STREAM benchmark results show that running Rome in a standard flat configuration yields around 150 GB/s, whereas partitioning the socket into four nodes per socket (NPS4) improves memory controller efficiency and pushes STREAM bandwidth up to roughly 175 GB/s.
Gallatin recaps NUMA fundamentals: in early symmetric multiprocessing systems, CPUs, memory, and devices were uniformly spaced, meaning software could treat all memory locations identically without latency or throughput variations. However, hardware scaling limits forced designers toward a "divide-and-conquer" approach, interconnecting distinct nodes via a dedicated NUMA bus. When a CPU, memory, storage device, and NIC remain within their local domain, transactions operate at full local speed; crossing the interconnect imposes latency and bandwidth penalties.
On AMD EPYC Rome processors, operating in the most efficient NPS4 mode multiplies the topology into four fully interconnected NUMA domains within a single physical socket. Gallatin explains that these interconnect paths are not without cost: - Inter-domain latency penalties range from 12 to 28 nanoseconds depending on the specific link traversed. - Individual interconnect links are limited to roughly 47 GB/s, with an aggregate interconnect ceiling of about 280 GB/s across the system.
Gallatin outlines his foundational architectural strategy: “Basically, the strategy that I came up with a few years ago is to keep as much of our bulk data off the NUMA fabric as we can.” He uses a highway analogy, warning that allowing high-volume bulk video data to flood the NUMA links acts like filling every lane with tractor-trailers, crowding out the agile commuter traffic. When the NUMA fabric is saturated with bulk stream transfers, urgent low-latency transactions—such as cross-domain atomic counter updates or process synchronization reads—get blocked behind bulk transfers, stalling CPU execution cores while they wait for simple cache lines to clear the bus.
[10:20](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=620s) The NUMA Worst-Case Routing Scenario
Drew Gallatin walks through the catastrophic performance penalties incurred when a multi-node NUMA architecture is left unoptimized. In the worst-case scenario, an incoming client request lands on a network interface card attached to a specific NUMA node (such as the lower-left node). If the media content resides elsewhere, the operating system issues a read request to the storage drive, but foolish memory allocation choices place that buffer on a completely different node (the upper-right node). Because memory was allocated across domains rather than locally, the transaction crosses the interconnect fabric for the first time.
Next, a CPU must read that plaintext data out of memory to perform software TLS encryption. Instead of picking a CPU co-located on the same node, an uncoordinated scheduler picks a core residing on the lower-right node, forcing the data across the NUMA bus a second time. Once encrypted, the resulting ciphertext must be written into an allocated destination crypto buffer. Making another suboptimal placement decision places this buffer on the upper-left node, requiring a third traversal across the interconnect. Finally, when the packet is transmitted out to the client via the original NIC in the lower-left node, the data crosses the NUMA bus a fourth time.
```mermaid flowchart TD accTitle: Unoptimized Software TLS NUMA Traversal accDescr: Shows the four consecutive cross-NUMA bus traversals caused by uncoordinated memory, CPU, and NIC placement.
subgraph NodeLL["Node 0 (Lower Left)"] NIC_IN["Incoming NIC Request"] NIC_OUT["Outgoing NIC Transmit"] end
subgraph NodeUR["Node 1 (Upper Right)"] BufIn["Read Buffer (Plaintext)"] end
subgraph NodeLR["Node 2 (Lower Right)"] CPU_Enc["CPU Encryption Engine"] end
subgraph NodeUL["Node 3 (Upper Left)"] BufCrypto["Destination Crypto Buffer"] end
NIC_IN -->|"Crossing 1: Disk DMA to Remote RAM"| BufIn BufIn -->|"Crossing 2: Plaintext read by Remote CPU"| CPU_Enc CPU_Enc -->|"Crossing 3: Ciphertext written to Remote RAM"| BufCrypto BufCrypto -->|"Crossing 4: DMA read by Remote NIC"| NIC_OUT ```
These compounding round trips severely choke system throughput. Gallatin points out that routing 50 GB/s of data across the interconnect four times pumps 200 GB/s across the bus: “and that's pretty close to the aggregate fabric bandwidth and that causes the fabric to congest and that's uh that's bad.” In an ideal setup, execution stays entirely confined to the local node where the request entered, leading to zero NUMA bus crossings and zero fabric congestion.
[12:05](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=725s) Network-Centric Siloing with FreeBSD and LACP
To reconcile the theoretical ideal of zero crossings with operational realities, Netflix faced structural constraints: each serving appliance operates with only a single IP address and uses LACP (Link Aggregation Control Protocol) bonding across its interfaces. When using LACP, upstream switch link partners hash client flows—typically based on TCP source/destination ports and IP addresses—to shard traffic consistently across the physical links. As long as the link aggregation group (LAG) remains stable without flapping, incoming packets for any given TCP connection always arrive on the exact same physical NIC.
Faced with this behavior, Gallatin evaluated two architectural models: "disk-centric siloing," which organizes processing around where the content physically resides on storage, and "network-centric siloing," which organizes processing around the NIC port where the connection arrives. After pursuing both concepts, Gallatin concluded that network-centric siloing is dramatically superior: “and i believe that network-centric siloing is by far the best way to go.” Under this paradigm, FreeBSD allocates socket memory and network connections with strict affinity to the NUMA node tied to the receiving NIC. Buffers backing media files read from disk are allocated in the local node's memory, crypto buffers are kept local, and TLS worker threads, TCP pacers, and TCP timers are bound with local domain affinity before transmitting back out via the local NIC. All of this infrastructure was contributed directly upstream into the FreeBSD kernel.
- LACP flow hashing relies on TCP 4-tuples (IP addresses and ports), providing stable flow-to-NIC routing. - Media read buffers are populated by DMA directly into memory local to the handling NIC. - TLS crypto workers, TCP timers, and pacing mechanisms run bound to the local NUMA domain. - All optimizations were committed directly upstream to the FreeBSD codebase (FreeBSD 13 / CURRENT).
[13:49](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=829s) Physical Constraints and Real-World NUMA Gains
Applying network-centric siloing to the worst-case scenario produces an immediate architectural improvement. When a connection enters on the lower-left node and requests content stored on a disk attached to the right side, the kernel allocates a local destination buffer on the lower-left node for the storage read, crossing the interconnect only once during disk DMA. Once in local memory, a local CPU performs the TLS encryption, writes the ciphertext into a locally allocated crypto buffer, and hands the packet to the local NIC. Instead of crossing the bus four times, the data traverses the fabric exactly once, dropping fabric load from 200 GB/s down to 50 GB/s.
However, hardware topologies disrupt this clean abstraction. The server contains four NUMA domains but only two dual-port 100GbE NICs (providing a total of 400 Gbps of network bandwidth). Because high-speed NICs are expensive and additional cards would be redundant, two of the four NUMA domains are left without a physical NIC. Gallatin developed kernel workarounds to assign network affinity to non-NIC nodes, but this structural asymmetry reintroduces cross-node hops: - In the worst case, outgoing packets must traverse the interconnect to reach an available physical NIC in another domain, bringing the worst-case bus load to 100 GB/s (two crossings). - In the average case, with four nodes, there is a 75% chance (3 in 4) that the requested disk content resides on a remote node. - With only two NICs distributed across four domains, there is a 50% chance that transmission requires traversing the fabric to reach an active NIC. - Combined, these probabilities average out to approximately 62.5 GB/s of data across the NUMA fabric.
While significantly better than the unoptimized 200 GB/s baseline, the performance impact on network throughput fell short of expectations: “it was no panacea but it gets us from about 240 to about 280 which is you know better than nothing but still you know not anywhere near our goals that might uh you know make it worth letting up a third link but definitely not lighting up all four links.”
[16:47](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1007s) Eliminating the CPU Detour with NIC kTLS
Hitting the ~280 Gbps ceiling made it obvious that optimizing software-based memory placement was not enough; the core bottleneck lay in the memory bandwidth devoured by TLS encryption itself. Gallatin notes that whether software encryption is executed by the host CPU or offloaded to a look-aside accelerator (such as Intel QAT or a Chelsio CCR card), the underlying limitation remains identical: plaintext must be read out of main memory and the resulting ciphertext written back. By eliminating this memory round trip, system memory bandwidth requirements are immediately cut in half. The data path reverts to the efficiency of serving unencrypted video—streaming straight from NVMe storage into main memory and directly out through the NICs without CPU intervention.
To achieve this, Netflix shifted to NIC kTLS (commonly referred to elsewhere as hardware inline TLS). Under this model, the initial TLS handshake and session negotiation still occur in user space, but once session keys are installed in the kernel, the kernel hands off crypto responsibility directly to the NIC. The network card encrypts TLS records on the fly as data streams across the PCIe bus during packet transmission:
> “so the tls records are encrypted by the nick as the data flows through it on transmit so the positive thing is there's no more detour through the cpu for crypto and we uh and we've reduced our memory bandwidth requirements”
Gallatin acknowledges an architectural tradeoff that may concern security teams: plaintext leaves main memory and traverses the PCIe bus in the clear, whereas traditional user-space TLS keeps payload data encrypted across all internal buses. For Netflix's content distribution workload, however, this exposure is perfectly acceptable.
For hardware enforcement, Netflix selected the Mellanox ConnectX-6 Dx, which provides inline cryptographic offload for both TLS 1.2 and TLS 1.3 using AES-GCM—the dominant cipher on the public web. A crucial operational feature of the ConnectX-6 Dx is its ability to retain cryptographic state within an in-flight TLS record. If the TCP stack sends the first few segments of a TLS record and must pause while waiting for client ACKs, the NIC preserves the cipher state across milliseconds or seconds. When the ACK arrives, TCP resumes transmission mid-record seamlessly. The only expensive exception occurs during out-of-order transmissions, such as TCP packet loss retransmissions, where the NIC no longer holds the state for that arbitrary historical point in the TCP stream and must perform extra processing to reconstruct context.
[20:09](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1209s) Hardware kTLS: Normal Transmit vs. Retransmit Behavior
Drew Gallatin explains the internal mechanics of hardware-offloaded kernel TLS (inline kTLS) using a diagram of host memory, the PCI Express bus, the network interface card (NIC), and a 100 GbE network. In host memory, an unencrypted TLS record sits inside the socket buffer, demarcated by TCP segment boundaries at byte offsets such as 0, 1448, 2896, and so forth. Under normal transmission, TCP informs the NIC that it wants to send the first few segments of a packet. The NIC then performs direct memory access (DMA) across the PCIe bus to fetch the plaintext data down to the adapter. Gallatin notes that how the NIC organizes this internally is completely abstracted from the operating system:
> “It may do something smarter than this; I don’t know how their NIC works, it may, you know, DMA 4K at a time, it may DMA the individual segments, I have no idea; it’s all hidden from us, but the NIC DMAs the plaintext data down, it encrypts it in the NIC, and then it sends it out on the wire.”
As TCP receives subsequent ACKs and more window space frees up, the stack requests transmission of the remaining segments. The NIC simply DMAs the next chunks, encrypts them on the card, and pushes them out onto the wire. It requires no redundant work when pausing and resuming in the middle of a TLS record; it handles full or partial segments seamlessly.
```mermaid flowchart TD accTitle: Hardware kTLS Transmit vs Retransmit Flow accDescr: Diagram illustrating normal segment transmission versus the full-record DMA penalty required for TCP retransmissions.
subgraph Normal ["Normal Transmission"] direction LR A1["TCP Requests Segments"] --> B1["NIC DMAs Requested Segments"] B1 --> C1["NIC Encrypts on Adapter"] C1 --> D1["Packets Sent to Wire"] end
subgraph Retransmit ["TCP Retransmission Handling"] direction LR A2["Packet Loss / SACK Received"] --> B2["NIC Must Reconstruct State"] B2 --> C2["DMA ENTIRE Record from Byte 0"] C2 --> D2["Encrypt Record up to Target Offset"] D2 --> E2["Encrypt & Transmit Target Segment"] end ```
However, TCP retransmissions break this clean flow entirely. If a client on a flaky connection drops a single segment (e.g., at the 14K offset) and returns a SACK, TCP must retransmit that specific segment. One might expect the NIC to simply DMA that single segment down, encrypt it, and send it. Instead, because the NIC no longer retains the running cipher state for that arbitrary intermediate position in the TCP stream, it must DMA the entire TLS record from byte zero all the way down to the NIC. The card then re-encrypts all the preceding data strictly to regenerate the required crypto state, encrypts the single requested segment, and finally places it on the wire. Gallatin warns that this structural behavior creates an enormous PCIe bandwidth penalty:
> “So that’s a little bit painful, and that means that we have to watch out for TCP re-transmissions because they could easily run us out of PCI Express bandwidth.”
---
[23:17](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1397s) Mellanox ConnectX-6 Firmware Issues and the "Tar Pit"
Turning from theoretical mechanics to operational "war stories," Gallatin reviews early evaluations of Mellanox ConnectX-6 hardware TLS offload using pre-pandemic beta firmware. While the adapter initially demonstrated an impressive peak throughput of roughly 250 Gb/s aggregate across the system, sustained real-world performance collapsed under production conditions. Netflix edge servers manage traffic distribution via an internal health mechanism powered by a PID controller, which monitors signals like network adapter capacity, CPU saturation, and disk utilization. Because CPU load remained exceptionally low and the network interface reported plenty of headroom, the server continuously reported itself as healthy, requesting more sessions from upstream steering systems.
As connection counts climbed, the NIC's throughput throttled downward until it bottomed out at a meager 75 Gb/s per NIC (150 Gb/s per dual-NIC system). Gallatin illustrates the resulting operational failure mode:
> “As more and more connections arrived, the NIC slowed down more and more, and so we wound up at a floor of about 75 gigs a NIC or 150 gigs per system, and we just kept attracting more and more and more clients and it sort of turned into a tar pit, because this kind of limit is invisible to our PID controller.”
Without an explicit metric signaling this hardware throttling to the control loop, the machine trapped incoming traffic without being able to serve it at rate. Consequently, Netflix deemed this early inline TLS implementation unusable for deployment.
---
[24:48](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1488s) Investigating Session Scalability and PCIe Relaxed Ordering
Gallatin diagnosed the throughput collapse by analyzing session footprint and adapter memory management. Because the NIC successfully resumes encryption mid-record during standard streaming, it undeniably stores per-connection TLS state. However, Netflix operates at massive scale: every viewing client holds anywhere from one to six concurrent video connections (with buggy client implementations occasionally opening tens or hundreds), alongside dedicated TCP streams for audio and subtitles. Delivering 400 Gb/s demands supporting approximately 400,000 active sessions.
Gallatin suspected that the NIC was running out of on-board memory and thrashing host memory. The Mellanox driver allocates host memory regions on the card's behalf, which the adapter accesses autonomously via DMA. When the number of active sessions exceeds the NIC's local SRAM/DRAM capacity, the card must page session state back and forth across PCIe, decimating throughput. To address this, AMD suggested enabling PCIe Relaxed Ordering, an architectural feature allowing non-dependent PCIe transactions to bypass one another in flight to alleviate bus serialization during state paging. Although Netflix enabled the feature in configuration space, it provided zero performance uplift. Gallatin later discovered why:
> “Later we found out that the ConnectX-6 firmware, even though you could toggle that bit in PCI config space, it didn’t actually—wasn’t actually connected to anything and nothing actually happened because it was hardcoded off.”
---
[26:38](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1598s) Firmware Breakthroughs: Reaching 380 Gb/s
Eventually, Mellanox delivered updated firmware that genuinely implemented PCIe Relaxed Ordering alongside other internal refinements. The difference was immediate and substantial: sustained bandwidth jumped to 160 Gb/s per NIC, achieving 320 Gb/s total system throughput with parity between peak and sustained traffic. The server no longer degraded into a tar pit under real workloads. For context, while a single adapter using software kTLS could push 190 Gb/s in isolation, host memory bandwidth constraints prevented two adapters from running at that speed simultaneously. Achieving 320 Gb/s aggregate from dual NICs via hardware offload established a brand-new throughput record for Netflix's delivery fleet.
Performance improved even further several months later with a production firmware release introducing an opaque setting:
> “A few months later, they surprised us with a new production firmware which had a knob called `tls_optimized`—I still don’t know what that does except it makes things much better—and now we get 190 gigabits per second a NIC, or 380 gigabits a second total.”
- **Beta Firmware (Pre-Pandemic):** Peaked at ~250 Gb/s; collapsed under load to a sustained 75 Gb/s per NIC (150 Gb/s total) due to unassisted state paging across PCIe. - **Working Relaxed Ordering Firmware:** Delivered 160 Gb/s per NIC (320 Gb/s total) with stable sustained throughput. - **Production Firmware (`tls_optimized`):** Delivered 190 Gb/s per NIC, hitting 380 Gb/s total system throughput.
---
[28:03](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1683s) Quality of Experience (QoE) and Retransmit Defense Strategies
Despite achieving 380 Gb/s, Netflix could not deploy the technology immediately without rigorous Quality of Experience (QoE) validation. Gallatin emphasizes that raw throughput is meaningless if customer-facing playback degrades. Netflix systematically tracks playback metrics, including: - Rebuffer rate (the frequency of the buffering spinner during streaming). - Time-to-play (the latency between pressing "Play" and video playback beginning). - Time-to-quality (the time required for video resolution to ramp up to decent or excellent fidelity).
Gallatin contrasts the ConnectX-6 results against an earlier hardware TLS NIC evaluation. That earlier adapter lacked the ability to resume crypto state mid-record, requiring FreeBSD developer Randall Stewart to heavily hack the kernel TCP stack to make it TLS-record-boundary aware and force it to segment traffic exclusively along crypto boundaries. That adaptation caused severe QoE degradation, forcing Netflix to abandon the earlier card. In contrast, because the ConnectX-6 cleanly resumes state mid-stream, initial QoE metrics were completely solid, warranting a larger fleet-wide canary deployment.
Finally, before enabling the offload at scale, Netflix had to mitigate the retransmission amplification vulnerability. Because resending dropped segments forces the NIC to DMA an entire TLS record over PCIe just to recreate cipher state, a lossy connection functions essentially as an accidental amplification attack against internal host PCIe bandwidth. To protect system stability, Gallatin outlines their defense strategy: the kernel monitors retransmitted bytes across all active flows, and whenever an individual connection on a lossy path exceeds an acceptable retransmission threshold, the stack dynamically evicts that connection from hardware offload and transitions it back to software kTLS.
[30:24](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1824s) Mixed Hardware and Software Fallback Penalties
Addressing edge cases and potential exploits, Drew Gallatin explains that the system monitors retransmitted segments in addition to raw byte counts. If a clever attacker requests retransmissions of many tiny segments rather than large byte volumes, the network interface card would still be forced to repeatedly re-DMA all those descriptors and buffers. To prevent this resource drain, Gallatin points out that the kernel enforces strict limits: “and in that case we'll probably kill the connect we kill the connections rather than moving them to software since it's pretty clear it's an attack”.
When evaluating regular traffic with the safety mechanism enabled—moving any TCP connection with more than 1% retransmitted bytes from hardware offload to software encryption—Drew observes an unexpectedly severe performance penalty. This threshold shifts roughly 25% to 33% of active connections into software, causing the maximum stable bandwidth to plunge from 380 Gb/s down to 350 Gb/s. Puzzled by the steep drop, he emphasizes: “just a third of the connections really shouldn't be putting that much stress on the system and remember memory bandwidth looks fine the i the the latency the dma latency looks fine i just don't understand why it's as bad as it is”.
```mermaid flowchart LR accTitle: Connection Handling and Fallback Path accDescr: Flowchart illustrating how TCP connections are evaluated and routed between hardware offload, software fallback, and termination.
subgraph Evaluation ["Connection Inspection"] TCP["Active TCP Connection"] --> Retx{"Retransmission Check"} end
subgraph Actions ["Action Taken"] Retx -->|"≤ 1% Retransmit"| HW["Hardware kTLS Offload\n(Up to 380 Gb/s)"] Retx -->|"> 1% Retransmit"| SW["Software kTLS Fallback\n(Drops total to 350 Gb/s)"] Retx -->|"Segment Flooding Attack"| Kill["Terminate Connection"] end ```
[31:33](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1893s) Combining Kernel TLS with NUMA Optimizations
Drew describes merging Kernel TLS with NUMA optimizations as a classic “you put your chocolate in my peanut butter kind of moment if you remember those ads from the 80s.” When hardware kTLS is combined with a NUMA topology, the system architecture simplifies dramatically. Previously, data residing on a remote node had to be fetched across interconnects into local memory, processed by the CPU for software encryption, and then shipped over to the NIC. With inline hardware TLS, that entire intermediate crypto detour through local host memory vanishes completely.
In practice, because network cards cannot be installed on every single NUMA node, the worst-case and average-case interconnect crossings remain similar to the non-offloaded setup whenever data must cross over to the NIC on an adjacent node. However, cutting out the software encryption pass saves immense host memory bandwidth:
```mermaid flowchart TD accTitle: NUMA Data Path with Hardware kTLS accDescr: Data flow showing direct DMA from remote memory to NIC bypassing host crypto.
subgraph NodeB ["Remote NUMA Node"] PageCache["File Data in Page Cache"] end
subgraph NodeA ["Local NUMA Node with NIC"] NIC["Mellanox 200GbE NIC\n(Hardware Crypto Engine)"] end
PageCache -->|"Direct PCIe DMA\n(No CPU crypto detour)"| NIC NIC --> Out["Encrypted TLS Packets Out"] ```
Drew presents an “eye chart” summarizing the performance numbers achieved across the AMD configurations: - **Software kTLS (Flat topology):** 240 Gb/s at ~80% CPU utilization (memory bandwidth saturated). - **Software kTLS + NUMA:** 280 Gb/s at ~80% CPU utilization. - **Hardware kTLS (Flat topology, 1 node/socket):** 380 Gb/s at ~60% CPU utilization. - **Hardware kTLS + NUMA:** 380 Gb/s, but CPU utilization drops to just over 50%. - **Hardware kTLS (Flat topology + 1% retransmission fallback safety belt):** 350 Gb/s at high-60% to low-70% CPU utilization.
[34:02](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2042s) Alternative Platforms: Ampere Altra (arm64)
With about ten minutes remaining, Gallatin turns to alternative platforms evaluated for 400 Gb/s serving, starting with the Ampere Altra—an 80-core ARM Neoverse N1 processor clocked at 3.0 GHz. On paper, the Ampere closely mirrors the AMD EPYC platform, featuring 8 DDR4 memory channels, identical memory capacity, comparable PCIe lane counts, and identical NVMe storage and dual-Mellanox networking. However, switching to a brand-new architecture brought diagnostic challenges on FreeBSD because Drew lacked the established performance counter profiling tools, memory bandwidth monitors, and I/O bus analyzers available on x86, which made him feel like he was “kind of driving blind.”
Initial software kTLS performance on the Ampere Altra was surprisingly sluggish, hovering around 120 to 140 Gb/s. Mark Johnston resolved this bottleneck by implementing a UMA (Universal Memory Allocator) cache zone dedicated to caching 16 KB contiguous TLS crypto destination buffers: “mark johnson uh came up with an idea which is brilliant and which i kick myself for not thinking of but all brilliant ideas are obvious in hindsight and he came up with the idea of using a uma cash zone to cash 16k contiguous tls crypto destination buffers and once we did that we got up to about 180 gigabits a second”.
Moving to hardware kTLS on Ampere immediately hit a PCIe wall at 240 Gb/s with CPU usage sitting at a remarkably low 20%, accompanied by output packet drops on the saturated NICs. Gallatin discovered that PCIe Extended Tags were disabled by default on FreeBSD on the Ampere platform: - PCIe behaves like a network: increasing the tag space is analogous to opening the TCP window, allowing more outstanding transactions in flight. - Standard PCIe default provides a 5-bit tag space (32 outstanding tags). - Enabling PCIe Extended Tags expands the tag space to 8 bits (256 tags). - Once extended tags were turned on, Ampere hardware kTLS bandwidth jumped from 240 Gb/s to 320 Gb/s.
[37:07](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2227s) Alternative Platforms: Intel Ice Lake Xeon
The final evaluation platform discussed is an Intel Ice Lake Xeon system, which had arrived in the lab just the prior week. Bringing it up was prolonged by storage architecture constraints: the Ice Lake CPU only provides 64 PCIe Gen4 lanes. To achieve full storage throughput without resorting to a massive number of Gen3 drives, Netflix had to source native Gen4 NVMe drives (deploying twenty 4 TB Kioxia NVMe drives) or rely on PCIe switches that exhibited odd hardware bugs.
Drew highlights an aggravating memory frequency limitation on this specific Intel processor model: while populated with DDR4-3200 memory across eight channels, the SKU artificially clamps memory clock speeds to 2933 MHz. Expressing his frustration with artificial market segmentation, he notes: “i personally hate that i wish intel ran all their memory at the same speed like everybody else does across across their product lines but it is what it is”. - **Software kTLS on Intel Ice Lake:** Bottlenecked strictly by memory bandwidth at ~230 Gb/s (scaling directly in line with AMD flat mode adjusted for lower memory frequency). - **Hardware kTLS on Intel Ice Lake:** Could not be benchmarked cleanly. The system shipped with what Gallatin calls the “BIOS from hell,” which locked down crucial PCIe tuning knobs. A firmware fix delivered to enable PCIe relaxed ordering failed to take effect, leaving no verified hardware kTLS figures to present.
| Architecture / Platform | Software kTLS Bandwidth | Hardware kTLS Bandwidth | Primary Bottlenecks / Notes | |:--- |:--- |:--- |:--- | | **AMD EPYC (Rome/Milan)** | ~280 Gb/s | ~380 Gb/s | Memory bus saturated on SW; PCIe limits on HW | | **Ampere Altra (arm64)** | ~180 Gb/s | ~320 Gb/s | Required UMA 16KB cache; required 8-bit PCIe extended tags | | **Intel Ice Lake Xeon** | ~230 Gb/s | Not available | Clamped to DDR4-2933; restricted by locked-down server BIOS |
[39:30](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2370s) Teasing 800 Gb/s and Community Acknowledgments
Drew shares that Netflix had already built an 800 Gb/s prototype server, intending to unveil its benchmark numbers at the conference. However, severe storms across the United States disrupted freight logistics, preventing the machine from reaching the data center in time to be racked and tested. He quips that he hopes to return the following year to present data on pushing 800 Gb/s out of FreeBSD.
Closing out the session, Drew expresses deep gratitude to his colleagues and FreeBSD open-source collaborators: - **Warren Harrop** at Netflix, who designs and builds prototype content delivery hardware: “warren haroop uh he's one of the people that works on new hardware netflix and is in charge of building a lot of his prototypes and so he's like my santa claus and brings me all my new toys”. - **Mark Johnston**, for foundational work on FreeBSD NUMA optimizations, the virtual memory (VM) subsystem, and Kernel TLS buffer handling. - **John Baldwin**, for the extensive effort of upstreaming kTLS into FreeBSD and collaborating with hardware vendors to design standard kernel/NIC offload interfaces. - **Jeff Roberson**, for his sustained core architectural contributions to FreeBSD's NUMA subsystem.
Reflecting on the collective effort, Drew concludes: “i don't intend to slight anybody but i just love working in the community and every everything that uh everything that we've done is a collaboration”. With a few minutes left on the clock, he opens the floor to audience questions.
[40:56](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2456s) NIC kTLS Support, NFS over TLS, and PCIe Switch Bandwidth Anomalies
The session transitions into the audience Q&A, with Drew Gallatin navigating to the shared notes tab to address viewer questions directly. The first inquiry addresses whether NIC-based kernel TLS (NIC kTLS) is currently available in the FreeBSD development stream. Drew confirms that NIC kTLS is present in FreeBSD-CURRENT and believes it is also available in FreeBSD 13. However, support remains constrained by hardware driver enablement; within FreeBSD, the only network interface controllers capable of hardware kTLS offload are the Mellanox ConnectX-6 Dx and Chelsio T6 adapters. When asked about performance figures for NFS over TLS, Drew demurs, noting that evaluating that subsystem would require consulting FreeBSD developer Rick Macklem.
The discussion turns to system topology and whether Netflix employs PLX PCIe switches to bridge PCIe Gen 3 storage devices to PCIe Gen 4 root complexes. Drew recalls that they were using Broadcom switches—musing briefly over whether Broadcom acquired PLX—and recounts significant debugging hurdles with switch throughput. In configurations bridging a PCIe Gen 4 x8 upstream link down to four PCIe Gen 3 x4 NVMe SSDs, the hardware exhibited severe throughput anomalies. If only one or two Gen 3 x4 drives were actively transferring, performance matched expectations. However, as soon as more than two drives became active simultaneously, the switch links appeared to degrade to aggregate PCIe Gen 3 bandwidths. These switch quirks proved particularly troublesome when attempting to engineer dense storage appliances constrained to 64 PCIe lanes.
- NIC hardware kTLS offload in FreeBSD is supported exclusively on Mellanox ConnectX-6 Dx and Chelsio T6 adapters. - PCIe switch topologies linking Gen 4 x8 upstreams to four Gen 3 x4 endpoints experienced aggregate bandwidth regressions down to Gen 3 speeds whenever three or more drives were active concurrently. - Storage performance under NFS over TLS is spearheaded within the FreeBSD community by Rick Macklem.
---
[42:30](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2550s) Full TCP Offload vs. In-House Protocol Tuning, Flow Limits, and Encryption
Drew addresses whether higher-clocked consumer or client-grade DDR memory would help elevate AMD Infinity Fabric throughput. While Infinity Fabric clocking has its own architectural limits, faster memory would directly alleviate memory bandwidth bottlenecks, with Drew remarking that he used to overclock memory on server platforms years ago. Responding to a question about total TCP offload engines (TOE), Drew explains why Netflix deliberately rejects hardware TCP offloading. Netflix maintains an entire transport protocol engineering team—featuring protocol architects like Randall Stewart and Lawrence Stewart (clarifying with a laugh that they are of “no relation”)—focused exclusively on network stack and congestion control innovation. As Drew emphasizes:
> “We one of the things that we depend on is to to control every aspect of the TCP stack and that's what allows us to give such good QoE to our customers.”
Turning to NIC connection scale, Drew discusses hardware session limits. Although he estimates the Mellanox adapter capacity at roughly 128,000 active hardware TLS flows per port, he points out that exceeding this limit does not result in dropped packets or connection failures. If the NIC flow table overflows, the connection simply bypasses hardware crypto and falls back seamlessly to software kTLS on the host CPU. Regarding data encryption on disk, Drew clarifies that stored video assets carry digital rights management (DRM) encryption applied upstream during cloud encoding, but the underlying storage drives utilize no additional layer of drive-level encryption at rest. Finally, regarding network load balancing, Netflix does not steer traffic toward specific NUMA-aligned NIC ports; the servers simply accept the hashing and port selection decisions determined by the upstream switch link partner via LACP.
```mermaid flowchart TD accTitle: TLS Session Handling and Hardware Fallback accDescr: Flowchart illustrating how a TLS connection is routed to hardware offload or falls back to host CPU processing upon flow table exhaustion. subgraph SessionSetup["TLS Session Setup"] A["New Video Stream Connection"] --> B{"NIC Flow Table Space Available?<br/>(~128,000 flows/port)"} end subgraph ExecutionPath["Processing Paths"] B -->|"Slot Available"| C["Hardware kTLS Offload<br/>(ConnectX-6 Dx / Chelsio T6)"] B -->|"Flow Table Full"| D["Software kTLS Fallback<br/>(Host CPU AES-GCM)"] C --> E["mbuf Chain with Full Record Context"] E --> F["Zero-Copy NIC Transmit & Retransmit"] end ```
- Netflix relies entirely on in-house FreeBSD TCP stack customization to optimize streaming Quality of Experience (QoE), ruling out commercial TCP Offload Engines (TOE). - Hardware kTLS flow capacity is estimated at 128,000 sessions per port; overflowing connections gracefully downgrade to software AES-GCM processing. - Content files carry application-level DRM encryption negotiated between cloud encoders and client devices, with no secondary filesystem-level encryption at rest. - Network interface distribution relies strictly on external switch LACP hashing rather than host-directed link steering.
---
[44:37](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=2677s) Performance Monitoring with nstat, FPGA Power Penalties, and FreeBSD's mbuf Advantage
Asked about his methodology for capturing CPU utilization and performance stalls, Drew explains that rather than relying on standard utilities like `vmstat`, he developed a custom tool named `nstat`, which is published in the FreeBSD ports tree. When coupled with Intel PCM (Processor Counter Monitor), `nstat` aggregates system metrics into a single real-time console line, reporting memory bandwidth, core CPU consumption, active TCP connections, interface throughput, context switch rates, and hardware interrupt frequencies.
When queried about Xilinx SmartNICs, Drew notes that Xilinx typically implies FPGA-based logic, whereas Netflix targets ASIC-based adapters due to thermal and power constraints. To illustrate the issue, Drew describes evaluating a prototype TLS offload NIC equipped with an FPGA and 40 to 64 gigabytes of onboard RAM. The massive onboard buffer allowed the adapter to cache transmitted video segments and handle TCP retransmissions entirely on-card without host interaction. While the feature worked well architecturally, its power draw was untenable, with Drew observing:
> “The NIC burned as much power as the rest of the system so it was just not a really good fit for us.”
Drew concludes by contrasting FreeBSD’s kernel architecture with other operating systems. When he initially architected FreeBSD’s kernel TLS subsystem, he explicitly anticipated NIC-based TLS offload. Consequently, he structured FreeBSD's network memory buffers (`mbufs`) so that a single `mbuf` encapsulates an entire TLS record. This unified structural mapping allows network device drivers to perform TCP retransmissions effortlessly, as the driver can locate the complete record context directly within that single `mbuf` without having to reconstruct fragmented crypto state across the operating system boundary. With no further questions in the queue, Drew thanks the audience and concludes the presentation.
- Drew’s `nstat` tool (available in FreeBSD ports) gathers CPU usage, Intel PCM memory bandwidth, network throughput, TCP sessions, interrupts, and context switches into a unified display. - An experimental FPGA-based TLS offload NIC featuring 40–64 GB of onboard packet cache eliminated host-side TCP retransmissions but drew approximately as much power as the entire host server combined. - FreeBSD's kTLS subsystem was architected so that a single `mbuf` encapsulates an entire TLS record, significantly simplifying driver logic during TCP packet retransmissions compared to alternative OS designs.
## Notable quotes > [06:46](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=406s) Basically, the strategy that I came up with a few years ago is to keep as much of our bulk data off the NUMA fabric as we can. — Drew Gallatin
> [20:09](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=1209s) we have to watch out for TCP re-transmissions because they could easily run us out of PCI Express bandwidth. — Drew Gallatin
> [12:05](https://www.youtube.com/watch?v=_o-HcG8QxPc&t=725s) i believe that network-centric siloing is by far the best way to go. — Drew Gallatin
## Mentioned Drew Gallatin, Netflix, FreeBSD, NGINX, AMD, EPYC 7502P, Mellanox, ConnectX-6 Dx, STREAM, Chelsio, Intel, Ampere Altra, Mark Johnston, John Baldwin, Jeff Roberson, Warren Harrop, Randall Stewart, Lawrence Stewart, Rick Macklem, Kioxia, Broadcom, Xilinx
## Video description In this talk, I will discuss the efforts to serve TLS encrypted Netflix video at 400Gb/s from a single server. This will be a follow-on to 2 talks at the 2019 EuroBSDCon: “Numa Optimizations in the FreeBSD Network Stack” and “Kernel TLS and TLS Hardware Offload“. I will provide background on the Netflix video workload, and define key technologies such as NUMA, kernel TLS and hardware kTLS.
I will describe encountering bottlenecks such as: - Memory bandwidth limits for software kTLS - PCIe issues with hardware kTLS - NUMA for software vs hardware kTLS
I will present current and historical performance results from at least: - AMD “Rome” 2nd generation EPYC systems - AMD “Milan” 3rd generation EPYC systems - Ampere Altra arm64 systems
Drew Gallatin Drew started working on FreeBSD at Duke in the 90s, and was one of the people behind the FreeBSD/alpha port. He worked on zero-copy TCP optimizations for FreeBSD and was sending data at over 1Gb/s before gigabit Ethernet was generally available. He spent a decade at Myricom, optimizing their drivers. After a brief hiatus at Google, he landed at Netflix, where he works on optimizing the FreeBSD kernel and network stack for content delivery. He worked on the optimizations to serve unencrypted Netflix traffic at 100Gb/s, and then on more optimizations to send encrypted traffic at ever increasing speeds, from 100Gb/s to 400Gb/s and beyond.
[Source](https://www.youtube.com/watch?v=_o-HcG8QxPc)