H*****e 发帖数: 160 | 1 谁来说说ZERO COPY和KERNEL Bypass networking.看了些资料,还是不很清楚.比如说
,你自己管理网络STACK,Bypass Kernel,别人要用你的服务,用TCP连接,是
不是一定要用你的LIB呢?否则,你就得实现TCP,对不对? |
n****1 发帖数: 1136 | 2 没那么复杂, 用户态自旋锁+aio就能达到不错的性能. |
d***a 发帖数: 13752 | 3 我很久以前做过这个。正常的tcp/ip实现,发送数据时数据要先从user
space拷贝到kernel space,再由网卡发送出去。接受时反过来,也有一次
拷贝。zero-copy是为了消除这个拷贝。看网卡的支持,有的还会有额外的
一次拷贝。
实现上可以用user-level tcp/ip,当时的说法,大概就是你说的kernel
bypass networking。
【在 H*****e 的大作中提到】 : 谁来说说ZERO COPY和KERNEL Bypass networking.看了些资料,还是不很清楚.比如说 : ,你自己管理网络STACK,Bypass Kernel,别人要用你的服务,用TCP连接,是 : 不是一定要用你的LIB呢?否则,你就得实现TCP,对不对?
|
t**r 发帖数: 3428 | 4 需要网卡 load kernel module支持。
然后在userspace 处理ip packets.
根据需求做routing.
技术不难做起来很繁琐的 |
H*****e 发帖数: 160 | 5
我想可以用PACKET SOCKET + MMAP就可以实现0COPY,可是USRE LEVEL TCP怎么办?
【在 d***a 的大作中提到】 : 我很久以前做过这个。正常的tcp/ip实现,发送数据时数据要先从user : space拷贝到kernel space,再由网卡发送出去。接受时反过来,也有一次 : 拷贝。zero-copy是为了消除这个拷贝。看网卡的支持,有的还会有额外的 : 一次拷贝。 : 实现上可以用user-level tcp/ip,当时的说法,大概就是你说的kernel : bypass networking。
|
H*****e 发帖数: 160 | 6
routing 是指 ip routing?
【在 t**r 的大作中提到】 : 需要网卡 load kernel module支持。 : 然后在userspace 处理ip packets. : 根据需求做routing. : 技术不难做起来很繁琐的
|
d***a 发帖数: 13752 | 7 packet socket以前没有...
用packet socket和nmap后,程序可以直接处理packet数据吧
当然也可以在user space实现自己的tcp api
【在 H*****e 的大作中提到】 : : routing 是指 ip routing?
|
s*******m 发帖数: 58 | 8 Both Windows and Linux support zero-copy in kernel networking stack.
In Windows, it is implemented through a data structure called NetBufferList,
the data in the form of NetBufferList passes different layers of networking
stack, each layer makes some modification but the original payload is not
copied (so this is called zero-copy). Finally networking device driver copy
the payload inside NetBufferList to onboard buffer of network adapter and
then network adapter send the data.
Linux has mechanism very much like Windows.
Usually zero-copy refers to zero-copy in kernel mode. If your program uses
winsock, user data will be copied from user space to kernel space, so it is
not zero-copy. The only way to achieve user space zero-copy is (in windows)
to use direct I/O and winsock kernel API.
There is a "relatively" new technology called remote DMA, user data will
bypass the entire networking stack and be send directly by network adapter |
c****e 发帖数: 1453 | 9 kernel bypassing networking是说RDMA? 这个要网卡支持。 |
d*******r 发帖数: 3299 | |
y***l 发帖数: 72 | 11 楼主是要讨论RDMA service吗?目前InfiniBand, RoCE and iWARP 支持RDMA. 他们都
不需要更改tcp/ip stack. Infiniband and RoCE 可以使用IPoIB 和 SDP 进行协议转
换,iWARP需要使用TCP/IP offline engine.
【在 H*****e 的大作中提到】 : 谁来说说ZERO COPY和KERNEL Bypass networking.看了些资料,还是不很清楚.比如说 : ,你自己管理网络STACK,Bypass Kernel,别人要用你的服务,用TCP连接,是 : 不是一定要用你的LIB呢?否则,你就得实现TCP,对不对?
|