Files

311 lines
43 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE HTML>
<html lang="en" class="light" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>lesson 18-further-reading - bpf-developer-tutorial</title>
<!-- Custom HTML head -->
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="../favicon.svg">
<link rel="shortcut icon" href="../favicon.png">
<link rel="stylesheet" href="../css/variables.css">
<link rel="stylesheet" href="../css/general.css">
<link rel="stylesheet" href="../css/chrome.css">
<link rel="stylesheet" href="../css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="../fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="../highlight.css">
<link rel="stylesheet" href="../tomorrow-night.css">
<link rel="stylesheet" href="../ayu-highlight.css">
<!-- Custom theme stylesheets -->
</head>
<body class="sidebar-visible no-js">
<div id="body-container">
<!-- Provide site root to javascript -->
<script>
var path_to_root = "../";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('light')
html.classList.add(theme);
var body = document.querySelector('body');
body.classList.remove('no-js')
body.classList.add('js');
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var body = document.querySelector('body');
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
body.classList.remove('sidebar-visible');
body.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../https://github.com/eunomia-bpf/bpf-developer-tutorial.html">https://github.com/eunomia-bpf/bpf-developer-tutorial</a></li><li class="chapter-item expanded affix "><li class="part-title">入门文档</li><li class="chapter-item expanded "><a href="../0-introduce/index.html"><strong aria-hidden="true">1.</strong> lesson 0-introduce</a></li><li class="chapter-item expanded "><a href="../1-helloworld/index.html"><strong aria-hidden="true">2.</strong> lesson 1-helloworld</a></li><li class="chapter-item expanded "><a href="../2-kprobe-unlink/index.html"><strong aria-hidden="true">3.</strong> lesson 2-kprobe-unlink</a></li><li class="chapter-item expanded "><a href="../3-fentry-unlink/index.html"><strong aria-hidden="true">4.</strong> lesson 3-fentry-unlink</a></li><li class="chapter-item expanded "><a href="../4-opensnoop/index.html"><strong aria-hidden="true">5.</strong> lesson 4-opensnoop</a></li><li class="chapter-item expanded "><a href="../5-uprobe-bashreadline/index.html"><strong aria-hidden="true">6.</strong> lesson 5-uprobe-bashreadline</a></li><li class="chapter-item expanded "><a href="../6-sigsnoop/index.html"><strong aria-hidden="true">7.</strong> lesson 6-sigsnoop</a></li><li class="chapter-item expanded "><a href="../7-execsnoop/index.html"><strong aria-hidden="true">8.</strong> lesson 7-execsnoop</a></li><li class="chapter-item expanded "><a href="../8-exitsnoop/index.html"><strong aria-hidden="true">9.</strong> lesson 8-execsnoop</a></li><li class="chapter-item expanded "><a href="../9-runqlat/index.html"><strong aria-hidden="true">10.</strong> lesson 9-runqlat</a></li><li class="chapter-item expanded "><a href="../10-hardirqs/index.html"><strong aria-hidden="true">11.</strong> lesson 10-hardirqs</a></li><li class="chapter-item expanded affix "><li class="part-title">进阶文档和示例</li><li class="chapter-item expanded "><a href="../11-bootstrap/index.html"><strong aria-hidden="true">12.</strong> lesson 11-bootstrap</a></li><li class="chapter-item expanded "><a href="../12-profile/index.html"><strong aria-hidden="true">13.</strong> lesson 12-profile</a></li><li class="chapter-item expanded "><a href="../13-tcpconnlat/index.html"><strong aria-hidden="true">14.</strong> lesson 13-tcpconnlat</a></li><li class="chapter-item expanded "><a href="../14-tcpstates/index.html"><strong aria-hidden="true">15.</strong> lesson 14-tcpstates</a></li><li class="chapter-item expanded "><a href="../15-javagc/index.html"><strong aria-hidden="true">16.</strong> lesson 15-javagc</a></li><li class="chapter-item expanded "><a href="../16-memleak/index.html"><strong aria-hidden="true">17.</strong> lesson 16-memleak</a></li><li class="chapter-item expanded "><a href="../17-biopattern/index.html"><strong aria-hidden="true">18.</strong> lesson 17-biopattern</a></li><li class="chapter-item expanded "><a href="../18-further-reading/index.html" class="active"><strong aria-hidden="true">19.</strong> lesson 18-further-reading</a></li><li class="chapter-item expanded "><a href="../19-lsm-connect/index.html"><strong aria-hidden="true">20.</strong> lesson 19-lsm-connect</a></li><li class="chapter-item expanded "><a href="../20-tc/index.html"><strong aria-hidden="true">21.</strong> lesson 20-tc</a></li><li class="chapter-item expanded "><a href="../21-xdp/index.html"><strong aria-hidden="true">22.</strong> lesson 21-xdp</a></li><li class="chapter-item expanded affix "><li class="part-title">高级主题</li><li class="chapter-item expanded "><a href="../22-android/index.html"><strong aria-hidden="true">23.</strong> 在 Android 上使用 eBPF 程序</a></li><li class="chapter-item expanded "><a href="../30-sslsniff/index.html"><strong aria-hidden="true">24.</strong> 使用 uprobe 捕获多种库的 SSL/TLS 明文数据</a></li><li class="chapter-item expanded "><a href="../23-http/index.html"><strong aria-hidden="true">25.</strong> 使用 eBPF socket filter 或 syscall trace 追踪 HTTP 请求和其他七层协议</a></li><li class="chapter-item expanded "><a href="../29-sockops/index.html"><strong aria-hidden="true">26.</strong> 使用 sockops 加速网络请求转发</a></li><li class="chapter-item expanded "><a href="../24-hide/index.html"><strong aria-hidden="true">27.</strong> 使用 eBPF 隐藏进程或文件信息</a></li><li class="chapter-item expanded "><a href="../25-signal/index.html"><strong aria-hidden="true">28.</strong> 使用 bpf_send_signal 发送信号终止进程</a></li><li class="chapter-item expanded "><a href="../26-sudo/index.html"><strong aria-hidden="true">29.</strong> 使用 eBPF 添加 sudo 用户</a></li><li class="chapter-item expanded "><a href="../27-replace/index.html"><strong aria-hidden="true">30.</strong> 使用 eBPF 替换任意程序读取或写入的文本</a></li><li class="chapter-item expanded "><a href="../28-detach/index.html"><strong aria-hidden="true">31.</strong> BPF 的生命周期:使用 Detached 模式在用户态应用退出后持续运行 eBPF 程序</a></li><li class="chapter-item expanded "><a href="../18-further-reading/ebpf-security.zh.html"><strong aria-hidden="true">32.</strong> eBPF 运行时的安全性与面临的挑战</a></li><li class="chapter-item expanded "><a href="../34-syscall/index.html"><strong aria-hidden="true">33.</strong> 使用 eBPF 修改系统调用参数</a></li><li class="chapter-item expanded "><a href="../35-user-ringbuf/index.html"><strong aria-hidden="true">34.</strong> eBPF开发实践使用 user ring buffer 向内核异步发送信息</a></li><li class="chapter-item expanded "><a href="../36-userspace-ebpf/index.html"><strong aria-hidden="true">35.</strong> 用户空间 eBPF 运行时:深度解析与应用实践</a></li><li class="chapter-item expanded "><a href="../37-uprobe-rust/index.html"><strong aria-hidden="true">36.</strong> 使用 uprobe 追踪 Rust 应用程序</a></li><li class="chapter-item expanded "><a href="../38-btf-uprobe/index.html"><strong aria-hidden="true">37.</strong> 借助 eBPF 和 BTF让用户态也能一次编译、到处运行</a></li><li class="chapter-item expanded affix "><li class="part-title">bcc 和 bpftrace 教程与文档</li><li class="chapter-item expanded "><a href="../bcc-documents/kernel-versions.html"><strong aria-hidden="true">38.</strong> BPF Features by Linux Kernel Version</a></li><li class="chapter-item expanded "><a href="../bcc-documents/kernel_config.html"><strong aria-hidden="true">39.</strong> Kernel Configuration for BPF Features</a></li><li class="chapter-item expanded "><a href="../bcc-documents/reference_guide.html"><strong aria-hidden="true">40.</strong> bcc Reference Guide</a></li><li class="chapter-item expanded "><a href="../bcc-documents/special_filtering.html"><strong aria-hidden="true">41.</strong> Special Filtering</a></li><li class="chapter-item expanded "><a href="../bcc-documents/tutorial.html"><strong aria-hidden="true">42.</strong> bcc Tutorial</a></li><li class="chapter-item expanded "><a href="../bcc-documents/tutorial_bcc_python_developer.html"><strong aria-hidden="true">43.</strong> bcc Python Developer Tutorial</a></li><li class="chapter-item expanded "><a href="../bpftrace-tutorial/index.html"><strong aria-hidden="true">44.</strong> bpftrace Tutorial</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">bpf-developer-tutorial</h1>
<div class="right-buttons">
<a href="../print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="更多的参考资料论文项目等等"><a class="header" href="#更多的参考资料论文项目等等">更多的参考资料:论文、项目等等</a></h1>
<p>可以在这里找到更多关于 eBPF 的信息:</p>
<ul>
<li>一个关于 eBPF 相关内容和信息的详细列表:<a href="https://github.com/zoidbergwill/awesome-ebpf">https://github.com/zoidbergwill/awesome-ebpf</a></li>
<li>eBPF 相关项目、教程:<a href="https://ebpf.io/">https://ebpf.io/</a></li>
</ul>
<p>这是我近年来读过的与 eBPF 相关的论文列表,可能对于对 eBPF 相关研究感兴趣的人有所帮助。</p>
<p>eBPF扩展的伯克利数据包过滤器是一种新兴的技术允许在 Linux 内核中安全地执行用户提供的程序。近年来,它因加速网络处理、增强可观察性和实现可编程数据包处理而得到了广泛的应用。此文档列出了过去几年关于 eBPF 的一些关键研究论文。这些论文涵盖了 eBPF 的几个方面,包括加速分布式系统、存储和网络,正式验证 eBPF 的 JIT 编译器和验证器,将 eBPF 用于入侵检测,以及从 eBPF 程序自动生成硬件设计。</p>
<p>一些关键亮点:</p>
<ul>
<li>eBPF 允许在内核中执行自定义函数,以加速分布式协议、存储引擎和网络应用,与传统的用户空间实现相比,可以提高吞吐量和降低延迟。</li>
<li>eBPF 组件(如 JIT 和验证器)的正式验证确保了正确性,并揭示了实际实现中的错误。</li>
<li>eBPF 的可编程性和效率使其适合在内核中完全构建入侵检测和网络监控应用。</li>
<li>从 eBPF 程序中自动生成硬件设计允许软件开发人员快速生成网络卡中的优化数据包处理管道。</li>
</ul>
<p>这些论文展示了 eBPF 在加速系统、增强安全性和简化网络编程方面的多功能性。随着 eBPF 的采用不断增加,它是一个与性能、安全性、硬件集成和易用性相关的系统研究的重要领域。</p>
<p>如果您有任何建议或添加论文的意见请随时开放一个问题或PR。此列表创建于 2023.10,未来将添加新的论文。</p>
<blockquote>
<p>如果您对 eBPF 有些进一步的兴趣的话,也可以查看我们在 <a href="https://github.com/eunomia-bpf">eunomia-bpf</a> 的开源项目和 <a href="https://github.com/eunomia-bpf/bpf-developer-tutorial">bpf-developer-tutorial</a> 的 eBPF 教程。我也在寻找 2024/2025 年系统和网络领域的 PhD 相关机会,这是我的 <a href="https://github.com/yunwei37">Github</a><a href="yunwei356@gmail.com">邮箱</a></p>
</blockquote>
<h2 id="xrp-in-kernel-storage-functions-with-ebpf"><a class="header" href="#xrp-in-kernel-storage-functions-with-ebpf">XRP: In-Kernel Storage Functions with eBPF</a></h2>
<p>随着微秒级 NVMe 存储设备的出现Linux 内核存储堆栈开销变得显著,几乎使访问时间翻倍。我们介绍了 XRP一个框架允许应用程序从 eBPF 在 NVMe 驱动程序中的钩子执行用户定义的存储功能如索引查找或聚合安全地绕过大部分内核的存储堆栈。为了保持文件系统的语义XRP 将少量的内核状态传播到其 NVMe 驱动程序钩子,在那里调用用户注册的 eBPF 函数。我们展示了如何利用 XRP 显著提高两个键值存储BPF-KV一个简单的 B+ 树键值存储,和 WiredTiger一个流行的日志结构合并树存储引擎的吞吐量和延迟。</p>
<p>OSDI '22 最佳论文: <a href="https://www.usenix.org/conference/osdi22/presentation/zhong">https://www.usenix.org/conference/osdi22/presentation/zhong</a></p>
<h2 id="specification-and-verification-in-the-field-applying-formal-methods-to-bpf-just-in-time-compilers-in-the-linux-kernel"><a class="header" href="#specification-and-verification-in-the-field-applying-formal-methods-to-bpf-just-in-time-compilers-in-the-linux-kernel">Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel</a></h2>
<p>本文描述了我们将形式方法应用于 Linux 内核中的一个关键组件,即 Berkeley 数据包过滤器 (BPF) 虚拟机的即时编译器 ("JIT") 的经验。我们使用 Jitterbug 验证这些 JIT这是第一个提供 JIT 正确性的精确规范的框架,能够排除实际错误,并提供一个自动化的证明策略,该策略可以扩展到实际实现。使用 Jitterbug我们设计、实施并验证了一个新的针对 32 位 RISC-V 的 BPF JIT在五个其他部署的 JIT 中找到并修复了 16 个之前未知的错误,并开发了新的 JIT 优化;所有这些更改都已上传到 Linux 内核。结果表明,在一个大型的、未经验证的系统中,通过仔细设计规范和证明策略,可以构建一个经过验证的组件。</p>
<p>OSDI 20: <a href="https://www.usenix.org/conference/osdi20/presentation/nelson">https://www.usenix.org/conference/osdi20/presentation/nelson</a></p>
<h2 id="λ-io-a-unified-io-stack-for-computational-storage"><a class="header" href="#λ-io-a-unified-io-stack-for-computational-storage">λ-IO: A Unified IO Stack for Computational Storage</a></h2>
<p>新兴的计算存储设备为存储内计算提供了一个机会。它减少了主机与设备之间的数据移动开销,从而加速了数据密集型应用程序。在这篇文章中,我们介绍 λ-IO一个统一的 IO 堆栈,跨主机和设备管理计算和存储资源。我们提出了一套设计 - 接口、运行时和调度 - 来解决三个关键问题。我们在全堆栈软件和硬件环境中实施了 λ-IO并使用合成和实际应用程序对其</p>
<p>进行评估,与 Linux IO 相比,显示出高达 5.12 倍的性能提升。</p>
<p>FAST23: <a href="https://www.usenix.org/conference/fast23/presentation/yang-zhe">https://www.usenix.org/conference/fast23/presentation/yang-zhe</a></p>
<h2 id="extension-framework-for-file-systems-in-user-space"><a class="header" href="#extension-framework-for-file-systems-in-user-space">Extension Framework for File Systems in User space</a></h2>
<p>用户文件系统相对于其内核实现提供了许多优势,例如开发的简易性和更好的系统可靠性。然而,它们会导致重大的性能损失。我们观察到现有的用户文件系统框架非常通用;它们由一个位于内核中的最小干预层组成,该层简单地将所有低级请求转发到用户空间。虽然这种设计提供了灵活性,但由于频繁的内核-用户上下文切换,它也严重降低了性能。</p>
<p>这项工作介绍了 ExtFUSE一个用于开发可扩展用户文件系统的框架该框架还允许应用程序在内核中注册"薄"的专用请求处理程序,以满足其特定的操作需求,同时在用户空间中保留复杂的功能。我们使用两个 FUSE 文件系统对 ExtFUSE 进行评估,结果表明 ExtFUSE 可以通过平均不到几百行的改动来提高用户文件系统的性能。ExtFUSE 可在 GitHub 上找到。</p>
<p>ATC 19: <a href="https://www.usenix.org/conference/atc19/presentation/bijlani">https://www.usenix.org/conference/atc19/presentation/bijlani</a></p>
<h2 id="electrode-accelerating-distributed-protocols-with-ebpf"><a class="header" href="#electrode-accelerating-distributed-protocols-with-ebpf">Electrode: Accelerating Distributed Protocols with eBPF</a></h2>
<p>在标准的Linux内核网络栈下实现分布式协议可以享受到负载感知的CPU缩放、高兼容性以及强大的安全性和隔离性。但由于过多的用户-内核切换和内核网络栈遍历其性能较低。我们介绍了Electrode这是一套为分布式协议设计的基于eBPF的性能优化。这些优化在网络栈之前在内核中执行但实现了与用户空间中实现的相似功能例如消息广播收集ack的仲裁从而避免了用户-内核切换和内核网络栈遍历所带来的开销。我们展示当应用于经典的Multi-Paxos状态机复制协议时Electrode可以提高其吞吐量高达128.4%并将延迟降低高达41.7%。</p>
<p>NSDI 23: <a href="https://www.usenix.org/conference/nsdi23/presentation/zhou">链接</a></p>
<h2 id="bmc-accelerating-memcached-using-safe-in-kernel-caching-and-pre-stack-processing"><a class="header" href="#bmc-accelerating-memcached-using-safe-in-kernel-caching-and-pre-stack-processing">BMC: Accelerating Memcached using Safe In-kernel Caching and Pre-stack Processing</a></h2>
<p>内存键值存储是帮助扩展大型互联网服务的关键组件通过提供对流行数据的低延迟访问。Memcached是最受欢迎的键值存储之一由于Linux网络栈固有的性能限制当使用高速网络接口时其性能不高。虽然可以使用DPDK基础方案绕过Linux网络栈但这种方法需要对软件栈进行完全重新设计而且在客户端负载较低时也会导致高CPU利用率。</p>
<p>为了克服这些限制我们提出了BMC这是一个为Memcached设计的内核缓存可以在执行标准网络栈之前服务于请求。对BMC缓存的请求被视为NIC中断的一部分这允许性能随着为NIC队列服务的核心数量而扩展。为确保安全BMC使用eBPF实现。尽管eBPF具有安全约束但我们展示了实现复杂缓存服务是可能的。因为BMC在商用硬件上运行并且不需要修改Linux内核或Memcached应用程序所以它可以在现有系统上广泛部署。BMC优化了Facebook样式的小型请求的处理时间。在这个目标工作负载上我们的评估显示与原始的Memcached应用程序相比BMC的吞吐量提高了高达18倍与使用SO_REUSEPORT套接字标志的优化版Memcached相比提高了高达6倍。此外我们的结果还显示对于非目标工作负载BMC的开销可以忽略不计并且不会降低吞吐量。</p>
<p>NSDI 21: <a href="https://www.usenix.org/conference/nsdi21/presentation/ghigoff">链接</a></p>
<h2 id="hxdp-efficient-software-packet-processing-on-fpga-nics"><a class="header" href="#hxdp-efficient-software-packet-processing-on-fpga-nics">hXDP: Efficient Software Packet Processing on FPGA NICs</a></h2>
<p>FPGA加速器在NIC上使得从CPU卸载昂贵的数据包处理任务成为可能。但是FPGA有限的资源可能需要在多个应用程序之间共享而编程它们则很困难。</p>
<p>我们提出了一种在FPGA上运行Linux的eXpress Data Path程序的解决方案这些程序使用eBPF编写仅使用可用硬件资源的一部分同时匹配高端CPU的性能。eBPF的迭代执行模型不适合FPGA加速器。尽管如此我们展示了当针对一个特定的FPGA执行器时一个eBPF程序的许多指令可以被压缩、并行化或完全删除从而显著提高性能。我们利用这一点设计了hXDP它包括(i)一个优化编译器该编译器并行化并将eBPF字节码转换为我们定义的扩展eBPF指令集架构(ii)一个在FPGA上执行这些指令的软处理器以及(iii)一个基于FPGA的基础设施提供XDP的maps和Linux内核中定义的helper函数。</p>
<p>我们在FPGA NIC上实现了hXDP并评估了其运行真实世界的未经修改的eBPF程序的性能。我们的实现以156.25MHz的速度时钟使用约15%的FPGA资源并可以运行动态加载的程序。尽管有这些适度的要求但它达到了高端CPU核心的数据包处理吞吐量并提供了10倍低的数据包转发延迟。</p>
<p>OSDI 20: <a href="https://www.usenix.org/conference/osdi20/presentation/brunella">链接</a></p>
<h2 id="network-centric-distributed-tracing-with-deepflow-troubleshooting-your-microservices-in-zero-code"><a class="header" href="#network-centric-distributed-tracing-with-deepflow-troubleshooting-your-microservices-in-zero-code">Network-Centric Distributed Tracing with DeepFlow: Troubleshooting Your Microservices in Zero Code</a></h2>
<p>微服务正变得越来越复杂,给传统的性能监控解决方案带来了新的挑战。一方面,微服务的快速演变给现有的分布式跟踪框架的使用和维护带来了巨大的负担。另一方面,复杂的基础设施增加了网络性能问题的概率,并在网络侧创造了更多的盲点。在这篇论文中,我们介绍了 DeepFlow一个用于微服务故障排除的以网络为中心的分布式跟踪框架。DeepFlow 通过一个以网络为中心的跟踪平面和隐式的上下文传播提供开箱即用的跟踪。此外它消除了网络基础设施中的盲点以低成本方式捕获网络指标并增强了不同组件和层之间的关联性。我们从分析和实证上证明DeepFlow 能够准确地定位微服务性能异常而开销几乎可以忽略不计。DeepFlow 已经为超过26家公司发现了71多个关键性能异常并已被数百名开发人员所使用。我们的生产评估显示DeepFlow 能够为用户节省数小时的仪表化工作,并将故障排除时间从数小时缩短到几分钟。</p>
<p>SIGCOMM 23: <a href="https://dl.acm.org/doi/10.1145/3603269.3604823">https://dl.acm.org/doi/10.1145/3603269.3604823</a></p>
<h2 id="fast-in-kernel-traffic-sketching-in-ebpf"><a class="header" href="#fast-in-kernel-traffic-sketching-in-ebpf">Fast In-kernel Traffic Sketching in eBPF</a></h2>
<p>扩展的伯克利数据包过滤器eBPF是一个基础设施允许在不重新编译的情况下动态加载并直接在 Linux 内核中运行微程序。</p>
<p>在这项工作中,我们研究如何在 eBPF 中开发高性能的网络测量。我们以绘图为案例研究,因为它们具有支持广泛任务的能力,同时提供低内存占用和准确性保证。我们实现了 NitroSketch一个用于用户空间网络的最先进的绘图并表明用户空间网络的最佳实践不能直接应用于 eBPF因为它的性能特点不同。通过应用我们学到的经验教训我们将其性能提高了40%,与初级实现相比。</p>
<p>SIGCOMM 23: <a href="https://dl.acm.org/doi/abs/10.1145/3594255.3594256">https://dl.acm.org/doi/abs/10.1145/3594255.3594256</a></p>
<h2 id="spright-extracting-the-server-from-serverless-computing-high-performance-ebpf-based-event-driven-shared-memory-processing"><a class="header" href="#spright-extracting-the-server-from-serverless-computing-high-performance-ebpf-based-event-driven-shared-memory-processing">SPRIGHT: extracting the server from serverless computing! high-performance eBPF-based event-driven, shared-memory processing</a></h2>
<p>无服务器计算在云环境中承诺提供高效、低成本的计算能力。然而现有的解决方案如Knative这样的开源平台包含了繁重的组件破坏了无服务器计算的目标。此外这种无服务器平台缺乏数据平面优化无法实现高效的、高性能的功能链这也是流行的微服务开发范式的设施。它们为构建功能链使用的不必要的复杂和重复的功能严重降低了性能。"冷启动"延迟是另一个威慑因素。</p>
<p>我们描述了 SPRIGHT一个轻量级、高性能、响应式的无服务器框架。SPRIGHT 利用共享内存处理显著提高了数据平面的可伸缩性,通过避免不必要的协议处理和序列化-反序列化开销。SPRIGHT 大量利用扩展的伯克利数据包过滤器 (eBPF) 进行事件驱动处理。我们创造性地使用 eBPF 的套接字消息机制支持共享内存处理其开销严格与负载成正比。与常驻、基于轮询的DPDK相比SPRIGHT 在真实工作负载下实现了相同的数据平面性能,但 CPU 使用率降低了10倍。此外eBPF 为 SPRIGHT 带来了好处,替换了繁重的无服务器组件,使我们能够以微不足道的代价保持函数处于"暖"状态。</p>
<p>我们的初步实验结果显示,与 Knative 相比SPRIGHT 在吞吐量和延迟方面实现了一个数量级的提高,同时大大减少了 CPU 使用,并消除了 "冷启动"的需要。</p>
<p><a href="https://dl.acm.org/doi/10.1145/3544216.3544259">https://dl.acm.org/doi/10.1145/3544216.3544259</a></p>
<h2 id="kgent-kernel-extensions-large-language-model-agent"><a class="header" href="#kgent-kernel-extensions-large-language-model-agent">Kgent: Kernel Extensions Large Language Model Agent</a></h2>
<p>修改和扩展操作系统的能力是提高系统安全性、可靠性和性能的重要功能。扩展的伯克利数据包过滤器eBPF生态系统已经成为扩展Linux内核的标准机制并且最近已被移植到Windows。eBPF程序将新逻辑注入内核使系统在现有逻辑之前或之后执行这些逻辑。虽然eBPF生态系统提供了一种灵活的内核扩展机制但目前开发人员编写eBPF程序仍然困难。eBPF开发人员必须深入了解操作系统的内部结构以确定在何处放置逻辑并应对eBPF验证器对其eBPF程序的控制流和数据访问施加的编程限制。本文介绍了KEN一种通过允许使用自然语言编写内核扩展来缓解编写eBPF程序难度的替代框架。KEN利用大语言模型LLMs的最新进展根据用户的英文提示生成eBPF程序。为了确保LLM的输出在语义上等同于用户的提示KEN结合了LLM增强的程序理解、符号执行和一系列反馈循环。KEN的关键创新在于这些技术的结合。特别是该系统以一种新颖的结构使用符号执行使其能够结合程序综合和程序理解的结果并建立在LLMs在每个任务中单独展示的成功基础上。为了评估KEN我们开发了一个新的自然语言提示eBPF程序的语料库。我们显示KEN在80%的情况下生成了正确的eBPF程序这比LLM增强的程序综合基线提高了2.67倍。</p>
<p>eBPF'24: <a href="https://dl.acm.org/doi/10.1145/3672197.3673434">https://dl.acm.org/doi/10.1145/3672197.3673434</a> 和arxiv <a href="https://arxiv.org/abs/2312.05531">https://arxiv.org/abs/2312.05531</a></p>
<h2 id="programmable-system-call-security-with-ebpf"><a class="header" href="#programmable-system-call-security-with-ebpf">Programmable System Call Security with eBPF</a></h2>
<p>利用 eBPF 进行可编程的系统调用安全</p>
<p>系统调用过滤是一种广泛用于保护共享的 OS 内核免受不受信任的用户应用程序威胁的安全机制。但是现有的系统调用过滤技术要么由于用户空间代理带来的上下文切换开销过于昂贵要么缺乏足够的可编程性来表达高级策略。Seccomp 是 Linux 的系统调用过滤模块,广泛用于现代的容器技术、移动应用和系统管理服务。尽管采用了经典的 BPF 语言cBPF但 Seccomp 中的安全策略主要限于静态的允许列表,主要是因为 cBPF 不支持有状态的策略。因此,许多关键的安全功能无法准确地表达,和/或需要修改内核。</p>
<p>在这篇论文中,我们介绍了一个可编程的系统调用过滤机制,它通过利用扩展的 BPF 语言eBPF使得更高级的安全策略得以表达。更具体地说我们创建了一个新的 Seccomp eBPF 程序类型,暴露、修改或创建新的 eBPF 助手函数来安全地管理过滤状态、访问内核和用户状态,以及利用同步原语。重要的是,我们的系统与现有的内核特权和能力机制集成,使非特权用户能够安全地安装高级过滤器。我们的评估表明,我们基于 eBPF 的过滤可以增强现有策略例如通过时间专化减少早期执行阶段的攻击面积高达55.4%)、缓解实际漏洞并加速过滤器。</p>
<p><a href="https://arxiv.org/abs/2302.10366">https://arxiv.org/abs/2302.10366</a></p>
<h2 id="cross-container-attacks-the-bewildered-ebpf-on-clouds"><a class="header" href="#cross-container-attacks-the-bewildered-ebpf-on-clouds">Cross Container Attacks: The Bewildered eBPF on Clouds</a></h2>
<p>在云上困惑的 eBPF 之间的容器攻击</p>
<p>扩展的伯克利数据包过滤器eBPF为用户空间程序提供了强大而灵活的内核接口通过在内核空间直接运行字节码来扩展内核功能。它已被云服务广泛使用以增强容器安全性、网络管理和系统可观察性。然而我们发现在 Linux 主机上广泛讨论的攻击性 eBPF 可以为容器带来新的攻击面。通过 eBPF 的追踪特性,攻击者可以破坏容器的隔离并攻击主机,例如,窃取敏感数据、进行 DoS 攻击,甚至逃逸容器。在这篇论文中,我们研究基于 eBPF 的跨容器攻击,并揭示其在实际服务中的安全影响。利用 eBPF 攻击,我们成功地妨害了五个在线的 Jupyter/交互式 Shell 服务和 Google Cloud Platform 的 Cloud Shell。此外我们发现三家领先的云供应商提供的 Kubernetes 服务在攻击者通过 eBPF 逃逸容器后可以被利用来发起跨节点攻击。具体来说,在阿里巴巴的 Kubernetes 服务中,攻击者可以通过滥用他们过度特权的云指标或管理 Pods 来妨害整个集群。不幸的是,容器上的 eBPF 攻击鲜为人知,并且现有的入侵检测系统几乎无法发现它们。此外,现有的 eBPF 权限模型无法限制 eBPF 并确保在共享内核的容器环境中安全使用。为此,我们提出了一个新的 eBPF 权限模型,以对抗容器中的 eBPF 攻击。</p>
<p><a href="https://www.usenix.org/conference/usenixsecurity23/presentation/he">https://www.usenix.org/conference/usenixsecurity23/presentation/he</a></p>
<h2 id="comparing-security-in-ebpf-and-webassembly"><a class="header" href="#comparing-security-in-ebpf-and-webassembly">Comparing Security in eBPF and WebAssembly</a></h2>
<p>比较 eBPF 和 WebAssembly 中的安全性</p>
<p>本文研究了 eBPF 和 WebAssemblyWasm的安全性这两种技术近年来得到了广泛的采用尽管它们是为非常不同的用途和环境而设计的。当 eBPF 主要用于 Linux 等操作系统内核时Wasm 是一个为基于堆栈的虚拟机设计的二进制指令格式,其用途超出了 web。鉴于 eBPF 的增长和不断扩大的雄心Wasm 可能提供有启发性的见解,因为它围绕在如 web 浏览器和云等复杂和敌对环境中安全执行任意不受信任的程序进行设计。我们分析了两种技术的安全目标、社区发展、内存模型和执行模型并进行了比较安全性评估探讨了内存安全性、控制流完整性、API 访问和旁路通道。我们的结果表明eBPF 有一个首先关注性能、其次关注安全的历史,而 Wasm 更强调安全,尽管要支付一些运行时开销。考虑 eBPF 的基于语言的限制和一个用于 API 访问的安全模型是未来工作的有益方向。</p>
<p><a href="https://dl.acm.org/doi/abs/10.1145/3609021.3609306">https://dl.acm.org/doi/abs/10.1145/3609021.3609306</a></p>
<p>更多内容可以在第一个 eBPF 研讨会中找到:<a href="https://conferences.sigcomm.org/sigcomm/2023/workshop-ebpf.html">https://conferences.sigcomm.org/sigcomm/2023/workshop-ebpf.html</a></p>
<h2 id="a-flow-based-ids-using-machine-learning-in-ebpf"><a class="header" href="#a-flow-based-ids-using-machine-learning-in-ebpf">A flow-based IDS using Machine Learning in eBPF</a></h2>
<p>基于eBPF中的机器学习的流式入侵检测系统</p>
<p>eBPF 是一种新技术,允许动态加载代码片段到 Linux 内核中。它可以大大加速网络因为它使内核能够处理某些数据包而无需用户空间程序的参与。到目前为止eBPF 主要用于简单的数据包过滤应用,如防火墙或拒绝服务保护。我们证明在 eBPF 中完全基于机器学习开发流式网络入侵检测系统是可行的。我们的解决方案使用决策树,并为每个数据包决定它是否恶意,考虑到网络流的整个先前上下文。与作为用户空间程序实现的同一解决方案相比,我们实现了超过 20% 的性能提升。</p>
<p><a href="https://arxiv.org/abs/2102.09980">https://arxiv.org/abs/2102.09980</a></p>
<h2 id="femto-containers-lightweight-virtualization-and-fault-isolation-for-small-software-functions-on-low-power-iot-microcontrollers"><a class="header" href="#femto-containers-lightweight-virtualization-and-fault-isolation-for-small-software-functions-on-low-power-iot-microcontrollers">Femto-containers: lightweight virtualization and fault isolation for small software functions on low-power IoT microcontrollers</a></h2>
<p>针对低功耗 IoT 微控制器上的小型软件功能的轻量级虚拟化和故障隔离: Femto-容器</p>
<p>低功耗的 IoT 微控制器上运行的操作系统运行时通常提供基础的 API、基本的连接性和有时一个安全的固件更新机制。相比之下在硬件约束较少的场合网络化软件已进入无服务器、微服务和敏捷的时代。考虑到弥合这一差距我们在论文中设计了 Femto-容器,这是一种新的中间件运行时,可以嵌入到各种低功耗 IoT 设备中。Femto-容器使得可以在低功耗 IoT 设备上通过网络安全地部署、执行和隔离小型虚拟软件功能。我们实施了 Femto-容器,并在 RIOT 中提供了集成,这是一个受欢迎的开源 IoT 操作系统。然后,我们评估了我们的实现性能,它已被正式验证用于故障隔离,确保 RIOT 受到加载并在 Femto-容器中执行的逻辑的保护。我们在各种受欢迎的微控制器架构Arm Cortex-M、ESP32 和 RISC-V上的实验表明Femto-容器在内存占用开销、能源消耗和安全性方面提供了有吸引力的权衡。</p>
<p><a href="https://dl.acm.org/doi/abs/10.1145/3528535.3565242">https://dl.acm.org/doi/abs/10.1145/3528535.3565242</a></p>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="../17-biopattern/index.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../19-lsm-connect/index.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="../17-biopattern/index.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../19-lsm-connect/index.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<script>
window.playground_copyable = true;
</script>
<script src="../elasticlunr.min.js"></script>
<script src="../mark.min.js"></script>
<script src="../searcher.js"></script>
<script src="../clipboard.min.js"></script>
<script src="../highlight.js"></script>
<script src="../book.js"></script>
<!-- Custom JS scripts -->
</div>
</body>
</html>