简体   繁体   English

读取网络数据的最快方法?

[英]Quickest way to read network data?

What are the alternative methods I have for reading a packet of data in the quickest time possible? 在最快的时间内读取数据包有哪些替代方法?

Writing a driver in user-space? 在用户空间中编写驱动程序?

I have never written a driver for a network card (although if it wasn't as difficult as writing a whole operating system I'd be interested?). 我从未编写过网卡驱动程序(尽管如果不像编写整个操作系统那样困难,我会感兴趣吗?)。 Could I obtain the already-existing driver code which must exist in Linux somewhere and literally "porting" this in to the user space? 我能否获得Linux中某个地方必须已经存在的驱动程序代码,并将其从字面上“移植”到用户空间? Would both Linux Kernel driver and my driver try to compete for same packets? Linux内核驱动程序和我的驱动程序都将尝试竞争同一数据包吗?

Not writing a driver, but accessing the network data immediately after the stack from the C/C++ application? 不是编写驱动程序,而是在从C / C ++应用程序堆栈之后立即访问网络数据?

I do not know much about this approach- so if someone could help here I'd be interested. 我对这种方法不太了解-因此,如果有人可以在这里提供帮助,我会很感兴趣。

I am interested in implementing my own zero-copy techniques to get the packet data as fast as possible. 我对实现自己的零复制技术以尽可能快地获取数据包数据感兴趣。 This computer doesn't need to use normal internet- it could be a proprietary network connection between two computers (for TCP and UDP). 此计算机不需要使用正常的Internet,它可以是两台计算机之间的专有网络连接(用于TCP和UDP)。

EDIT: 编辑:

I mean latency , not throughput 我的意思是延迟 ,而不是吞吐量

The lowest latency for receiving packets in Linux is, as you say, to bypass the Linux kernel, which requires special drivers. 如您所说,在Linux中接收数据包的最低延迟是绕过Linux内核,这需要特殊的驱动程序。 High-end network adapters from Mellanox, Solarflare, Myricom, Chelsio, etc. provide kernel bypass software. 来自Mellanox,Solarflare,Myricom,Chelsio等的高端网络适配器提供了内核旁路软件。 For example, Mellanox claims you can receive a packet in under 2 microseconds with their ConnectX-3 card and VMA 6.0 software 例如,Mellanox声称您可以使用他们的ConnectX-3卡和VMA 6.0软件在2微秒内收到数据包

This week Mellanox announced the newest version of its VMA 6.0 Messaging Accelerator, which includes enhanced TCP and UDP acceleration support over ConnectX-3 VPI adapter cards. 本周,Mellanox宣布了其VMA 6.0 Messaging Accelerator的最新版本,其中包括通过ConnectX-3 VPI适配器卡增强的TCP和UDP加速支持。 With ultra-low UDP latency under 1.4 microseconds and TCP socket latency under 1.7 microseconds, this messaging technology is reportedly more than two times faster than competitive offerings. 据报道,这种消息传递技术的UDP延迟低于1.4微秒,TCP套接字延迟低于1.7微秒,比竞争产品快两倍以上。

http://insidehpc.com/2012/01/10/interview-mellanox-vma-6-0-tackles-latency-for-high-frequency-trading/ http://insidehpc.com/2012/01/10/interview-mellanox-vma-6-0-tackles-latency-for-high-frequency-trading/

I would say that using PCap should be fast enough. 我会说使用PCap应该足够快。 They have also modified version for linux with improved performance - PF_RING / PF_RING DNA . 他们还修改了Linux版本,以提高性能-PF_RING / PF_RING DNA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM