“zero copy networking” vs “kernel bypass”?

后端 未结 4 1343
失恋的感觉
失恋的感觉 2020-12-02 06:30

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 w

4条回答
  •  遥遥无期
    2020-12-02 07:17

    Zero-copy networking

    You're doing zero-copy networking when you never copy the data between the user-space and the kernel-space (I mean memory space). By example:

    C language recv(fd, buffer, BUFFER_SIZE, 0);

    By default the data are copied:

    1. The kernel gets the data from the network stack
    2. The kernel copies this data to the buffer, which is in the user-space.

    With zero-copy method, the data are not copied and come to the user-space directly from the network stack.

    Kernel Bypass

    The kernel bypass is when you manage yourself, in the user-space, the network stack and hardware stuff. It is hard, but you will gain a lot of performance (there is zero copy, since all the data are in the user-space). This link could be interesting if you want more information.

提交回复
热议问题