[转帖]bpf | eXpress Data Path| XDP

bpf,express,data,path,xdp · 浏览次数 : 0

小编点评

**XDP (eXpress Data Path)** 是一个 Linux 内核中的高性能、可编程的网络数据路径。它作为 IO Visor 项目的一部分,提供高效的数据包处理功能。 **主要优点:** * 高性能:基于裸机处理,无需内核绕过,节约了性能。 * 可编程性:支持动态代码扩展,无需内核修改。 * 可配置性:可以根据需求调整配置。 * 适用于各种场景:例如 DDoS mitigation、性能优化的网络处理等。 **使用场景:** * DDoS 缓解 * 网络监控 * 流量管理 * 缓存 * 负载平衡 **结论:** XDP 是一个非常有潜力的技术,可以为各种网络应用程序提供高效的性能和可扩展性。

正文

https://cloud.tencent.com/developer/article/1984109?from=article.detail.1998962&areaSource=106000.4&traceId=YD2oWP83NY3oL5ojIBmEE

 

Introduction to XDP

XDP or eXpress Data Path provides a high performance, programmable network data path in the Linux kernel as part of the IO Visor Project. XDP provides bare metal packet processing at the lowest point in the software stack which makes it ideal for speed without compromising programmability. Furthermore, new functions can be implemented dynamically with the integrated fast path without kernel modification. Other key benefits of XDP includes the following:

XDP 或 eXpress 数据路径在 Linux 内核中提供高性能、可编程的网络数据路径,作为 IO Visor 项目的一部分。XDP 在软件堆栈的最低点提供裸机数据包处理,这使其成为速度的理想选择,而不会影响可编程性。此外,新功能可以通过集成的快速路径动态实现,而无需修改内核。XDP 的其他主要优点包括:

It does not require any specialized hardware 它不需要任何专用硬件

It does not required kernel bypass 它不需要内核绕过

It does not replace the TCP/IP stack 它不会替换 TCP/IP 堆栈

It works in concert with TCP/IP stack along with all the benefits of BPF 它与 TCP/IP 堆栈以及 BPF 的所有优点协同工作

XDP Packet Processing Overview

The XDP packet process includes an in kernel component that processes RX packet-pages directly out of driver via a functional interface without early allocation of skbuff’s or software queues. Normally, one CPU is assigned to each RX queue but in this model, there is no locking RX queue, and CPU can be dedicated to busy poll or interrupt model. BPF programs performs processing such as packet parsing, table look ups, creating/managing stateful filters, encap/decap packets, etc.

XDP 数据包进程包括一个内核组件,该组件通过功能接口直接从驱动程序中处理 RX 数据包页,而无需提前分配 skbuff 或软件队列。通常,每个 RX 队列分配一个 CPU,但在此模型中,没有锁定 RX 队列,CPU 可以专用于忙轮询或中断模型。BPF 程序执行数据包解析、表查找、创建/管理有状态筛选器、封装/取消封装数据包等处理。

The extensibility of BPF is kept intact with packet inspection and manipulation functions, flow and table lookups, and application processing leveraging BPF programs which are portable to userspace and other operating systems.

通过数据包检查和操作功能、流和表查找以及利用可移植到用户空间和其他操作系统的 BPF 程序的应用程序处理,BPF 的可扩展性保持不变。

Use Cases

Use cases for XDP include the following:

  1. Pre-stack processing like filtering to support DDoS mitigation 预堆栈处理(如过滤)以支持 DDoS 缓解
  2. Forwarding and load balancing 转发和负载平衡
  3. Batching techniques such as in Generic Receive Offload 批处理技术,如通用接收卸载
  4. Flow sampling, monitoring 流量采样、监测
  5. ULP processing (i.e. message delineation) ULP 处理(即消息描述)

XDP and DPDK

XDP is sometimes juxtaposed with DPDK when both are perfectly fine approaches. XDP offers another option for users who want performance while still leveraging the programmability of the kernel. Some of the functions that XDP delivers include the following:

  1. Removes the need for 3rd party code and licensing 无需第三方代码和许可
  2. Allows option of busy polling or interrupt driven networking 允许选择繁忙的轮询或中断驱动的网络
  3. Removes the need to allocate large pages 无需分配大页
  4. Removes the need for dedicated CPUs as users have more options on structuring work between CPUs 消除了对专用 CPU 的需求,因为用户在构建 CPU 之间的工作方面有更多选择
  5. Removes the need to inject packets into the kernel from a 3rd party user space application 无需从第三方用户空间应用程序将数据包注入内核
  6. Removes the need to define a new security model for accessing networking hardware 无需定义用于访问网络硬件的新安全模型
  7. https://www.iovisor.org/technology/xdp
  8. https://developers.redhat.com/blog/2018/12/06/achieving-high-performance-low-latency-networking-with-xdp-part-1?extIdCarryOver=true&sc_cid=701f2000001OH6fAAG#some_rough_edges

与[转帖]bpf | eXpress Data Path| XDP相似的内容:

[转帖]bpf | eXpress Data Path| XDP

https://cloud.tencent.com/developer/article/1984109?from=article.detail.1998962&areaSource=106000.4&traceId=YD2oWP83NY3oL5ojIBmEE Introduction to XDP

[转帖][译] Cilium:基于 BPF+EDT+FQ+BBR 实现更好的带宽管理(KubeCon, 2022)

http://arthurchiao.art/blog/better-bandwidth-management-with-ebpf-zh/ Published at 2022-10-30 | Last Update 2022-10-30 译者序 本文翻译自 KubeCon+CloudNativeCo

[转帖]eBPF系列学习(4)了解libbpf、CO-RE (Compile Once – Run Everywhe) | 使用go开发ebpf程序(云原生利器cilium ebpf )

文章目录 一、了解libbpf1. BPF的可移植性CO-RE (Compile Once – Run Everywhere)BPF 可移植性面临的问题BPF的可移植性CO-RE (Compile Once – Run Everywhere) 2. libbpf和bcc性能对比3. 了解libbpf

[转帖]bpf| 系统分析工具

https://cloud.tencent.com/developer/article/1984108?areaSource=105001.17&traceId=ySuPzDMCMO5dVSJSYsUT9 bpf 最初是为bsd操作系统开发,全称是 「Berkeley Packet Filter」

[转帖]BPF 进阶笔记(五):几种 TCP 相关的 BPF(sockops、struct_ops、header options)

http://arthurchiao.art/blog/bpf-advanced-notes-5-zh/ 整理一些 TCP 相关的 BPF 内容,主要来自 Facebook 和 Google 的分享。 关于 “BPF 进阶笔记” 系列 平时学习和使用 BPF 时所整理。由于是笔记而非教程,因此内容不

[转帖]BPF 拓荒者 —— Brendan Gregg 与 Netflix 的故事

https://www.modb.pro/db/421308 译者写在开头 在我的上一篇文章:Brendan@Intel.com[1] 中,我翻译了他与 Intel 的故事。这次,我们时光倒流一下,说说前传:Brendan Gregg 与 Netflix 的故事。 我写博客的出发点是想把自己所学所思

[转帖]BPF Compiler Collection (BCC)

https://github.com/iovisor/bcc BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful tools and

[转帖]BPF Tools 参考链接

https://blog.csdn.net/qq_34258344/article/details/114928946 链接1:http://www.brendangregg.com/bpf-performance-tools-book.html链接2:https://github.com/iovi

[转帖]BPF Compiler Collection (BCC)

https://github.com/iovisor/bcc BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful tools and

[转帖]BPF内部原理

https://aijishu.com/a/1060000000220363 LinuxKernel性能优化Arm 处理器arm64 1. 简介 Brendan最近在USENIX LISA2021大会上做了一篇关于BPF内部原理的演讲,这篇演讲把BPF的内部逻辑剖析地非常清楚,本文大部分素材来自Br