0 Copy (zero-copy)The main technology of realizing high-speed network interface of equipment such as host or router. 0 Copy technology reduces the operating system overhead and protocol processing overhead of data transmission by reducing or eliminating the operation of critical communication path impact rate, thus effectively improving communication performance and realizing high-speed data transmission.
0 Copy Technology can reduce the number of data copy and shared bus operation , eliminate unnecessary intermediate copying between the communication data in memory, effectively improve communication efficiency, and is one of the key technologies to design high-speed interface channel and realize high-speed server and router. The data copy is subject to the traditional operating system or communication protocol, which restricts the communication performance. With 0 copy technology, by reducing the number of copies of data, simplifying the level of protocol processing, providing faster data path between application and network, can effectively reduce communication delay and increase network throughput rate.
The research of 0 copy technology mainly focuses on the followingTwo aspects:(1) Create an effective user-level communication interface, that is, the application directly send data from the communication interface or receive, eliminate unnecessary copy process in the kernel of the system;(2) The direct data transfer from the end of the router to the end, that is, the received message only passes through a memory buffer, and the message in the buffer queue is transmitted directly to the output port after the necessary control information is sent out, and the message is forwarded quickly .
In general, it is considered that system calls from the NIC to the user space go through the copy process two or two times.
Zero copy is to eliminate these copy procedures.
Fromring-buffer to software packets copy of the NICCan be done by direct DMA data to software packet.
The so-called half times copy can have hardware checksum offload to solve.
The final kernel space to the user space copy still has the problem, recently proposed the relatively good scheme is the IOAT2 technology, may directly do the host memeory to the host Memroy DMA.
also see someone using solution for direct map of DMA buffer to user space , but the program for user space is not transparent and has no universal meaning.
0 Copy Concept-Linux kernel