CN110086571A - A kind of data transmission and received method, apparatus and data processing system - Google Patents

A kind of data transmission and received method, apparatus and data processing system Download PDF

Info

Publication number
CN110086571A
CN110086571A CN201910285983.0A CN201910285983A CN110086571A CN 110086571 A CN110086571 A CN 110086571A CN 201910285983 A CN201910285983 A CN 201910285983A CN 110086571 A CN110086571 A CN 110086571A
Authority
CN
China
Prior art keywords
network interface
interface card
target data
port numbers
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910285983.0A
Other languages
Chinese (zh)
Inventor
余冠彬
杨望重
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201910285983.0A priority Critical patent/CN110086571A/en
Publication of CN110086571A publication Critical patent/CN110086571A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

This application discloses a kind of transmission of data and received method, apparatus and data processing system, applied in NIC driver, the NIC driver is located at user's state space of operating system, the described method includes: reading the target data of network interface card write-in from network interface card shared drive, wherein, the network interface card shared drive is the core buffer for the network interface card that this driver and network interface card are shared;Determine the decapsulation information of the target data, the decapsulation information includes destination slogan;According to the decapsulation information, the target data is decapsulated, wherein the process of the decapsulation includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered port numbers;When passed the verification, then the target data of decapsulation is sent in target service process.The present embodiment can be carried out data transmission with the kernel state space of workaround system, to reduce the utilization rate of CPU.

Description

A kind of data transmission and received method, apparatus and data processing system
Technical field
This application involves at data processing field more particularly to a kind of transmission of data and received method, apparatus and data Reason system.
Background technique
With the development of network technology, network direct broadcasting is more more and more universal, and miscellaneous social activities can be by net Network direct-seeding is propagated.
In the distribution network of live streaming, in order to reduce the time delay of transmission, UDP (User Datagram generally can be all used Protocol, User Datagram Protocol) transmission mode.As business increases, the UDP flow amount of server handling capacity at peak Can be very big, so that occupying more cpu resource when server carries out the processing of UDP message packet, influence cpu performance.
Summary of the invention
In view of this, the application provides a kind of data transmission and received method, apparatus and data processing system.
According to the embodiment of the present application in a first aspect, providing a kind of method of data receiver, the method is applied to network interface card In driver, the NIC driver is located at user's state space of operating system, which comprises
The target data of network interface card write-in is read from network interface card shared drive, wherein the network interface card shared drive is this driving The core buffer for the network interface card that program and network interface card are shared;
Determine the decapsulation information of the target data, the decapsulation information includes destination slogan;
According to the decapsulation information, the target data is decapsulated, wherein the process of the decapsulation includes Checking procedure, the checking procedure include: whether the verification destination slogan is registered port numbers;
When passed the verification, then the target data of decapsulation is sent in target service process.
According to the second aspect of the embodiment of the present application, a kind of method that data are sent is provided, the method is applied to network interface card In driver, the NIC driver is located at user's state space of operating system, which comprises
For each registered port numbers in preset registered port numbers list, in the corresponding user sharing of the registered port numbers It deposits and is polled, to determine target data that whether target service process is written in the user sharing memory, wherein described The core buffer that this driver is shared with the target service process is saved as in user sharing, which is described The port numbers that target service process is registered to this driver;
If so, reading the target data;
Obtain the corresponding packaging information of the target data;
Network interface card shared drive is written into the target data and the packaging information, so that network interface card is according to the encapsulation Target data described in delivering, wherein the network interface card shared drive is the network interface card that this driver and network interface card are shared Core buffer.
According to the third aspect of the embodiment of the present application, a kind of method that data are sent is provided, the method is applied to network interface card In driver, the NIC driver is located at user's state space of operating system, which comprises
When detecting that target data is written in network interface card shared drive in target service process, the target service process is judged Whether corresponding port numbers are registered port numbers;Wherein, the network interface card shared drive is that this driver and network interface card are shared The network interface card core buffer;
If so, obtaining the corresponding packaging information of the target data;
The network interface card shared drive is written into the packaging information, so that network interface card is according to packaging information sending Target data.
According to the fourth aspect of the embodiment of the present application, a kind of data sink is provided, described device is driven applied to network interface card In dynamic program, the NIC driver is located at user's state space of operating system, and described device includes:
Data read module, for reading the target data of network interface card write-in from network interface card shared drive, wherein the network interface card Shared drive is the core buffer for the network interface card that this driver and network interface card are shared;
Information determination module is decapsulated, for determining the decapsulation information of the target data, the decapsulation packet Include destination slogan;
Decapsulation module, for being decapsulated to the target data, wherein described according to the decapsulation information The process of decapsulation includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered end Slogan;
Data transmission blocks, for when passed the verification, then the target data of decapsulation being sent to target service process In.
According to the 5th of the embodiment of the present application the aspect, a kind of data sending device is provided, described device is driven applied to network interface card In dynamic program, the NIC driver is located at user's state space of operating system, and described device includes:
Poller module, for being directed to each registered port numbers in preset registered port numbers list, to the registered port numbers pair The user sharing memory answered is polled, to determine target that whether target service process is written in the user sharing memory Data, wherein the core buffer that this driver is shared with the target service process, the note are saved as in the user sharing Volume port numbers are the port numbers that the target service process is registered to this driver;If so, invocation target reading data mould Block;
Target data read module, for reading the target data;
Packaging information obtains module, for obtaining the corresponding packaging information of the target data;
Information writing module, for network interface card shared drive to be written in the target data and the packaging information, so that It obtains network interface card and the target data is issued according to the packaging information, wherein the network interface card shared drive is this driver and net The core buffer of the shared network interface card of card.
According to the 6th of the embodiment of the present application the aspect, a kind of data sending device is provided, described device is driven applied to network interface card In dynamic program, the NIC driver is located at user's state space of operating system, and described device includes:
Port numbers judgment module detects that target data is written in network interface card shared drive in target service process for working as When, judge whether the corresponding port numbers of target service process are registered port numbers;Wherein, the network interface card shared drive is The core buffer for the network interface card that this driver and network interface card are shared;If so, packaging information is called to obtain module;
Packaging information obtains module, for obtaining the corresponding packaging information of the target data;
Packaging information writing module, for the network interface card shared drive to be written in the packaging information, so that network interface card root The target data is issued according to the packaging information.
According to the 7th of the embodiment of the present application the aspect, a kind of data processing system is provided, the data processing system includes NIC driver and target service process in operating system user's state space, the NIC driver execute program Shi Shixian claim 1-7 or the step of any one of 8-10 or 11-12 the method.
According to the eighth aspect of the embodiment of the present application, provide a kind of electronic equipment, including memory, NIC driver and The computer program that can be run on a memory and in NIC driver is stored, the NIC driver executes the journey The step of above method is realized when sequence.
According to the 9th of the embodiment of the present application the aspect, a kind of computer readable storage medium is provided, calculating is stored thereon with Machine program, described program are performed the step of realizing the above method.
Scheme provided by the present application has the following beneficial effects:
In the present embodiment, the target of network interface card write-in is read positioned at the NIC driver of user's state space of operating system After data, the decapsulation information comprising destination slogan that available target data carries, and according to decapsulation information pair Target data is decapsulated.The process wherein decapsulated may include whether verification destination slogan is registered port numbers Etc. checking procedures, when passed the verification, the target data of decapsulation is then sent in target service process by NIC driver. To realize the process of data decapsulation in NIC driver, the performance of NIC driver is improved.And entire deblocking Dress process is in the completion of user's state space, so that the kernel state space of the transmission workaround system of data, realizes data Bottom transmission optimization, the performance of lifting means reduces the utilization rate of CPU in equipment.
In addition, the present embodiment by between NIC driver and target service process be arranged user sharing memory come into The data transmission of row between the two, the mode that shared drive is uniformly accessed into can reduce NIC driver and target service process it Between the degree of coupling, the upgrading of NIC driver and logic Modification have substantially no effect on target service process, because of user sharing The read-write mode of memory is constant, and target service process does not just have to change substantially, and the performance for calculating equipment is promoted with this.
In addition, NIC driver can also be directly corresponding by target data write-in destination slogan in the present embodiment In packet receiving queue, reduce the number of data copy, improves the efficiency of transmission of target data.
Detailed description of the invention
Fig. 1 is the equipment configuration diagram 1 shown in one exemplary embodiment of the application;
Fig. 2 is a kind of step flow chart of the embodiment of the method for data receiver shown in one exemplary embodiment of the application;
Fig. 3 is the step process of the embodiment of the method for another data receiver shown in one exemplary embodiment of the application Figure;
Fig. 4 is the packet receiving timing diagram 1 shown in one exemplary embodiment of the application;
Fig. 5 is the step process of the embodiment of the method for another data receiver shown in one exemplary embodiment of the application Figure;
Fig. 6 is the packet receiving timing diagram 2 shown in one exemplary embodiment of the application;
Fig. 7 is the step process of the embodiment of the method for another data receiver shown in one exemplary embodiment of the application Figure;
Fig. 8 is the packet receiving timing diagram 3 shown in one exemplary embodiment of the application;
Fig. 9 is the equipment architecture diagram 2 shown in one exemplary embodiment of the application;
Figure 10 is the step flow chart for the embodiment of the method that a kind of data shown in one exemplary embodiment of the application are sent;
Figure 11 is the timing diagram 1 of giving out a contract for a project shown in one exemplary embodiment of the application;
Figure 12 is the step process for the embodiment of the method that another data shown in one exemplary embodiment of the application are sent Figure;
Figure 13 is the timing diagram 2 of giving out a contract for a project shown in one exemplary embodiment of the application;
Figure 14 is the step process for the embodiment of the method that another data shown in one exemplary embodiment of the application are sent Figure;
Figure 15 is the timing diagram 3 of giving out a contract for a project shown in one exemplary embodiment of the application;
Figure 16 is the test and comparison schematic diagram in the different data transmission plan shown in one exemplary embodiment of the application;
Figure 17 is a kind of structural block diagram of data sink embodiment shown in one exemplary embodiment of the application;
Figure 18 is a kind of structural block diagram of data sending device embodiment shown in one exemplary embodiment of the application;
Figure 19 is the structural block diagram of another data sending device embodiment shown in one exemplary embodiment of the application;
Figure 20 is a kind of structural block diagram of data processing system embodiment shown in one exemplary embodiment of the application.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application. It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
The embodiment of the present application can be applied in NIC driver, wherein the NIC driver is located at operating system User's state space.
In the embodiment of the present application, NIC driver can be for based on DPDK (Data Plane Development Kit, data plane development kit) driver.DPDK is that a kind of function library of high speed data processing and driving are gathered, can be with Data processing performance and handling capacity is greatly improved, improves the working efficiency of data plane application program.
Illustratively, which can include but is not limited to linux system.
Illustratively, electronic equipment locating for the NIC driver in the present embodiment can include but is not limited to service Device, such as the biggish server of packet throughput.
In the present embodiment, NIC driver can be used for connecting network interface card and target service process, such as the equipment of Fig. 1 Shown in configuration diagram 1, the data between target service process, NIC driver and network interface card can pass through user's state space Quick transmission channel transmitted so that the transmission process of data can realize number with workaround system kernel state space According to bottom transmission optimization, improve the performance of the electronic equipment of big handling capacity, reduce the utilization rate of CPU in equipment.
Illustratively, target service process can be the application program with specified services processing logic, for example, can lead to It crosses target business process and carries out transcoding processing.
Network interface card is also named " network adapter ", and full name in English is " Network Interface Card ", referred to as " NIC ", net Card is one of component most basic in local area network, it is the hardware device for connecting computer and network.Either twisted pair line connection, Coaxial cable connection or optical fiber connection, it is necessary to the communication of data is just able to achieve by means of network interface card.Network interface card is according to data link Layer control is to divide including Ethernet card, token ring network interface card, ATM (Asynchronous Transfer Mode, asynchronous transmission mould Formula) network interface card etc.;Classifying according to physical layer has wireless network card, RJ-45 network interface card, coaxial cable network interface card, light network interface card etc., this implementation Example to the concrete type of network interface card with no restriction.
It should be noted that quickly transmission channel can encapsulate in such a way that system is called, or pass through privately owned association View encapsulation, the present embodiment to this with no restriction.
Equipment configuration diagram based on Fig. 1, the mistake that NIC driver is carried out data transmission by following embodiment Journey is illustrated:
With reference to Fig. 2, a kind of step of the embodiment of the method for data receiver shown in one exemplary embodiment of the application is shown Rapid flow chart, can specifically include following steps:
Step 101, the target data of network interface card write-in is read from network interface card shared drive.
Illustratively, target data can be for based on udp protocol, Transmission Control Protocol (Transmission Control Protocol, transmission control protocol) etc. agreements data, which may include audio, video data, signaling data etc..
In this step, network interface card shared drive is NIC driver and the memory buffer positioned at network interface card that network interface card is shared Area.Illustratively, network interface card shared drive may include FIFO (First Input First Output, first in first out) buffering Area, buffer circle Ring Buffer (when using to the end of buffer area, start the cycle over use from Buffer again Buffer area) etc..
It should be noted that network interface card shared drive belongs to the memory of network interface card, it is both not belonging to kernel state space, has also been not belonging to User's state space, it belongs to hardware buffer, is network interface card and the buffer area that NIC driver is shared.In trawl performance initialization When, a network interface card shared drive is distributed in the memory of network interface card, this network interface card shared drive is to receive data to network interface card to make , due to being to transmit data to the DMA of network interface card (Direct Memory Access, direct memory access), so net Card shared drive can be the continuous memory of physics.
A kind of scene that possible network interface card receives data is as follows in the present embodiment: data packet packet on cable first by Network interface card obtains, and network interface card can check CRC (Cyclic Redundancy Check, the cyclic redundancy check) verification of packet, guarantees Then the integrality of data is removed packet, frame frame is obtained.Network interface card can also check the target MAC (Media Access Control) address in MAC packet, If with the MAC Address of this network interface card it is different if abandon (except promiscuous mode).Network interface card by frame copy to network interface card it is shared in Deposit, when the data in network interface card shared drive are a complete data packets, network interface card trigger hardware interrupts or software interrupt (if it is Ring Buffer then triggers software interrupt), to notify NIC driver to receive target data.
After NIC driver detects interruption, then target data is read from network interface card shared drive.In a kind of possibility Embodiment in, NIC driver can come out target data copies, and execute step 102.
Step 102, the decapsulation information of the target data is determined.
The NIC driver of the present embodiment can integrate OSI (Open System Interconnect, open system Interconnection) interrelated logic of data link layer, network layer and transport layer in reference model, complete Correlation method for data processing function.
The present embodiment can be applied to the scene of data decapsulation, can first pass through the solution that step 102 obtains target data Packaging information.In one embodiment, decapsulation information can be obtained by obtaining the control information that target data carries.
As an example, decapsulation information can include but is not limited to: destination slogan, purpose physical address, purpose The information such as IP address.
Wherein, port numbers are for marking port.Port includes physical port and logic port, and physical port is for connecting Interface between physical equipment, logic port are the ports for being used for Differentiated Services in logic.Port in ICP/IP protocol is exactly Logic port distinguishes different services by different logic ports.It is compiled by 16bit the port of one IP address Number, it can have up to 65536 ports.Illustratively, the destination slogan in the present embodiment can be the port of logic port Number, the logic port is for distinguishing different business process.
Address, also known as network interface card are physically for physical address, that is, MAC (Media Access Control, medium access control) Location refers to the unique address of the whole network being solidificated in network interface card EPROM (a kind of flash chip, usually can be erasable by program), It is that host is identified by physical address during the physical transfer of network bottom layer.For example, the physical address of Ethernet card Size is 48bit (bit), and first 24 are supplier numbers, and latter 24 are numbered for network interface card.
IP address (Internet Protocol Address, Internet protocol address) is a kind of system that IP agreement provides One address format, it is one logical address of each network and each host assignment on internet, is shielded with this The difference of physical address.
Step 103, according to the decapsulation information, the target data is decapsulated.
In this step, NIC driver can decapsulate target data according to decapsulation information.
In a kind of possible embodiment, the process of decapsulation may include checking procedure, illustratively, the verification Journey at least may include following process:
Purpose physics address check, with judge the purpose physical address whether be network interface card physical address.
Purpose IP address verification, with judge the destination IP address whether be locating host IP address.
Port numbers verification, to judge whether the destination slogan is registered port numbers.
Verification and verification, with verify the target data verification and whether correctly.
It illustratively, can be by the purpose physical address of acquisition and the object of network interface card when carrying out purpose physics address check Reason address is matched, and judges whether the two is consistent, if unanimously, verification passes through, continues to execute the mistake of purpose IP address verification Journey;If inconsistent, the target data is abandoned.
It should be noted that the process of above-mentioned purpose physical address verification is not limited to execute in NIC driver, It can be executed in network interface card, when network interface card judges purpose physical address for the physical address of this network interface card, then to network interface card shared drive Target data is written, otherwise abandons the target data.
It, can host locating for the purpose IP address and NIC driver by acquisition when carrying out purpose IP address verification IP address matched, whether consistent both judge, if unanimously, verification passes through, continue to execute the process of port numbers verification; If inconsistent, the target data is abandoned.
In a verification scene, the process of port numbers verification may include judging whether destination slogan is registered Port numbers.Wherein, registered port numbers refer to the port numbers registered in NIC driver, the registered port numbers It can be carried out data transmission by quick transmission channel for characterizing the corresponding business process of the port numbers.
It is above-mentioned to judge whether destination slogan is registered port numbers in a kind of possible embodiment, it can wrap Include following sub-step:
The destination slogan is searched from registered port numbers list;If searching successfully, the destination slogan is determined For registered port numbers;If searching failure, determining the destination slogan not is registered port numbers.
Specifically, NIC driver can safeguard a registered port numbers list, recording in the registered port numbers list has Multiple registered port numbers.When purpose physics address check and purpose IP address verification all pass through, NIC driver During carrying out port numbers verification, destination slogan can be searched in registered port numbers list, if searching successfully, table Show that the destination slogan is the port numbers that target service process has been registered to NIC driver;If searching failure, mesh is determined Port numbers be the port numbers that do not register.
In a kind of possible embodiment, registered port numbers list can generate in the following way:
The registration information that each business process is written in preset public buffer area is received, the registration information includes described The corresponding port numbers of business process;The port numbers of registration are recorded into port numbers list.
The present embodiment can preset a public buffer area for being registered for business process, illustratively, should Public buffer area can be fifo queue or other common buffer.
When business process is needed through quick transmission channel to transmit data, can be infused in NIC driver Volume, one of registration process includes the registration information being written in public buffer area.As an example, the registration information is extremely It less may include the corresponding port numbers of business process.After NIC driver receives the registration information, then by the end of registration It is safeguarded in slogan write-in port numbers list.
When business process is not needed using quick transmission channel, then can send to NIC driver includes port numbers Log-off message, NIC driver can delete corresponding port numbers according to the log-off message from port numbers list.
For business process, it can be decided whether to infuse to NIC driver according to the type of service of its processing Volume port numbers, for example, for the business process of processing UDP message packet, then it can be to NIC driver registered port numbers.
, can with the verification of verification object data and whether correctly during above-mentioned verification and (checksum) are verified. Checksum refers to the cumulative of transmission digit, and when transfer is finished, recipient can judge whether to be connected to according to this numerical value All data.If values match, illustrate that transmission has been completed.In a kind of possible realization, NIC driver By received target data (including inspection and field) by the complement code and operation of the same method progress 1 of sender, cumulative knot Fruit negates code again.If obtained result is 0, indicate that transmission is correct;Otherwise, illustrate that transmission has mistake.
Step 104, when passed the verification, then the target data of decapsulation is sent in target service process.
In this step, when the check results of above-mentioned checking procedure be all verification by (verifying successfully) result when, then net The target data of decapsulation can be sent in the corresponding target service process of destination slogan by card driver, to complete to solve Encapsulation process.
In the present embodiment, the target of network interface card write-in is read positioned at the NIC driver of user's state space of operating system After data, the decapsulation information comprising destination slogan that available target data carries, and according to decapsulation information pair Target data is decapsulated.The process wherein decapsulated may include whether verification destination slogan is registered port numbers Etc. checking procedures, when passed the verification, the target data of decapsulation is then sent in target service process by NIC driver. To realize the process of data decapsulation in NIC driver, the performance of NIC driver is improved.And entire deblocking Dress process is in the completion of user's state space, so that the kernel state space of the transmission workaround system of data, realizes data Bottom transmission optimization, the performance of lifting means reduces the utilization rate of CPU in equipment.
With reference to Fig. 3, the embodiment of the method for another data receiver shown in one exemplary embodiment of the application is shown Flow chart of steps is sent to the mistake of target service process in conjunction with the packet receiving timing diagram 1 of Fig. 4 in the present embodiment to target data Cheng Jinhang more specific description (in Fig. 4, network interface card shared drive is not showed that), the present embodiment can specifically include following step It is rapid:
Step 201, the target data of network interface card write-in is read from network interface card shared drive.
Step 202, the decapsulation information of the target data is determined.
As an example, decapsulation information can include but is not limited to: destination slogan, purpose physical address, purpose The information such as IP address.
Step 203, according to the decapsulation information, the target data is decapsulated, wherein the decapsulation Process includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered port numbers.
In this step, NIC driver can decapsulate target data according to decapsulation information.
In a kind of possible embodiment, the process of decapsulation may include checking procedure, illustratively, the verification Journey at least may include following process:
Purpose physics address check, with judge the purpose physical address whether be network interface card physical address.
Purpose IP address verification, with judge the destination IP address whether be locating host IP address.
Port numbers verification, to judge whether the destination slogan is registered port numbers.
Verification and verification, with verify the target data verification and whether correctly.
Step 204, when passed the verification, user corresponding to the destination slogan is written into the target data of decapsulation In shared drive, the core buffer that this driver is shared with target service process is saved as in the user sharing, by institute State the target data that target service process reads the decapsulation from the user sharing memory.
In the present embodiment, NIC driver is carried out data transmission with target service process by user sharing memory. Wherein, memory headroom that NIC driver creates in user's state space, sharing with business process is saved as in user sharing.
In one implementation, NIC driver can be created according to the process identification (PID) of port numbers or business process Build the user sharing memory shared with business process.
After NIC driver decapsulates target data, it can search or create and be somebody's turn to do according to destination slogan The corresponding user sharing memory of destination slogan, as the corresponding user sharing memory of target service process.It then will decapsulation Target data be written in the user sharing memory.
For target service process, it can be read from its corresponding user sharing memory by way of poll Then target data is handled the target data in packet receiving queue into the packet receiving queue of this process.Certain the present embodiment It is not limited to this, NIC driver can also notify target service process to fetch into user sharing memory by informing mechanism According to.
The present embodiment carries out two by the way that user sharing memory is arranged between NIC driver and target service process Data transmission between person, the mode that shared drive is uniformly accessed into can reduce between NIC driver and target service process The degree of coupling, the upgrading of NIC driver and logic Modification have substantially no effect on target service process, because of user sharing memory Read-write mode it is constant, target service process substantially just do not have to change, with this promoted calculate equipment performance.
With reference to Fig. 5, the embodiment of the method for another data receiver shown in one exemplary embodiment of the application is shown Flow chart of steps is sent to the mistake of target service process in conjunction with the packet receiving timing diagram 2 of Fig. 6 in the present embodiment to target data Cheng Jinhang more specific description (in Fig. 6, network interface card shared drive is not showed that), the present embodiment can specifically include following step It is rapid:
Step 301, the target data of network interface card write-in is read from network interface card shared drive.
Step 302, the decapsulation information of the target data is determined.
As an example, decapsulation information can include but is not limited to: destination slogan, purpose physical address, purpose The information such as IP address.
Step 303, according to the decapsulation information, the target data is decapsulated, wherein the decapsulation Process includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered port numbers.
In this step, NIC driver can decapsulate target data according to decapsulation information.
In a kind of possible embodiment, the process of decapsulation may include checking procedure, illustratively, the verification Journey at least may include following process:
Purpose physics address check, with judge the purpose physical address whether be network interface card physical address.
Purpose IP address verification, with judge the destination IP address whether be locating host IP address.
Port numbers verification, to judge whether the destination slogan is registered port numbers.
Verification and verification, with verify the target data verification and whether correctly.
Step 304, when passed the verification, the corresponding packet receiving team of the destination slogan is written into the target data of decapsulation In column, to read the target data from the packet receiving queue by the corresponding target service process of the destination slogan.
It in the present embodiment, can be directly by decapsulation after NIC driver decapsulates target data Target data is written in the corresponding packet receiving queue of destination slogan, directly to read mesh from packet receiving queue by target service process Mark data.
The difference of the embodiment of the present embodiment and Fig. 3 is: the present embodiment does not need to carry out by user sharing memory Data transmission, NIC driver directly by the corresponding packet receiving queue of target data write-in destination slogan, reduce data The number of copy improves the efficiency of transmission of target data.
With reference to Fig. 7, the embodiment of the method for another data receiver shown in one exemplary embodiment of the application is shown Flow chart of steps, in the present embodiment, the packet receiving timing diagram 3 in conjunction with Fig. 8 are not registered port numbers to destination slogan Data receiver scene is illustrated, and the present embodiment can be used for transmitting non-UDP message (such as the number of TCP and some other agreements According to), it can specifically include following steps:
Step 401, the target data of network interface card write-in is read from network interface card shared drive.
Step 402, the decapsulation information of the target data is determined.
As an example, decapsulation information can include but is not limited to: destination slogan, purpose physical address, purpose The information such as IP address.
Step 403, according to the decapsulation information, the target data is decapsulated, wherein the decapsulation Process includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered port numbers.
In this step, NIC driver can decapsulate target data according to decapsulation information.
In a kind of possible embodiment, the process of decapsulation may include checking procedure, illustratively, the verification Journey at least may include following process:
Purpose physics address check, with judge the purpose physical address whether be network interface card physical address.
Purpose IP address verification, with judge the destination IP address whether be locating host IP address.
Port numbers verification, to judge whether the destination slogan is registered port numbers.
Verification and verification, with verify the target data verification and whether correctly.
Step 404, when determining the destination slogan not is registered port numbers, the target data is sent to The packet receiving queue for the kernel forwarding module being connect with this driver, to be passed through the target data by the kernel forwarding module It is sent in the corresponding target service process of the destination slogan by Microsoft Loopback Adapter connected to it driving.
In the present embodiment, kernel forwarding module and Microsoft Loopback Adapter driving are in the kernel state space of operating system.Such as Shown in the equipment architecture diagram 2 of Fig. 9, NIC driver and target service process can also carry out data by normal transmission channel Transmission.When NIC driver determines that destination slogan is not registered port numbers, then pass through normal transmission channel for mesh Mark data are sent in target service process.
When realizing, as shown in figure 9, target data can will be sent to connecing for kernel forwarding module by NIC driver Queue is received, kernel forwarding module obtains target data from receiving queue, and target packet is sent to Microsoft Loopback Adapter driving. Microsoft Loopback Adapter driving is located at data link layer in the present embodiment, by checking target MAC (Media Access Control) address judges whether it is oneself needs The data of processing then abandon the target data if it find that MAC Address is inconsistent with oneself, unanimously just remove MAC information and send Its IP address is judged to network layer (L3 agreement), it is then true according to the destination slogan of target data by transport layer (L4 agreement) Surely it is which business process by the machine come processing target data, and target data is sent to mesh in such a way that system is called It marks in business process.
The present embodiment can be adapted for data packet protocol stack is more complicated or the quantity of data packet is not too many number According to transmitting scene, or the scene suitable for transmitting data failure by quick transmission channel, by kernel come processing target data, The realization difficulty of the NIC driver of User space can be reduced.
With reference to Figure 10, the step for the embodiment of the method that a kind of data shown in one exemplary embodiment of the application are sent is shown Rapid flow chart, in the present embodiment, in conjunction with Figure 11 give out a contract for a project timing diagram 1 to by quick transmission channel issue target data mistake Journey is illustrated, and the present embodiment can specifically include following steps:
Step 501, for each registered port numbers in preset registered port numbers list, use corresponding to the registered port numbers Family shared drive is polled, to determine target data that whether target service process is written in the user sharing memory.
In this step, the core buffer that NIC driver and target service process are shared is saved as in user sharing. Illustratively, which can be identified with registered port numbers.
Wherein, registered port numbers are the port numbers that target service process is registered to NIC driver, which is used for Characterize target service process.
A registered port numbers list can be safeguarded in NIC driver, have recorded one in the registered port numbers list Or multiple registered port numbers, each registered port numbers have corresponding user sharing memory.NIC driver passes through to each note Whether the corresponding user sharing memory of volume port numbers is polled, to judge the corresponding business process of the registered port numbers in the use Target data is written in the shared drive of family.
In a kind of possible embodiment of the present embodiment, registered port numbers list can generate in the following way:
The registration information that each business process is written in preset public buffer area is received, the registration information includes described The corresponding port numbers of business process;The port numbers of registration are recorded into port numbers list.
The present embodiment can preset a public buffer area for being registered for business process, illustratively, should Public buffer area can be fifo queue or other common buffer.
When business process is needed through quick transmission channel to transmit data, can be infused in NIC driver Volume, one of registration process includes the registration information being written in public buffer area.As an example, the registration information is extremely It less may include the corresponding port numbers of business process.After NIC driver receives the registration information, then by the end of registration Slogan is written in port numbers list as registered port numbers and is safeguarded.
When business process is not needed using quick transmission channel, then can send to NIC driver includes port numbers Log-off message, NIC driver can delete corresponding port numbers according to the log-off message from port numbers list.
Step 502, the target data of target service process write-in is read from user sharing memory;
When NIC driver, which determines, has target data in user sharing memory, then read from the user sharing memory Target data out.
Step 503, the corresponding packaging information of the target data is obtained;
In this step, NIC driver can obtain its corresponding packaging information according to target data.As one kind Example, packaging information can include but is not limited to: source port number, destination slogan, source IP address, purpose IP address, source physics Address and purpose physical address etc..
In a kind of possible embodiment of the present embodiment, step 503 may include following sub-step:
Sub-step S11 obtains the source port number, the destination slogan, the source IP that the target data carries Address, the destination IP address and the source physical address.
It, can be with when target data is written in target service process in user sharing memory in a kind of possible scene Carry the source port number (i.e. the corresponding port numbers of target service process) of the target data, destination slogan (will be sent to Port numbers), source IP address (IP address of host i.e. where target service process), the purpose IP address (host that will be sent to IP address) and information such as source physical address (MAC Address of Network Card of host i.e. where target service process).
Then NIC driver can obtain target data carrying when obtaining target data from user sharing memory The information such as source port number, destination slogan, source IP address, purpose IP address and source physical address.
Sub-step S12 searches the destination IP address in preset cache table and executes sub-step if searching successfully S13 executes sub-step S14 if searching failure.
Sub-step S13 obtains purpose physical address corresponding with the destination IP address from the cache table.
Sub-step S14 obtains the purpose object according to the destination IP address by the way of Address Resolution Protocol ARP Manage address.
Illustratively, the mapping relations of multiple IP address with corresponding physical address be can store in cache table.Determine mesh IP address after, the purpose IP address can be searched in cache table first and is directly obtained in cache table if searching successfully Obtain purpose physical address corresponding with purpose IP address.It, can be according to the purpose IP address, using ARP if searching failure The mode of (Address Resolution Protocol, address resolution protocol) obtains purpose physical address.
In one example, the working principle of ARP is: by the ARP request comprising purpose IP address when host transmission information The All hosts being broadcast on network, and return message is received, purpose physical address is determined with this;Receiving should after returning to message Purpose IP address and purpose physical address are stored in the cache table of the machine and retain certain time, and directly inquiry is slow when next time requests Table is deposited to economize on resources.
Step 504, network interface card shared drive is written into the target data and the packaging information so that network interface card according to The packaging information issues the target data.
It, can be by target data and encapsulation after NIC driver obtains target data and corresponding packaging information Information is inserted in network interface card shared drive, wherein network interface card shared drive is the memory for the network interface card that NIC driver is shared with network interface card Buffer area.
In a kind of possible embodiment, target data and corresponding packaging information are inserted net by NIC driver Mode in card shared drive can be with are as follows: NIC driver is the header information that target data addition includes packaging information, structure Framing frame, and copy frame to network interface card shared drive, it is handled by network interface card.
The frame not being fully finished (scarce CRC) is encapsulated as by network interface card after listening to network interface card shared drive write-in data The data packet packet that can be sent, such as addition head synchronizing information and CRC check, are then sent out target data by cable It sees off.
In the present embodiment, NIC driver is polled to the corresponding user sharing memory write-in number of targets of registered port numbers After accordingly, the target data is read, and obtains the corresponding packaging information of target data, then believes target data and its encapsulation Breath write-in network interface card shared drive, is sent target data according to packaging information by network interface card.Entire data transmission procedure with Family state space is completed, and the kernel state space of operating system has been bypassed, and realizes the bottom transmission optimization of data, promotes trawl performance The performance of program reduces the utilization rate of CPU in equipment.
With reference to Figure 12, the embodiment of the method that another data shown in one exemplary embodiment of the application are sent is shown Flow chart of steps issues target data to by quick transmission channel in conjunction with the timing diagram 2 of giving out a contract for a project of Figure 13 in the present embodiment Process is illustrated, and the present embodiment can specifically include following steps:
Step 601, when detecting that target data is written in network interface card shared drive in target service process, judge the target Whether the corresponding port numbers of business process are registered port numbers.
In this step, network interface card shared drive is the core buffer for the network interface card that NIC driver is shared with network interface card.
In the present embodiment, target data, trawl performance can be directly written in target service process in network interface card shared drive Program can detect whether target service process in network interface card shared drive is written target data by way of poll.Work as inspection When measuring target data, then NIC driver can obtain source port number (i.e. target from the information that the target data carries The port numbers of business process), then judge whether the corresponding port numbers of target service process are registered port numbers.
In a kind of possible embodiment of the present embodiment, judge the corresponding port numbers of target service process whether be The step of registered port numbers may include following sub-step:
The corresponding port numbers of target service process are searched from registered port numbers list;If searching successfully, determining should Port numbers are registered port numbers;If searching failure, determining the port numbers not is registered port numbers.
Specifically, NIC driver can safeguard a registered port numbers list, recording in the registered port numbers list has Multiple registered port numbers.NIC driver can search the port of target service process in registered port numbers list Number, if searching successfully, then it represents that the port numbers are the port numbers that target service process has been registered to NIC driver;If searching Failure, then determine that the port numbers are the port numbers that do not register.
In a kind of possible embodiment, registered port numbers list can generate in the following way:
The registration information that each business process is written in preset public buffer area is received, the registration information includes described The corresponding port numbers of business process;The port numbers of registration are recorded into port numbers list.
Step 602, if the corresponding port numbers of target service process are registered port numbers, the number of targets is obtained According to corresponding packaging information;
It, then can be into when NIC driver detects that the corresponding port numbers of target service process are registered port numbers One step obtains the corresponding packaging information of target data.As an example, packaging information can include but is not limited to: source port Number, destination slogan, source IP address, purpose IP address, source physical address and purpose physical address.
In a kind of possible embodiment of the present embodiment, step 602 may include following sub-step:
Obtain the source port number, the destination slogan, the source IP address, the mesh that the target data carries IP address and the source physical address;The destination IP address is searched in preset cache table, wherein the cache table Store the mapping relations of multiple IP address with corresponding physical address;If searching successfully, obtained from the cache table and institute State the corresponding purpose physical address of purpose IP address;If searching failure, according to the destination IP address, assisted using address resolution The mode of view ARP obtains the purpose physical address.
Step 603, the network interface card shared drive is written into the packaging information, so that network interface card is according to the packaging information Issue the target data.
In a kind of possible embodiment of the present embodiment, step 603 is specifically as follows:
The network interface card shared drive is written into the purpose physical address.
Since target service process is by target data and source port number, destination slogan, source IP address, destination IP In address and source physical address write-in network interface card shared drive, then after NIC driver acquisition packaging information, it is only necessary to will Purpose physical address is written in network interface card function memory, so as to reduce the number of data copy.
The difference of the embodiment of the present embodiment and Figure 10 is: target service process can be used as answering for NIC driver With, directly access NIC driver.The present embodiment does not need to obtain target data, trawl performance by user sharing memory After program obtains the purpose physical address of target data, it is only necessary to network interface card shared drive is written in purpose physical address, is reduced The number of data copy improves the efficiency of transmission of target data.
With reference to Figure 14, the embodiment of the method that another data shown in one exemplary embodiment of the application are sent is shown Flow chart of steps, in the present embodiment, in conjunction with Figure 15 give out a contract for a project timing diagram 3 by normal transmission channel send data scene into Row explanation, the present embodiment can be used for transmitting non-UDP message (such as data of TCP and some other agreements), specifically can wrap Include following steps:
Step 701, the target data that kernel forwarding module is sent is received.
The target data is the data that business process of the port numbers not in registered port numbers list is sent, the business into Journey, which is used to drive to Microsoft Loopback Adapter, sends target data, target data to be forwarded in kernel forwarding module by Microsoft Loopback Adapter.
In the present embodiment, kernel forwarding module and kernel state of the Microsoft Loopback Adapter driving in operating system are empty Between.
Step 702, the target data is written in network interface card shared drive, for network interface card processing.
As shown in figure 15, target service process calls (call) that target data is sent to kernel state space by system In, kernel state space by transport layer (L4 agreement) in target data plus corresponding port number information (including source port number And destination slogan), so that destination host distinguishes this purpose data, learning should specifically be handled by which task of the machine. It is that target data adds IP address information (including source IP address and purpose IP address) in network layer (L3 agreement), enables data Confirmation should reach some specific host, then pass through the adjoining Neighboring subsystem of data link layer and flow control Subsystem is target data plus Microsoft Loopback Adapter driving is sent to after MAC Address, and target data is sent out in then Microsoft Loopback Adapter driving It send to kernel forwarding module, target data is written in the transmit queue of this module kernel forwarding module, and NIC driver can To obtain target data from the transmit queue of the kernel forwarding module, and target data is inserted in network interface card shared drive, with It is read for network interface card.
The present embodiment can be adapted for data packet protocol stack is more complicated or the quantity of data packet is not too many number According to transmitting scene, or the scene suitable for transmitting data failure by quick transmission channel, target data is carried out by kernel Transmission, it is possible to reduce the realization difficulty of the NIC driver of User space.
Difference is shown using quick transmission channel and the data transfer mode in normal transmission channel, Figure 16 according to above-mentioned Test and comparison schematic diagram in data transmission scheme, in the Single NIC machine of same performance, the longitudinal axis is the CPU free time hundred of system Divide ratio, horizontal axis is the PPS (page per second, quantity per second of giving out a contract for a project) of the transmitting-receiving of data packet, and wherein packet size is 100 words Section.It can see from the data of Figure 16, when the server CPU free time is 50% or more, using normal transmission channel (system Method of calling) 1,500,000 PPS or so can be gone to.And 10,000,000 PPS can be gone to using quick transmission channel, handling capacity is reached close to 7 Times.It estimates in idle lower situation, has bigger multiple and increase.But generally still need to reserve some CPU to business It uses, does not take into account that the case where exhausting CPU.
In addition, quickly transmission channel and it is existing certain support RDMA (Remote Direct Memory Access, remotely Immediate data access) scheme performance it is suitable.
Corresponding with the embodiment of preceding method, present invention also provides data sink embodiments and data to send Installation practice.
Figure 17 is please referred to, a kind of knot of data sink embodiment shown in one exemplary embodiment of the application is shown Structure block diagram, described device include in NIC driver, and the NIC driver is located at user's state space of operating system, institute Stating device includes:
Data read module 801, for reading the target data of network interface card write-in from network interface card shared drive, wherein described Network interface card shared drive is the core buffer for the network interface card that this driver and network interface card are shared;
Information determination module 802 is decapsulated, for determining the decapsulation information of the target data, the decapsulation information Including destination slogan;
Decapsulation module 803, for being decapsulated to the target data, wherein institute according to the decapsulation information The process for stating decapsulation includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered Port numbers;
Data transmission blocks 804, for when passed the verification, then by the target data of decapsulation be sent to target service into Cheng Zhong.
In a kind of possible embodiment of the application, the data transmission blocks 804 may include following submodule:
Submodule is written in user sharing memory, corresponding to the destination slogan for being written the target data of decapsulation User sharing memory in, the core buffer that this driver and target service process are shared is saved as in the user sharing, The target data of the decapsulation is read from the user sharing memory by the target service process.
In the alternatively possible embodiment of the application, the data transmission blocks 804 may include following submodule Block:
Submodule is written in packet receiving queue, and the corresponding packet receiving of the destination slogan is written in the target data for that will decapsulate In queue, to read the target data from the packet receiving queue by the corresponding target service process of the destination slogan.
In a kind of possible embodiment of the application, the decapsulation information further includes purpose physical address and mesh IP address;
The decapsulation module includes following submodule:
Physical address verifies submodule, for carrying out purpose physics address check, to judge that the purpose physical address is The no physical address for network interface card;
IP Address Velocity submodule, for carrying out purpose IP address verification, to judge whether the destination IP address is institute Locate the IP address of host;
Verification and verification submodule, for being verified and being verified, to verify the verification and whether just of the target data Really.
In a kind of possible embodiment of the application, the decapsulation module includes following submodule:
Port numbers judging submodule, for searching the destination slogan, the registration end from registered port numbers list It include multiple registered port numbers in slogan list;If searching successfully, determine that the destination slogan is registered end Slogan;If searching failure, determining the destination slogan not is registered port numbers.
In a kind of possible embodiment of the application, the registered port numbers list generates in the following way:
The registration information that each business process is written in preset public buffer area is received, the registration information includes described The corresponding port numbers of business process;
The port numbers of registration are recorded into port numbers list.
In a kind of possible embodiment of the application, if the destination slogan is not registered port numbers, institute State device further include:
Kernel sending module, for the target data to be sent to the kernel forwarding module connecting with this driver Packet receiving queue, the target data is sent to institute via Microsoft Loopback Adapter connected to it driving by the kernel forwarding module It states in the corresponding target service process of destination slogan;
Wherein, the kernel forwarding module and Microsoft Loopback Adapter driving are in the kernel state space of operating system.
Figure 18 is please referred to, a kind of knot of data sending device embodiment shown in one exemplary embodiment of the application is shown Structure block diagram, described device include in NIC driver, and the NIC driver is located at user's state space of operating system, institute Stating device includes:
Poller module 901, for being directed to each registered port numbers in preset registered port numbers list, to the registered port numbers Corresponding user sharing memory is polled, to determine mesh that whether target service process is written in the user sharing memory Mark data, wherein the core buffer that this driver is shared with the target service process is saved as in the user sharing, it should Registered port numbers are the port numbers that the target service process is registered to this driver;If so, invocation target reading data Module;
Target data read module 902, for reading the target data;
Packaging information obtains module 903, for obtaining the corresponding packaging information of the target data;
Information writing module 904, for network interface card shared drive to be written in the target data and the packaging information, with So that network interface card issues the target data according to the packaging information, wherein the network interface card shared drive be this driver with The core buffer of the shared network interface card of network interface card.
In a kind of possible embodiment of the application, the packaging information include: source port number, destination slogan, Source IP address, purpose IP address, source physical address and purpose physical address;
The packaging information obtains module 903 and is specifically used for:
Obtain the source port number, the destination slogan, the source IP address, the mesh that the target data carries IP address and the source physical address;
The destination IP address is searched in preset cache table, wherein the cache table store multiple IP address with it is right The mapping relations for the physical address answered;
If searching successfully, purpose physical address corresponding with the destination IP address is obtained from the cache table;
If searching failure, according to the destination IP address, the purpose is obtained by the way of Address Resolution Protocol ARP Physical address.
Figure 19 is please referred to, another data sending device embodiment shown in one exemplary embodiment of the application is shown Structural block diagram, described device include in NIC driver, and the NIC driver is located at user's state space of operating system, Described device includes:
Port numbers judgment module 1001 detects that number of targets is written in network interface card shared drive in target service process for working as According to when, judge whether the corresponding port numbers of target service process are registered port numbers;Wherein, the network interface card shared drive For the core buffer for the network interface card that this driver and network interface card are shared;If so, packaging information is called to obtain module;
Packaging information obtains module 1002, for obtaining the corresponding packaging information of the target data;
Packaging information writing module 1003, for the network interface card shared drive to be written in the packaging information, so that net Card issues the target data according to the packaging information.
In a kind of possible embodiment of the application, packaging information writing module 1003 is specifically used for:
The network interface card shared drive is written into the purpose physical address.
Figure 20 is please referred to, a kind of knot of data processing system embodiment shown in one exemplary embodiment of the application is shown Structure block diagram, the data processing system include NIC driver 10 and target service in operating system user state space Process 20, the NIC driver 10 can be realized the step in above method embodiment when executing program.
For apparatus and system embodiment, since it corresponds essentially to embodiment of the method, so related place referring to The part of embodiment of the method illustrates.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules realize the purpose of application scheme.Those of ordinary skill in the art are not paying creative labor In the case where dynamic, it can understand and implement.
Present invention also provides a kind of electronic equipment, including memory, NIC driver and storage are on a memory simultaneously The computer program that can be run in NIC driver, the NIC driver realize the above method when executing described program Step in embodiment.
Present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, described program quilt Step when execution in implementation method embodiment.
Theme described in this specification and the embodiment of feature operation can be realized in the following: Fundamental Digital Circuit, Computer software or firmware, the computer including structure disclosed in this specification and its structural equivalents of tangible embodiment are hard The combination of part or one or more of which.The embodiment of theme described in this specification can be implemented as one or Multiple computer programs, i.e. coding are executed by data processing equipment on tangible non-transitory program carrier or are controlled at data Manage one or more modules in the computer program instructions of the operation of device.Alternatively, or in addition, program instruction can be with It is coded on manually generated transmitting signal, such as electricity, light or electromagnetic signal that machine generates, the signal are generated will believe Breath encodes and is transferred to suitable receiver apparatus to be executed by data processing equipment.Computer storage medium can be machine can Read storage equipment, machine readable storage substrate, random or serial access memory equipment or one or more of which group It closes.
Processing described in this specification and logic flow can by execute one of one or more computer programs or Multiple programmable calculators execute, to execute corresponding function by the way that output is operated and generated according to input data.Institute It states processing and logic flow can also be by dedicated logic circuit-such as FPGA (field programmable gate array) or ASIC (dedicated collection At circuit) Lai Zhihang, and device also can be implemented as dedicated logic circuit.
The computer for being suitable for carrying out computer program includes, for example, general and/or special microprocessor or it is any its The central processing unit of his type.In general, central processing unit will refer to from read-only memory and/or random access memory reception Order and data.The basic module of computer includes central processing unit for being practiced or carried out instruction and for storing instruction With one or more memory devices of data.In general, computer will also be including one or more great Rong for storing data Amount storage equipment, such as disk, magneto-optic disk or CD etc. or computer will be coupled operationally with this mass-memory unit To receive from it data or have both at the same time to its transmission data or two kinds of situations.However, computer is not required to have in this way Equipment.In addition, computer can be embedded in another equipment, such as car-mounted terminal, mobile phone, personal digital assistant (PDA), Mobile audio frequency or video player, game console, global positioning system (GPS) receiver or such as general serial The portable memory apparatus of bus (USB) flash drive, names just a few.
It is suitable for storing computer program instructions and the computer-readable medium of data including the non-volatile of form of ownership Memory, medium and memory devices, for example including semiconductor memory devices (such as EPROM, EEPROM and flash memory device), Disk (such as internal hard drive or removable disk), magneto-optic disk and CD ROM and DVD-ROM disk.Processor and memory can be by special It is supplemented or is incorporated in dedicated logic circuit with logic circuit.
Although this specification includes many specific implementation details, these are not necessarily to be construed as the model for limiting any invention It encloses or range claimed, and is primarily used for describing the feature of the specific embodiment of specific invention.In this specification Certain features described in multiple embodiments can also be combined implementation in a single embodiment.On the other hand, individually implementing Various features described in example can also be performed separately in various embodiments or be implemented with any suitable sub-portfolio.This Outside, although feature can work in certain combinations as described above and even initially so be claimed, institute is come from One or more features in claimed combination can be removed from the combination in some cases, and claimed Combination can be directed toward the modification of sub-portfolio or sub-portfolio.
Similarly, although depicting operation in the accompanying drawings with particular order, this is understood not to require these behaviour Make the particular order shown in execute or sequentially carry out or require the operation of all illustrations to be performed, to realize desired knot Fruit.In some cases, multitask and parallel processing may be advantageous.In addition, the various system modules in above-described embodiment Separation with component is understood not to be required to such separation in all embodiments, and it is to be understood that described Program assembly and system can be usually integrated in together in single software product, or be packaged into multiple software product.
The specific embodiment of theme has been described as a result,.Other embodiments are within the scope of the appended claims.? In some cases, the movement recorded in claims can be executed in different order and still realize desired result.This Outside, the processing described in attached drawing and it is nonessential shown in particular order or sequential order, to realize desired result.In certain realities In existing, multitask and parallel processing be may be advantageous.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.

Claims (17)

1. a kind of method of data receiver, which is characterized in that the method is applied in NIC driver, the trawl performance Program is located at user's state space of operating system, which comprises
The target data of network interface card write-in is read from network interface card shared drive, wherein the network interface card shared drive is this driver The core buffer for the network interface card shared with network interface card;
Determine the decapsulation information of the target data, the decapsulation information includes destination slogan;
According to the decapsulation information, the target data is decapsulated, wherein the process of the decapsulation includes verification Process, the checking procedure include: whether the verification destination slogan is registered port numbers;
When passed the verification, then the target data of decapsulation is sent in target service process.
2. the method according to claim 1, wherein described be sent to target service for the target data of decapsulation In process, comprising:
The target data of decapsulation is written into the corresponding user sharing memory of the destination slogan, in the user sharing The core buffer that this driver is shared with target service process is saved as, to be total to by the target service process from the user Enjoy the target data that the decapsulation is read in memory.
3. the method according to claim 1, wherein described be sent to target service for the target data of decapsulation In process, comprising:
The target data of decapsulation is written in the corresponding packet receiving queue of the destination slogan, to be corresponded to by the destination slogan Target service process read the target data from the packet receiving queue.
4. method according to claim 1-3, which is characterized in that the decapsulation information further includes purpose physics Address and purpose IP address;
The checking procedure further includes following process:
Purpose physics address check, with judge the purpose physical address whether be network interface card physical address;
Purpose IP address verification, with judge the destination IP address whether be locating host IP address;
Verification and verification, with verify the target data verification and whether correctly.
5. method according to claim 1-3, which is characterized in that the verification destination slogan whether be Registered port numbers, comprising:
The destination slogan is searched from registered port numbers list, includes multiple registered in the registered port numbers list Port numbers;
If searching successfully, determine that the destination slogan is registered port numbers;
If searching failure, determining the destination slogan not is registered port numbers.
6. according to the method described in claim 5, it is characterized in that, the registered port numbers list generates in the following way:
The registration information that each business process is written in preset public buffer area is received, the registration information includes the business The corresponding port numbers of process;
The port numbers of registration are recorded into port numbers list.
7. the method according to claim 1, wherein if the destination slogan is not registered port numbers, The method also includes:
The target data is sent to the packet receiving queue for the kernel forwarding module connecting with this driver, by the kernel The target data is sent to the corresponding mesh of the destination slogan via Microsoft Loopback Adapter connected to it driving by forwarding module It marks in business process;
Wherein, the kernel forwarding module and Microsoft Loopback Adapter driving are in the kernel state space of operating system.
8. a kind of method that data are sent, which is characterized in that the method is applied in NIC driver, the trawl performance Program is located at user's state space of operating system, which comprises
For each registered port numbers in preset registered port numbers list, to being deposited into the corresponding user sharing of the registered port numbers Row poll, to determine target data that whether target service process is written in the user sharing memory, wherein the user Shared drive is this driver and the core buffer that the target service process is shared, which is the target The port numbers that business process is registered to this driver;
If so, reading the target data;
Obtain the corresponding packaging information of the target data;
Network interface card shared drive is written into the target data and the packaging information, so that network interface card is according to the packaging information Issue the target data, wherein the network interface card shared drive is the memory for the network interface card that this driver and network interface card are shared Buffer area.
9. according to the method described in claim 8, it is characterized in that, the packaging information includes: source port number, destination port Number, source IP address, purpose IP address, source physical address and purpose physical address;
It is described to obtain the corresponding packaging information of the target data, comprising:
Obtain the source port number, the destination slogan, the source IP address, the destination IP that the target data carries Address and the source physical address;
The destination IP address is searched in preset cache table, wherein the cache table store multiple IP address with it is corresponding The mapping relations of physical address;
If searching successfully, purpose physical address corresponding with the destination IP address is obtained from the cache table;
If searching failure, according to the destination IP address, the purpose physics is obtained by the way of Address Resolution Protocol ARP Address.
10. a kind of method that data are sent, which is characterized in that the method is applied in NIC driver, and the network interface card drives Dynamic program is located at user's state space of operating system, which comprises
When detecting that target data is written in network interface card shared drive in target service process, judge that the target service process is corresponding Port numbers whether be registered port numbers;Wherein, the institute that the network interface card shared drive is shared for this driver and network interface card State the core buffer of network interface card;
If so, obtaining the corresponding packaging information of the target data;
The network interface card shared drive is written into the packaging information, so that network interface card issues the target according to the packaging information Data.
11. according to the method described in claim 10, it is characterized in that, described share the packaging information write-in network interface card Memory, comprising:
The network interface card shared drive is written into the purpose physical address.
12. a kind of data sink, which is characterized in that described device is applied in NIC driver, the trawl performance Program is located at user's state space of operating system, and described device includes:
Data read module, for reading the target data of network interface card write-in from network interface card shared drive, wherein the network interface card is shared Inside save as the core buffer for the network interface card that this driver and network interface card are shared;
Information determination module is decapsulated, for determining the decapsulation information of the target data, the decapsulation information includes mesh Port numbers;
Decapsulation module, for being decapsulated to the target data, wherein the deblocking according to the decapsulation information The process of dress includes checking procedure, and the checking procedure includes: whether the verification destination slogan is registered port numbers;
Data transmission blocks, for when passed the verification, then the target data of decapsulation being sent in target service process.
13. a kind of data sending device, which is characterized in that described device is applied in NIC driver, the trawl performance Program is located at user's state space of operating system, and described device includes:
Poller module, it is corresponding to the registered port numbers for being directed to each registered port numbers in preset registered port numbers list User sharing memory is polled, to determine number of targets that whether target service process is written in the user sharing memory According to, wherein the core buffer that this driver is shared with the target service process, the registration are saved as in the user sharing Port numbers are the port numbers that the target service process is registered to this driver;If so, invocation target data read module;
Target data read module, for reading the target data;
Packaging information obtains module, for obtaining the corresponding packaging information of the target data;
Information writing module, for network interface card shared drive to be written in the target data and the packaging information, so that net Card issues the target data according to the packaging information, wherein the network interface card shared drive is that this driver and network interface card are total The core buffer for the network interface card enjoyed.
14. a kind of data sending device, which is characterized in that described device is applied in NIC driver, the trawl performance Program is located at user's state space of operating system, and described device includes:
Port numbers judgment module, for sentencing when detecting that target data is written in network interface card shared drive in target service process Whether the corresponding port numbers of target service process of breaking are registered port numbers;Wherein, the network interface card shared drive is this drive The core buffer for the network interface card that dynamic program and network interface card are shared;If so, packaging information is called to obtain module;
Packaging information obtains module, for obtaining the corresponding packaging information of the target data;
Packaging information writing module, for the network interface card shared drive to be written in the packaging information, so that network interface card is according to institute It states packaging information and issues the target data.
15. a kind of data processing system, which is characterized in that the data processing system includes being in operating system user state space NIC driver and target service process, the NIC driver realizes claim 1-7 or 8-9 when executing program Or the step of any one of 10-11 the method.
16. a kind of electronic equipment, including memory, NIC driver and storage are on a memory and can be in NIC driver The computer program of upper operation, which is characterized in that the NIC driver realized when executing described program claim 1-7 or The step of any one of 8-9 or 10-11 the method.
17. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is performed Shi Shixian claim 1-7 or the step of any one of 8-9 or 10-11 the method.
CN201910285983.0A 2019-04-10 2019-04-10 A kind of data transmission and received method, apparatus and data processing system Pending CN110086571A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910285983.0A CN110086571A (en) 2019-04-10 2019-04-10 A kind of data transmission and received method, apparatus and data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910285983.0A CN110086571A (en) 2019-04-10 2019-04-10 A kind of data transmission and received method, apparatus and data processing system

Publications (1)

Publication Number Publication Date
CN110086571A true CN110086571A (en) 2019-08-02

Family

ID=67414736

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910285983.0A Pending CN110086571A (en) 2019-04-10 2019-04-10 A kind of data transmission and received method, apparatus and data processing system

Country Status (1)

Country Link
CN (1) CN110086571A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855610A (en) * 2019-09-30 2020-02-28 视联动力信息技术股份有限公司 Data packet processing method and device and storage medium
CN111711801A (en) * 2020-06-30 2020-09-25 重庆紫光华山智安科技有限公司 Video data transmission method, device, server and computer readable storage medium
WO2021063160A1 (en) * 2019-09-30 2021-04-08 华为技术有限公司 Solid state disk access method and storage device
CN112822722A (en) * 2020-12-30 2021-05-18 联想未来通信科技(重庆)有限公司 Data message transmission method and device
WO2021121123A1 (en) * 2019-12-16 2021-06-24 中兴通讯股份有限公司 Media stream distribution method, cdn node server, cdn system, and readable storage medium
CN113259006A (en) * 2021-07-14 2021-08-13 北京国科天迅科技有限公司 Optical fiber network communication system, method and device
CN113452471A (en) * 2020-03-26 2021-09-28 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for data processing
CN113630341A (en) * 2021-08-03 2021-11-09 武汉绿色网络信息服务有限责任公司 Data information processing method and server
CN113747087A (en) * 2021-09-10 2021-12-03 湖南君瀚信息技术有限公司 Remote driving low-delay image transmission method and device, computer equipment and medium
CN113849238A (en) * 2021-09-29 2021-12-28 浪潮电子信息产业股份有限公司 Data communication method, device, electronic equipment and readable storage medium
WO2022194021A1 (en) * 2021-03-16 2022-09-22 华为技术有限公司 Concurrency control method, network card, computer device, and storage medium
CN115586980A (en) * 2022-10-09 2023-01-10 维塔科技(北京)有限公司 Remote procedure calling device and method
CN117573043A (en) * 2024-01-17 2024-02-20 济南浪潮数据技术有限公司 Transmission method, device, system, equipment and medium for distributed storage data

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079753A (en) * 2007-06-28 2007-11-28 深圳市中科新业信息科技发展有限公司 A multi-link packet snapping system, method and network audit system
CN101296157A (en) * 2007-04-26 2008-10-29 北京师范大学珠海分校 Multi-network card coordination communication method
CN101616194A (en) * 2009-07-23 2009-12-30 中国科学技术大学 The optimizing host network performance system and method
CN101841470A (en) * 2010-03-29 2010-09-22 东南大学 High-speed capturing method of bottom-layer data packet based on Linux
US20110258337A1 (en) * 2008-08-04 2011-10-20 Zte Corporation Method and system for enabling zero-copy transmission of streaming media data
CN102291298A (en) * 2011-08-05 2011-12-21 曾小荟 Efficient computer network communication method oriented to long message
CN102436400A (en) * 2011-12-06 2012-05-02 曙光信息产业股份有限公司 Method and device for implementing zero copy drive
CN102651690A (en) * 2011-02-28 2012-08-29 国际商业机器公司 Method and device for controlling shared memory
CN102999330A (en) * 2012-11-12 2013-03-27 北京神州绿盟信息安全科技股份有限公司 Network card configuration method and device based on user mode network card drive
CN103559075A (en) * 2013-10-30 2014-02-05 华为技术有限公司 Data transmission method, device and system and internal storage device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296157A (en) * 2007-04-26 2008-10-29 北京师范大学珠海分校 Multi-network card coordination communication method
CN101079753A (en) * 2007-06-28 2007-11-28 深圳市中科新业信息科技发展有限公司 A multi-link packet snapping system, method and network audit system
US20110258337A1 (en) * 2008-08-04 2011-10-20 Zte Corporation Method and system for enabling zero-copy transmission of streaming media data
CN101616194A (en) * 2009-07-23 2009-12-30 中国科学技术大学 The optimizing host network performance system and method
CN101841470A (en) * 2010-03-29 2010-09-22 东南大学 High-speed capturing method of bottom-layer data packet based on Linux
CN102651690A (en) * 2011-02-28 2012-08-29 国际商业机器公司 Method and device for controlling shared memory
CN102291298A (en) * 2011-08-05 2011-12-21 曾小荟 Efficient computer network communication method oriented to long message
CN102436400A (en) * 2011-12-06 2012-05-02 曙光信息产业股份有限公司 Method and device for implementing zero copy drive
CN102999330A (en) * 2012-11-12 2013-03-27 北京神州绿盟信息安全科技股份有限公司 Network card configuration method and device based on user mode network card drive
CN103559075A (en) * 2013-10-30 2014-02-05 华为技术有限公司 Data transmission method, device and system and internal storage device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
KKNT2002: "IDS 驱动程序是什么?????", 《百度知道》 *
刘学波: "基于负载均衡的分布式入侵检测模型设计与分析", 《中国优秀博硕士学位论文全文数据库(硕士)》 *
王燕飞等: "网卡驱动程序的用户态移植和优化", 《电子技术》 *
董占杰: "嵌入式Linux网卡用户态驱动设计", 《信息技术》 *
陈艳平等: "直接内存通信技术的研究与实现", 《计算机测量与控制》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021063160A1 (en) * 2019-09-30 2021-04-08 华为技术有限公司 Solid state disk access method and storage device
CN110855610A (en) * 2019-09-30 2020-02-28 视联动力信息技术股份有限公司 Data packet processing method and device and storage medium
WO2021121123A1 (en) * 2019-12-16 2021-06-24 中兴通讯股份有限公司 Media stream distribution method, cdn node server, cdn system, and readable storage medium
CN113452471A (en) * 2020-03-26 2021-09-28 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for data processing
CN111711801A (en) * 2020-06-30 2020-09-25 重庆紫光华山智安科技有限公司 Video data transmission method, device, server and computer readable storage medium
CN112822722A (en) * 2020-12-30 2021-05-18 联想未来通信科技(重庆)有限公司 Data message transmission method and device
WO2022194021A1 (en) * 2021-03-16 2022-09-22 华为技术有限公司 Concurrency control method, network card, computer device, and storage medium
CN113259006A (en) * 2021-07-14 2021-08-13 北京国科天迅科技有限公司 Optical fiber network communication system, method and device
CN113630341B (en) * 2021-08-03 2023-06-06 武汉绿色网络信息服务有限责任公司 Data information processing method and server
CN113630341A (en) * 2021-08-03 2021-11-09 武汉绿色网络信息服务有限责任公司 Data information processing method and server
CN113747087A (en) * 2021-09-10 2021-12-03 湖南君瀚信息技术有限公司 Remote driving low-delay image transmission method and device, computer equipment and medium
CN113747087B (en) * 2021-09-10 2023-09-19 湖南君瀚信息技术有限公司 Remote driving low-delay image transmission method, device, computer equipment and medium
CN113849238A (en) * 2021-09-29 2021-12-28 浪潮电子信息产业股份有限公司 Data communication method, device, electronic equipment and readable storage medium
CN113849238B (en) * 2021-09-29 2024-02-09 浪潮电子信息产业股份有限公司 Data communication method, device, electronic equipment and readable storage medium
CN115586980A (en) * 2022-10-09 2023-01-10 维塔科技(北京)有限公司 Remote procedure calling device and method
CN117573043A (en) * 2024-01-17 2024-02-20 济南浪潮数据技术有限公司 Transmission method, device, system, equipment and medium for distributed storage data

Similar Documents

Publication Publication Date Title
CN110086571A (en) A kind of data transmission and received method, apparatus and data processing system
US20240160584A1 (en) System and method for facilitating dynamic command management in a network interface controller (nic)
US6658480B2 (en) Intelligent network interface system and method for accelerated protocol processing
US7263103B2 (en) Receive queue descriptor pool
US9143467B2 (en) Network interface controller with circular receive buffer
US7836220B2 (en) Network direct memory access
RU2436147C2 (en) Improved wireless usb protocol and usb hub
US8743877B2 (en) Header processing engine
CN100438403C (en) Method, system, and program for managing data transmission through a network
CN101841470A (en) High-speed capturing method of bottom-layer data packet based on Linux
US20050135395A1 (en) Method and system for pre-pending layer 2 (L2) frame descriptors
US8706927B2 (en) Method for the recovery of a clock and system for the transmission of data between data memories by remote direct memory access and network station set up to operate in the method as a transmitting or, respectively, receiving station
CN110380992A (en) Message processing method, device and network flow acquire equipment
CN109388597A (en) A kind of data interactive method and device based on FPGA
CN107770092A (en) A kind of data transmission method, device, mobile terminal and storage medium
US20080263171A1 (en) Peripheral device that DMAS the same data to different locations in a computer
CN114090495A (en) Data processing method, network card and server
US7466716B2 (en) Reducing latency in a channel adapter by accelerated I/O control block processing
CN110995507A (en) Network acceleration controller and method
CN103078720A (en) Message processing method and message processing device
TW200410529A (en) Packet-based clock signal
US20220360651A1 (en) Method and system for sequencing user data packets
JP2002189607A (en) Memory managing method and information processor
CN116996444A (en) DPDK-based high-speed network packet processing system and method
JP2003163684A (en) Method for storing program via network, method for processing packet routing method, its program, its device and recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20210120

Address after: 511442 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 511442 24 floors, B-1 Building, Wanda Commercial Square North District, Wanbo Business District, 79 Wanbo Second Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190802

Assignee: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Contract record no.: X2021440000054

Denomination of invention: The invention relates to a method, a device and a data processing system for transmitting and receiving data

License type: Common License

Record date: 20210208

EE01 Entry into force of recordation of patent licensing contract