CN110932890A - Data transmission method, server and computer readable storage medium - Google Patents

Data transmission method, server and computer readable storage medium Download PDF

Info

Publication number
CN110932890A
CN110932890A CN201911140402.0A CN201911140402A CN110932890A CN 110932890 A CN110932890 A CN 110932890A CN 201911140402 A CN201911140402 A CN 201911140402A CN 110932890 A CN110932890 A CN 110932890A
Authority
CN
China
Prior art keywords
message
address
mac address
data transmission
transmission method
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.)
Granted
Application number
CN201911140402.0A
Other languages
Chinese (zh)
Other versions
CN110932890B (en
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.)
Xiamen Wangsu Co Ltd
Original Assignee
Xiamen Wangsu 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 Xiamen Wangsu Co Ltd filed Critical Xiamen Wangsu Co Ltd
Priority to CN201911140402.0A priority Critical patent/CN110932890B/en
Publication of CN110932890A publication Critical patent/CN110932890A/en
Application granted granted Critical
Publication of CN110932890B publication Critical patent/CN110932890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The embodiment of the invention relates to the field of data processing, and discloses a data transmission method, a server and a computer readable storage medium. In some embodiments of the present application, a data transmission method is applied to a first server, where a user mode protocol stack of the first server is provided with M first virtual ports, a kernel mode protocol stack of the first server is provided with N second virtual ports, each first virtual port corresponds to a second virtual port, and each second virtual port configures an internet protocol IP address of the corresponding first virtual port; m and N are positive integers, N is less than M; the method comprises the following steps: after a message is received, determining a mac address corresponding to the IP address of the message according to the IP address of the message and a first mapping relation between the IP address and a physical mac address; updating the mac address of the message according to the corresponding mac address; and forwarding the updated message. In the embodiment, the number of the network ports is reduced, and the network ports are convenient to manage.

Description

Data transmission method, server and computer readable storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data transmission method, a server, and a computer-readable storage medium.
Background
The existing user mode protocol stack and kernel mode protocol stack communication implementation mode is: each network port of the user mode protocol stack creates a virtual network port on the kernel mode protocol stack, and aiming at different application scenes, when the data flow is judged to be a control flow, the message can be directly sent to the kernel mode protocol stack. In configuration, the ip/netmask/mac parameters of the network port on each kernel mode protocol stack are consistent with those of the user mode protocol stack.
However, the inventors found that at least the following problems exist in the prior art: the creation, deletion, management and other operations of the internet access not only consume time, but also occupy more resources and are not managed well.
Disclosure of Invention
An object of embodiments of the present invention is to provide a data transmission method, a server, and a computer-readable storage medium, which reduce the number of network ports and facilitate management of the network ports.
In order to solve the above technical problem, an embodiment of the present invention provides a data transmission method, which is applied to a first server, where a user mode protocol stack of the first server is provided with M first virtual network ports, a kernel mode protocol stack of the first server is provided with N second virtual network ports, each first virtual network port corresponds to one second virtual network port, and each second virtual network port configures an internet protocol IP address of the corresponding first virtual network port; m and N are positive integers, N is less than M; the data transmission method comprises the following steps: after a message is received, determining a mac address corresponding to the IP address of the message according to the IP address of the message and a first mapping relation between the IP address and a physical mac address; updating the mac address of the message according to the corresponding mac address; and forwarding the updated message.
An embodiment of the present invention further provides a server, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the data transmission method as described in the above embodiments.
Embodiments of the present invention also provide a computer storage medium storing a computer program, which when executed by a processor implements the data transmission method mentioned in the above embodiments.
Compared with the prior art, the embodiment of the invention has the advantages that less virtual network ports are arranged in the kernel mode protocol stack, at least one virtual network port of the kernel mode protocol stack corresponds to the virtual network ports of a plurality of user mode protocol stacks, the number of the network ports is reduced, the resource loss caused by the creation of the plurality of network ports is reduced, and the network port management is facilitated.
In addition, if the sender of the message is the kernel mode protocol stack of the first server, the IP address of the message is the source IP address of the message, and the mac address of the message is the source mac address of the message; if the sender of the message is the second server, the IP address of the message is the destination IP address of the message, and the mac address of the message is the destination mac address of the message.
In addition, if the sender of the message is the second server, before determining the mac address corresponding to the IP address of the message according to the IP address of the message and the first mapping relationship between the IP address and the physical mac address, the method further includes: and determining the message as a control message.
In addition, before updating the mac address of the packet according to the corresponding mac address, the data transmission method further includes: determining that the message type of the message belongs to a preset message type set; the preset message type set comprises one or more of an IP message type, a unicast ARP request message type and an ARP response message type.
In addition, if the message is an ARP response message; before forwarding the updated message, the data transmission method further includes: updating a target hardware address of the message; if the message is a unicast ARP request message, before forwarding the updated message, the data transmission method further comprises the following steps: and updating the hardware address of the sender of the message.
In addition, the data transmission method further includes: and if the IP address or the mac address of the first virtual network port is determined to be modified, updating the first mapping relation.
In addition, N is equal to 1, and the second virtual network port is provided with an IP address of each first virtual network port.
In addition, the first server further stores a second mapping relationship between the IP address and the port number, and forwards the updated packet if the sender of the packet is the kernel mode protocol stack, which specifically includes: determining a target port according to the source IP address of the message and the second mapping relation; and transmitting the message to a target port.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a flowchart of a data transmission method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a data transmission method according to a second embodiment of the present invention;
fig. 3 is a schematic configuration diagram of a server according to a third embodiment of the present invention;
fig. 4 is a schematic configuration diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
A first embodiment of the present invention relates to a data transmission method applied to a first server. As shown in fig. 1, the data transmission method includes the following steps:
step 101: and after the message is received, determining the mac address corresponding to the IP address of the message according to the IP address of the message and the first mapping relation between the IP address and the mac address.
Specifically, a user mode protocol stack of a first server is provided with M first virtual network ports, a kernel mode protocol stack of the first server is provided with N second virtual network ports, each first virtual network port corresponds to one second virtual network port, and each second virtual network port is configured with an Internet Protocol (IP) address of the corresponding first virtual network port; m and N are positive integers, and N is less than M. Wherein, the second virtual network port refers to a virtual network interface.
In one embodiment, N is equal to 1. Namely, the second virtual network port is provided with the IP address of each first virtual network port. That is, only one virtual network interface on the kernel mode protocol stack needs to be created, and the IP address of each first virtual network port is configured on the virtual network port interface, so that the second virtual network port is provided with M IP addresses in total and is directly mapped to all network ports of the user mode protocol stack.
It is worth mentioning that the data interaction between the kernel mode protocol stack and the user mode protocol stack is realized through 1 second virtual network port, and the number of the network ports to be created is reduced, so that the resource loss caused by creating a plurality of network ports is reduced, and the network port management is facilitated.
In this embodiment, taking the creation of one second virtual network port as an example to describe the mapping relationship between the first virtual network port and the second virtual network port, in practical applications, the number of the second virtual network ports may be set as needed, for example, N is 2, the 1 st second virtual network port is provided with the IP addresses of the 1 st first virtual network port to the [ M/2] th virtual network port, and the 2 nd second virtual network port is provided with the IP addresses of the [ M/2] +1 th virtual network port to the M-th virtual network port. Wherein [ M/2] represents a maximum integer less than or equal to M/2.
It should be noted that the allocation method of the first virtual network ports is only an example, and in practical applications, an average allocation method may not be adopted, and the allocation method of the first virtual network ports is not limited in this embodiment.
Step 102: and updating the mac address of the message according to the mac address corresponding to the IP address.
Specifically, at least one second virtual network port in the first server corresponds to a plurality of first virtual network ports, and the mac address of the second virtual network port may be the same as or different from the mac address of the corresponding first virtual network port. In order to ensure normal communication between the user mode protocol stack and the kernel mode protocol stack, the mac address of the received message needs to determine the mac address corresponding to the IP address based on the first mapping relationship between the IP address and the mac address, and update the mac address in the message.
In one embodiment, the sender of the packet is a kernel mode protocol stack of the first server, the IP address of the packet is a source IP address of the packet, the mac address of the packet is a source mac address of the packet, and the first mapping relationship indicates a correspondence between the IP address of the first virtual network port and the mac address of the first virtual network port. Specifically, when a message is sent from the kernel mode protocol stack to the virtual network port of the user mode protocol stack, a mac address corresponding to a source IP address of the message is searched in the first mapping relationship, and the source mac address of the message is modified into the mac address corresponding to the source IP address.
In another embodiment, the sender of the message is the second server, the IP address of the message is a destination IP address of the message, the mac address of the message is a destination mac address of the message, and the first mapping relationship indicates a mapping relationship between the IP address of the second virtual network port and the mac address of the second virtual network port. Specifically, when a message is sent from the user mode protocol stack to a message of the kernel mode protocol stack, a mac address corresponding to a target IP address of the message is searched in the first mapping relationship, and the target mac address of the message is modified into the mac address corresponding to the target IP address.
It should be noted that, the first server replaces the corresponding mac address based on the sender of the packet, so that the kernel mode protocol stack and the user mode protocol stack can communicate normally when only N network ports are set.
In one example, N ═ 1, that is, the kernel-mode protocol stack is provided with a second virtual network port. In this case, when the packet of the user mode protocol stack is forwarded to the kernel mode protocol stack, the target IP address in the packet is searched in the first mapping relationship, and if the target IP address is found, it is indicated that the IP address is legal, the target mac address of the packet is replaced with the mac address of the second virtual network port, and the packet is forwarded; if the target IP address is not found, the IP is not legal, and the message is not forwarded.
It is worth mentioning that the validity of the IP address is detected, so that the security of the first server is improved.
In one embodiment, N is a positive integer greater than 1, that is, the kernel-mode protocol stack is provided with a plurality of second virtual network ports. In this case, when the packet of the user mode protocol stack is forwarded to the kernel mode protocol stack, based on the mapping relationship between the IP address of the second virtual network port and the mac address of the second virtual network port, the mac address corresponding to the target IP address in the packet is searched, and the target mac address of the packet is modified into the mac address corresponding to the target IP address. When the message of the kernel mode protocol stack is forwarded to the user mode protocol stack, based on the mapping relation between the IP address of the first virtual network port and the IP address of the second virtual network port, the mac address corresponding to the source IP address in the message is searched, and the source mac address of the message is modified into the mac address corresponding to the source IP address. For example, the user mode protocol stack is provided with four network cards a, B, C and D corresponding to A, B, C and D first virtual network ports, the kernel mode protocol stack is provided with two network cards E and F corresponding to two second virtual network ports E and F, data streams (messages) of a and B are mapped to E, data streams (messages) of C and D are mapped to F, that is, a and B correspond to E, and C and D correspond to F. Then, when the data stream of the a and b network cards is sent from the user mode protocol stack to the kernel mode protocol stack, the destination mac of the data stream needs to be replaced by the mac address of E, and when the data stream of the c and d network cards is sent from the user mode protocol stack to the kernel mode protocol stack, the destination mac of the data stream needs to be replaced by the mac address of F. Similarly, when the data stream of the e-network card is sent from the kernel mode protocol stack to the user mode protocol stack, the mac address (the mac address of a or b) corresponding to the source IP address needs to be determined according to the source IP address, the mac address of the message needs to be replaced by the mac address corresponding to the source IP address, and the data stream of the f-network card needs to be sent from the kernel mode protocol stack to the user mode protocol stack, the mac address (the mac address of c or d) corresponding to the source IP address needs to be determined according to the source IP address, and the mac address of the message needs to be replaced by the mac address corresponding to the source IP address.
In an embodiment, before updating the mac address of the packet according to the corresponding mac address, the method further includes: determining that the message type of the message belongs to a preset message type set; the preset message type set comprises one or more of an IP message type, a unicast ARP request message type and an ARP response message type.
In one embodiment, if the sender of the message is the second server, before determining the mac address corresponding to the IP address of the message according to the IP address of the message and the first mapping relationship between the IP address and the physical mac address, the first server determines whether the message is a control message, and if the message is determined to be the control message, the step of determining the mac address corresponding to the IP address of the message according to the IP address of the message and the first mapping relationship between the IP address and the physical mac address is performed.
It is worth mentioning that the subsequent operation is executed after the message is determined to be the control message, so that unnecessary computing resource waste caused by the subsequent operation of the data message which does not need to be forwarded is avoided.
In one embodiment, if the message is an ARP response message; before forwarding the updated message, the data transmission method further includes: updating a target hardware address of the message; if the message is a unicast ARP request message, before forwarding the updated message, the data transmission method further comprises the following steps: and updating the hardware address of the sender of the message.
Step 103: and forwarding the updated message.
Specifically, the message is forwarded according to the target IP address and the mac address of the modified message.
In one embodiment, when the sender of the packet is a kernel mode protocol stack, forwarding is performed according to a second mapping relationship between a preset IP address and a preset port number. Specifically, the first server further stores a second mapping relationship between the IP address and the port number, and determines the destination port according to the source IP address of the packet and the second mapping relationship; and transmitting the message to a target port.
In one embodiment, the data transmission method mentioned in this embodiment is applied to a port aggregation module disposed on a user mode protocol stack. The port aggregation module stores a first mapping relation and is provided with a message processing unit. The message processing unit comprises a message receiving subunit, an address conversion unit and a message forwarding unit.
In one example, when implementing the present embodiment, first, the network card IP of the user mode protocol stack is configured on the same network card of the kernel mode protocol stack. And then, the port aggregation module creates a mapping table of the IP address and the mac address according to the configuration of the IP address, the mac address and the like of each virtual network port of the user mode protocol stack and the configuration of the IP address, the mac address and the like of the virtual network port of the kernel mode protocol stack. For example, 5 applications (application 1, application 2, application 3, application 4, and application 5) are provided on the first server, different control planes and data planes are separated for different applications, 5 first virtual sockets are provided on the user mode protocol stack, the names of the first virtual sockets are wss1, wss2, wss3, wss4, and wss5, respectively, 1 second virtual socket is provided on the kernel mode protocol stack, configurations of wss1 are IP1 and mac1, configurations of wss2 are IP2 and mac2, configurations of wss3 are IP3 and mac3, configurations of wss4 are IP4 and mac4, configurations of wss5 are IP5 and mac5, configurations of the second virtual socket are IP1/IP2/IP3/IP4/IP5 and mac6, and a mapping table is generated according to the configurations. The port aggregation module performs different processing according to the uplink and the downlink of the control plane and different message types. For the uplink message, after the physical network card receives the message, the message is classified, if the message is a control message, the port aggregation module executes the processing of the port aggregation module, the port aggregation module replaces the message content according to the mapping table and sends the message content to the kernel mode protocol stack, and if the message is a data message, the port aggregation module directly sends the message content to the virtual network port corresponding to the user mode protocol stack. For the downlink message, after receiving the message on the virtual network port of the kernel mode protocol stack, the processing of the port aggregation module is executed, the port aggregation module replaces the message content according to the mapping table, and the message content is forwarded to the physical network port through the user mode protocol stack. For different types of messages, the updated message content may be different when the message is forwarded. The following is an example of the contents of different types of message replacement.
If the message is an IP message, the message format is as follows: ether _ hdr (src _ mac and dst _ mac) | IP _ hdr (src _ IP and dst _ IP) | tcp/udp, wherein ether _ hdr represents an ethernet header, src _ mac represents a source mac address, dst _ mac represents a destination mac address, IP _ hdr represents an IP header, src _ IP represents a source IP address, and dst _ IP represents a destination IP address. When the message is sent from the user mode protocol stack to the kernel mode protocol stack, the first mapping relation is searched according to dst _ ip, if the first mapping relation is found, the message is determined to be legal, and then dst _ mac is replaced to mac 6. And sending the message from the kernel mode protocol stack to the user mode protocol stack, searching a table according to the src _ ip, finding a mac address corresponding to the src _ ip for replacement after determining that the message is legal, and finding a corresponding port for sending.
If the message is an arp message, the message format is as follows: ether _ hdr (src _ mac and dst _ mac) | arp _ hdr (ar _ op _ arp _ spa _ arp _ trp _ tpa), where ether _ hdr represents an ethernet header, src _ mac represents a source mac address, dst _ mac represents a target mac address, arp _ hdr represents an arp header, ar _ op represents an arp type, if it is 0x0001, it represents that the message is an arp request message, if it is 0x0002, it represents that the message is an arp response message, arp _ sha represents a sender hardware address, arp _ spa represents a sender IP address, arp _ tha represents a target hardware address, and arp _ tpa represents a destination IP address. When a message is sent from a user mode protocol stack to a kernel mode protocol stack, if the message is an arp request message, and the dst _ mac value of the ether _ hdr head in the message is FF, namely the message is a broadcast message, the message does not need to be changed; if the message is an arp request message and the message is a unicast message, searching for a corresponding mac address according to the IP address of the arp _ tpa in the arp _ hdr, modifying the dst _ mac address of the header of the ether _ hdr message, modifying the arp _ tha (target hardware address) in the arp _ hdr, and if the message is an arp response message, searching for a corresponding mac address according to the IP address of the arp _ tpa in the arp _ hdr, modifying the dst _ mac address of the header of the ether _ hdr message, and modifying the arp _ tha target hardware address in the arp _ hdr message. When a message is sent to a user mode protocol stack from a kernel mode protocol stack, for an arp request message and an arp response message, a corresponding mac address is searched according to an IP address of an arp _ spa in an arp _ hdr, an src _ mac address of a header of an ether _ hdr message is modified, and a hardware address of an arp _ sha sender in the arp _ hdr is modified.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
Compared with the prior art, the data transmission method provided in this embodiment sets fewer virtual network ports in the kernel mode protocol stack, so that at least one virtual network port of the kernel mode protocol stack corresponds to the virtual network ports of multiple user mode protocol stacks, and the number of network ports is reduced, thereby reducing resource loss caused by creating multiple network ports, and facilitating network port management.
A second embodiment of the present invention relates to a data transmission method. The embodiment is further improved on the basis of the first embodiment, and the specific improvements are as follows: in this embodiment, the first server updates the first mapping relationship if it is determined that the IP address or the mac address of the first virtual portal is modified.
Specifically, as shown in fig. 2, the present embodiment includes steps 201 to 204, wherein steps 202 and 204 are substantially the same as steps 101 to 103 in the first embodiment, and are not repeated herein. The following mainly introduces the differences:
step 201: and if the IP address of the first virtual network port or the mac address of the first virtual network port is determined to be modified, updating the first mapping relation.
Specifically, when the user mode protocol stack has parameters such as an IP address and a mac address modified, the user mode protocol stack is synchronized to the kernel mode protocol stack, and the first mapping relation is dynamically adjusted.
Step 202 to step 204 are performed.
In the present embodiment, step 201 is set as a step before step 202 for clarity of description. However, those skilled in the art will appreciate that in practical applications, step 201 may occur at any time, and this embodiment is not limited thereto.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
Compared with the prior art, the data transmission method provided in this embodiment sets fewer virtual network ports in the kernel mode protocol stack, so that at least one virtual network port of the kernel mode protocol stack corresponds to the virtual network ports of a plurality of user mode protocol stacks, thereby reducing the number of network ports and facilitating network port management. In addition, the first mapping relation is adjusted in time based on the parameter modification of the virtual network port of the user mode protocol stack, and the message can be accurately forwarded.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to a server, where a user mode protocol stack of the server is provided with M first virtual network ports, a kernel mode protocol stack of the server is provided with N second virtual network ports, each first virtual network port corresponds to a second virtual network port, and each second virtual network port is configured with an internet protocol IP address of the corresponding first virtual network port; m and N are positive integers, and N is less than M. As shown in fig. 3, the server includes a determination module 301, an update module 302, and a forwarding module 303. The determining module 301 is configured to determine, after receiving the packet, a mac address corresponding to the IP address of the packet according to the IP address of the packet and the first mapping relationship between the IP address and the physical mac address. The updating module 302 is configured to update the mac address of the packet according to the corresponding mac address. The forwarding module 303 is configured to forward the updated packet.
It should be understood that this embodiment is a system example corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A fourth embodiment of the present invention relates to a server, as shown in fig. 4, including: at least one processor 401; and a memory 402 communicatively coupled to the at least one processor 401; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the data transmission method according to the above embodiment.
The server includes: one or more processors 401 and a memory 402, one processor 401 being exemplified in fig. 4. The processor 401 and the memory 402 may be connected by a bus or other means, and fig. 4 illustrates the connection by a bus as an example. The memory 402 is a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs, and modules, and the first mapping relationship is stored in the memory 402 according to the embodiment of the present application. The processor 401 executes various functional applications of the device and data processing by executing nonvolatile software programs, instructions, and modules stored in the memory 402, that is, implements the above-described data transmission method.
The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 402 and when executed by the one or more processors 401 perform the data transmission method of any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, and can refer to the method provided by the embodiment of the application without detailed technical details in the embodiment.
A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A data transmission method is characterized in that the method is applied to a first server, a user mode protocol stack of the first server is provided with M first virtual network ports, a kernel mode protocol stack of the first server is provided with N second virtual network ports, each first virtual network port corresponds to one second virtual network port, and each second virtual network port is configured with an Internet Protocol (IP) address of the corresponding first virtual network port; m and N are positive integers, N is less than M; the data transmission method comprises the following steps:
after a message is received, determining a mac address corresponding to the IP address of the message according to the IP address of the message and a first mapping relation between the IP address and a physical mac address;
updating the mac address of the message according to the corresponding mac address;
and forwarding the updated message.
2. The data transmission method according to claim 1, wherein if the sender of the packet is a kernel-mode protocol stack of the first server, the IP address of the packet is a source IP address of the packet, and the mac address of the packet is a source mac address of the packet;
if the sender of the message is the second server, the IP address of the message is the destination IP address of the message, and the mac address of the message is the destination mac address of the message.
3. The data transmission method according to claim 2, wherein if the sender of the packet is a second server, before determining the mac address corresponding to the IP address of the packet according to the IP address of the packet and the first mapping relationship between the IP address and the physical mac address, the method further comprises:
and determining the message as a control message.
4. The data transmission method according to claim 1, wherein before the mac address of the packet is updated according to the corresponding mac address, the data transmission method further comprises:
determining that the message type of the message belongs to a preset message type set; the preset message type set comprises one or more of an IP message type, a unicast ARP request message type and an ARP response message type.
5. The data transmission method according to claim 4, wherein if the message is an ARP response message; before forwarding the updated packet, the data transmission method further includes:
updating the target hardware address of the message;
if the packet is a unicast ARP request packet, before forwarding the updated packet, the data transmission method further includes:
and updating the hardware address of the sender of the message.
6. The data transmission method according to any one of claims 1 to 5, characterized in that the data transmission method further comprises:
and if the IP address or the mac address of the first virtual network port is determined to be modified, updating the first mapping relation.
7. The data transmission method according to any one of claims 1 to 5, wherein N is equal to 1, and the second virtual network port is provided with an IP address of each of the first virtual network ports.
8. The data transmission method according to any one of claims 1 to 5, wherein the first server further stores a second mapping relationship between an IP address and a port number, and if the sender of the packet is the kernel-mode protocol stack, the forwarding the updated packet specifically includes:
determining a target port according to the source IP address of the message and the second mapping relation;
and transmitting the message to the target port.
9. A server, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data transfer method of any one of claims 1 to 8.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 8.
CN201911140402.0A 2019-11-20 2019-11-20 Data transmission method, server and computer readable storage medium Active CN110932890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911140402.0A CN110932890B (en) 2019-11-20 2019-11-20 Data transmission method, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911140402.0A CN110932890B (en) 2019-11-20 2019-11-20 Data transmission method, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110932890A true CN110932890A (en) 2020-03-27
CN110932890B CN110932890B (en) 2022-09-09

Family

ID=69850423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911140402.0A Active CN110932890B (en) 2019-11-20 2019-11-20 Data transmission method, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110932890B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770210A (en) * 2020-06-05 2020-10-13 深圳爱克莱特科技股份有限公司 Multi-controller IP grouping method, system and readable medium
CN112968965A (en) * 2021-02-25 2021-06-15 网宿科技股份有限公司 Metadata service method, server and storage medium for NFV network node
CN113630300A (en) * 2020-05-09 2021-11-09 华为技术有限公司 Method and node for message transmission
CN114697391A (en) * 2022-04-08 2022-07-01 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
CN115361443A (en) * 2022-08-16 2022-11-18 武汉思普崚技术有限公司 Message processing method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634142A (en) * 2013-11-04 2014-03-12 天津汉柏信息技术有限公司 Method for simultaneously managing user mode Internet interface and kernel virtual Internet interface
CN104796337A (en) * 2015-04-10 2015-07-22 京信通信系统(广州)有限公司 Method and device for forwarding message
CN107948071A (en) * 2016-10-12 2018-04-20 北京金山云网络技术有限公司 Message forwarding method and device
CN108628684A (en) * 2017-03-20 2018-10-09 华为技术有限公司 A kind of message processing method and computer equipment based on DPDK
CN108712520A (en) * 2018-05-31 2018-10-26 福建三元达网络技术有限公司 A kind of IP address of terminal transparent transmission system and method based on LTE wireless private networks
US20180329743A1 (en) * 2017-05-12 2018-11-15 Solarflare Communications, Inc. Data processing system
CN108880885A (en) * 2018-06-19 2018-11-23 杭州迪普科技股份有限公司 A kind of message processing method and device
CN109905352A (en) * 2017-12-11 2019-06-18 亿阳安全技术有限公司 A kind of method, apparatus and storage medium based on cryptographic protocol Audit data
CN110324227A (en) * 2019-06-26 2019-10-11 厦门网宿有限公司 Data transmission method and vpn server in a kind of vpn server
CN110445580A (en) * 2019-08-09 2019-11-12 浙江大华技术股份有限公司 Data transmission method for uplink and device, storage medium, electronic device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634142A (en) * 2013-11-04 2014-03-12 天津汉柏信息技术有限公司 Method for simultaneously managing user mode Internet interface and kernel virtual Internet interface
CN104796337A (en) * 2015-04-10 2015-07-22 京信通信系统(广州)有限公司 Method and device for forwarding message
CN107948071A (en) * 2016-10-12 2018-04-20 北京金山云网络技术有限公司 Message forwarding method and device
CN108628684A (en) * 2017-03-20 2018-10-09 华为技术有限公司 A kind of message processing method and computer equipment based on DPDK
US20180329743A1 (en) * 2017-05-12 2018-11-15 Solarflare Communications, Inc. Data processing system
CN109905352A (en) * 2017-12-11 2019-06-18 亿阳安全技术有限公司 A kind of method, apparatus and storage medium based on cryptographic protocol Audit data
CN108712520A (en) * 2018-05-31 2018-10-26 福建三元达网络技术有限公司 A kind of IP address of terminal transparent transmission system and method based on LTE wireless private networks
CN108880885A (en) * 2018-06-19 2018-11-23 杭州迪普科技股份有限公司 A kind of message processing method and device
CN110324227A (en) * 2019-06-26 2019-10-11 厦门网宿有限公司 Data transmission method and vpn server in a kind of vpn server
CN110445580A (en) * 2019-08-09 2019-11-12 浙江大华技术股份有限公司 Data transmission method for uplink and device, storage medium, electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡卫文等: "基于DPDK技术实现OVS", 《网络新媒体技术》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113630300A (en) * 2020-05-09 2021-11-09 华为技术有限公司 Method and node for message transmission
CN113630300B (en) * 2020-05-09 2023-08-08 华为技术有限公司 Method and node for message transmission
CN111770210A (en) * 2020-06-05 2020-10-13 深圳爱克莱特科技股份有限公司 Multi-controller IP grouping method, system and readable medium
CN112968965A (en) * 2021-02-25 2021-06-15 网宿科技股份有限公司 Metadata service method, server and storage medium for NFV network node
CN114697391A (en) * 2022-04-08 2022-07-01 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
CN114697391B (en) * 2022-04-08 2023-08-18 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
CN115361443A (en) * 2022-08-16 2022-11-18 武汉思普崚技术有限公司 Message processing method and system
CN115361443B (en) * 2022-08-16 2023-06-20 武汉思普崚技术有限公司 Message processing method and system

Also Published As

Publication number Publication date
CN110932890B (en) 2022-09-09

Similar Documents

Publication Publication Date Title
CN110932890B (en) Data transmission method, server and computer readable storage medium
US11283650B2 (en) Method for sending virtual extensible local area network packet, computer device, and computer readable medium
US7554993B2 (en) Method and apparatus for performing connection management with multiple stacks
US10608866B2 (en) Forwarding Ethernet packets
CN102104541B (en) Header processing engine
US20170289033A1 (en) Address cache for tunnel endpoint associated with an overlay network
EP2928123B1 (en) Method for processing VXLAN data units
EP3828709A1 (en) Communication method and network card
US9154586B2 (en) Method for parsing network packets having future defined tags
US11936562B2 (en) Virtual machine packet processing offload
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
US10348624B2 (en) Virtual machine data flow management method and system
CN110768994B (en) Method for improving SIP gateway performance based on DPDK technology
US10218603B2 (en) Multicast message translation in a network device
CN104144156A (en) Message processing method and device
CN107770221B (en) Data transmission method, server conversion device, client conversion device and system
CN109088957B (en) NAT rule management method, device and equipment
CN113163024B (en) Message processing method, server and storage medium
US8194670B2 (en) Upper layer based dynamic hardware transmit descriptor reclaiming
US7536479B2 (en) Local and remote network based management of an operating system-independent processor
CN114598675A (en) Control method, device, equipment and medium for realizing host blocking based on ARP
CN111669310B (en) Batch processing method for network isolation space in pptp vpn and pptp vpn server
KR20040056378A (en) Dual stack transition mechanism router and method for cache table
EP4304144A1 (en) Communication method and apparatus
KR102420610B1 (en) Method for packet data processing using multi layer caching strategy and electronic device for supporting the same

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
GR01 Patent grant
GR01 Patent grant