"零拷贝联网" VS"内核旁路"? [英] "zero copy networking" vs "kernel bypass"?

查看:306
本文介绍了"零拷贝联网" VS"内核旁路"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是零拷贝网络和内核搭桥之间的区别?他们是两个短语意思是一样的东西,还是有什么不同?内核是绕过零拷贝网络中使用的技术,这是关系?

What is the difference between "zero-copy networking" and "kernel bypass"? Are they two phrases meaning the same thing, or different? Is kernel bypass a technique used within "zero copy networking" and this is the relationship?

推荐答案

用户绕过

连通的这种方式也应考虑。这也许可能的 DMA到DMA 的不涉及CPU的所有交易。我们的想法是使用拼接()或类似的功能,以避免的用户空间的都没有。请注意,与剪接(),整个数据流不需要绕过用户空间。头可以在用户空间读取和数据流直接到磁盘。这方面最常见的垮台是拼接()不执行校验和卸载。

This mode of communicating should also be considered. It maybe possible for DMA-to-DMA transactions which do not involve the CPU at all. The idea is to use splice() or similar functions to avoid user space at all. Note, that with splice(), the entire data stream does not need to bypass user space. Headers can be read in user space and data streamed directly to disk. The most common downfall of this is splice() doesn't do checksum offloading.

零拷贝

零拷贝的概念,仅仅是网络缓冲区固定的地方,不搬来搬去。在许多情况下,这并不是真正有益的。大多数现代的网络硬件的支持分散收集,也知道为缓冲描述符的,等我们的想法是对的网络硬件的理解物理指针。缓冲区描述通常由

The zero copy concept is only that the network buffers are fixed in place and are not moved around. In many cases, this is not really beneficial. Most modern network hardware supports scatter gather, also know as buffer descriptors, etc. The idea is the network hardware understands physical pointers. The buffer descriptor typically consists of,


  1. 数据指针

  2. 长度

  3. 下的缓冲区描述

  1. Data pointer
  2. Length
  3. Next buffer descriptor

这样做的好处是,网络头不需要存在的并排侧 IP TCP 应用头可以驻留在的应用程序数据的物理独立

The benefit is that the network headers do not need to exist side-by-side and IP, TCP, and Application headers can reside physically seperate from the application data.

如果控制器不支持这一点,那么的 TCP / IP 的头必须precede的的用户数据的,以便他们可以在发送之前填写在网络控制器的。

If a controller doesn't support this, then the TCP/IP headers must precede the user data so that they can be filled in before sending to the network controller.

内核旁路

当然,你可以绕过内核。这是 PCAP 等嗅探软件已经在做了一段时间。然而,这是难以看到的情​​况下,除非它被绑定到特定硬件用户空间的将有一个明确的胜利。部分的网络控制器的可能的分散收集的支持在控制器和其他人可能不会。

Of course, you can bypass the kernel. This is what pcap and other sniffer software has been doing for some time. However, it is difficult to see a case where user space will have a definite win unless it is tied to the particular hardware. Some network controllers may have scatter gather supported in the controller and others may not.

这篇关于"零拷贝联网" VS"内核旁路"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆