A transmission method for zero copy network packet

A technology of network message and sending method, which is applied in the direction of data exchange network, store-and-forward exchange system, instrument, etc. It can solve the problems of low sending speed, waste of system resources, and inability to meet the speed requirements of high-speed network applications, and achieve a wide range of development environments. , save system resources, facilitate the effect of data transmission mechanism

Inactive Publication Date: 2008-03-26
DAWNING INFORMATION IND BEIJING
View PDF0 Cites 25 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The present invention aims at the problems in the prior art that the packets sent by the network card have to be copied to the user space through the kernel protocol stack, resulting in low packet sending speed, wasting system resources, and unable to meet the speed requirements of high-speed network applications for data copying, and provides a method for using The application can directly access the DMA buffer of the network card, thereby greatly improving the speed of network data transmission and meeting the zero-copy method of high-speed network applications

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A transmission method for zero copy network packet
  • A transmission method for zero copy network packet
  • A transmission method for zero copy network packet

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0019] Fig. 1 is a schematic diagram of the operation steps of the present invention. In the linux operating environment, as shown in Figure 1, the present invention performs the following steps:

[0020] A. The application program calls the open device function provided by the interface library. In this step, first open the network card device, determine the DMA buffer size and the percentage allocated to the sending queue, and set the receiving mode and sending mode; if the above operations are successful, the network card device ID will be returned.

[0021] B. Open the device interface function program to apply for a piece of continuous memory in the user space memory as a message buffer. And pass the first address of the buffer to the kernel driver.

[0022] In this step, check the maximum shared memory value initially set by the system. If the requested memory value is greater than the system default shared memory value, modify the system default memory value. Allocat...

Embodiment 2

[0031] The difference between this embodiment and Embodiment 1 is that the length of the message receiving buffer queue in step B of the present invention can be specified by a parameter, and the size of each buffer is 2KB. The buffer is located on a continuous memory page, and the memory requested by the interface library function is a shared memory, because in the Linux operating system, the shared memory is located on a continuous physical page. The specific operation steps are shown in Figure 2, as follows:

[0032] B1. The interface library function applies for a shared buffer and connects to the shared buffer.

[0033] B2. The interface library function transmits the first address of the shared buffer to the driver through the ioctl system call.

Embodiment 3

[0035] The difference between this embodiment and Embodiment 2 is that the specific operation steps of step C of the present invention are as shown in Figure 3, which are:

[0036] C1. The kernel driver calculates the size of the required buffer control structure according to the size of the entire buffer queue.

[0037] C2. The kernel driver applies for continuous pages to construct a buffer queue control structure.

[0038] C3. The kernel driver calculates the physical address of each buffer in the queue and stores it in a physical address table for DMA use.

[0039] C4. The kernel driver calculates the physical address of the buffer queue control structure and passes it to the application interface library function.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a zero copy network message sending method, which belongs to zero copy method fields that the memory of a user space is directly mapped into a DMA buffer of the network card. The invention comprises the operation steps as follows: A. the device interface is opened; B. a message buffer in the memory of the user space is applied; C. a buffer control structure is constructed; D. the information from the buffer control structure is received through mapping of the memory; E. the sent message data is directly DMA transferred into the message sending buffer; and F. the application program processes the message data. The invention is applicable for sending messages without zero copy protocol stack in high-speed network.

Description

technical field [0001] The invention relates to a computer network data sending method, in particular to a zero-copy network message sending method in which memory is directly mapped to a network card DMA buffer. Background technique [0002] What the computer operating system of prior art uses is layered thought, and the network card driver runs in the kernel layer, distributes the message buffer to the network card, and processes the data in the message buffer and the application data area through the soft interrupt when sending the message, and In the soft interrupt processing, the data transfer is realized through the protocol stack, so although this network data sending method ensures the versatility of the general operating system, because the data sending process of the prior art needs to be sent through the kernel, and It is not the direct transmission between the user memory and the network, so for the application on the high-speed network that requires high-speed t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04L12/54G06F13/28H04L12/861
Inventor 历军聂华曾宇刘朝辉
Owner DAWNING INFORMATION IND BEIJING
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products