A communication method and apparatus
By using a method of collaborative encapsulation and message sending between the operating system kernel and the target processing module, the problem of VPP encapsulation in AC products was solved, thereby reducing implementation and maintenance costs, avoiding resource waste, and resolving the issues of system complexity and resource waste.
Patent Information
- Application Number
- CN202411378455.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In AC products, the system complexity and maintenance costs are high when the VPP does not take over the protocol plane communication interface, while the resource waste occurs when the VPP takes over the protocol plane communication interface.
Network layer encapsulation is performed through the operating system kernel, and data link layer encapsulation is performed through the target processing module. The encapsulated message is sent using the network card on the target processing module. There is no need to deploy secure communication policies on the operating system kernel and the target processing module separately, thus avoiding duplicate encapsulation.
This reduces implementation and maintenance costs while avoiding resource waste.
Smart Images

Figure CN119254851B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a communication method and device. BACKGROUND
[0002] Current access controller (AC) products use a vector packet processing engine (VPP) as a data forwarding surface. In addition, AC control surfaces, portal servers and other services run outside the VPP, and are run as independent processes on a Linux system.
[0003] In the above service running, TCP / IP protocol communication with the outside system is required, in the case of using VPP for forwarding in the data surface and using Linux kernel communication for protocol surface communication, if the VPP does not take over the interface of the protocol surface communication, it is necessary to deploy security communication strategies on the Linux kernel and the VPP respectively, and to set up a management port on the VPP to realize the management of the local area network, which will lead to a complex system, and the implementation cost and maintenance cost are both high; if the VPP takes over the interface of the protocol surface communication, it is necessary to map all the interfaces of the VPP on the Linux kernel, and the ARP neighbors and routing tables between the VPP and the Linux kernel need to be synchronized, when the Linux kernel sends a message outward, the message will be re-forwarded and encapsulated after completing the Linux protocol stack forwarding and encapsulation in the VPP, which causes resource waste. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a communication method and device.
[0005] In a first aspect, the embodiments of the present application provide a communication method, comprising:
[0006] performing network layer encapsulation on the to-be-sent data through an operating system kernel to obtain a first sending message;
[0007] transmitting the first sending message to a target processing module, the target processing module being in communication connection with the operating system kernel;
[0008] performing data link layer encapsulation on the first sending message through the target processing module to obtain a second sending message;
[0009] sending the second sending message through a network card, the network card being arranged in the target processing module.
[0010] In a possible implementation, the performing network layer encapsulation on the to-be-sent data through the operating system kernel to obtain the first sending message comprises:
[0011] obtaining an internet protocol address corresponding to a first virtual interface, the first virtual interface being pre-created;
[0012] performing network layer encapsulation on the to-be-sent data based on the internet protocol address to obtain a first sending packet through the operating system kernel.
[0013] In a possible implementation, the network layer encapsulation on the to-be-sent data based on the internet protocol address comprises:
[0014] generating a direct connection route based on the internet protocol address, the direct connection route being used to map the first virtual interface and a network layer interface on the target processing module;
[0015] performing network layer encapsulation on the to-be-sent data based on the internet protocol address and the direct connection route.
[0016] In a possible implementation, the transmission of the first sending packet to the target processing module comprises:
[0017] transmitting the first sending packet from the operating system kernel to the target processing module through the first virtual interface and a network layer interface corresponding to the first virtual interface based on the direct connection route.
[0018] In a possible implementation, the transmission of the first sending packet from the operating system kernel to the target processing module comprises:
[0019] when the first sending packet is multiple, determining a queue number, the queue number being set in the operating system kernel;
[0020] transmitting the first sending packet from the operating system kernel to the target processing module according to the queue number.
[0021] In a possible implementation, the data link layer encapsulation on the first sending packet through the target processing module to obtain a second sending packet comprises:
[0022] performing data link layer encapsulation on the first sending packet through the target processing module based on a physical address to obtain a second sending packet;
[0023] The physical address is an address of a network card.
[0024] In a possible implementation, the communication method further comprises:
[0025] obtaining a receiving packet through the network card;
[0026] transmit the received packet to the operating system kernel through a first virtual interface corresponding to the received packet.
[0027] In a possible implementation, the communication method further includes:
[0028] controlling a virtual local area network corresponding to the operating system kernel through a second virtual interface set on the operating system kernel, wherein the second virtual interface corresponds to a network layer interface on the target processing module.
[0029] In a second aspect, an embodiment of the present application further provides a communication device, including:
[0030] a first encapsulation module configured to perform network layer encapsulation on the to-be-sent data through the operating system kernel to obtain a first sending packet;
[0031] a first transmission module configured to transmit the first sending packet to a target processing module, wherein the target processing module is communicatively connected to the operating system kernel;
[0032] a second encapsulation module configured to perform data link layer encapsulation on the first sending packet through the target processing module to obtain a second sending packet;
[0033] a sending module configured to send the second sending packet through a network card set on the target processing module.
[0034] In a possible implementation, the first encapsulation module is specifically configured to:
[0035] obtain an Internet protocol address corresponding to a first virtual interface, wherein the first virtual interface is pre-created;
[0036] perform network layer encapsulation on the to-be-sent data based on the Internet protocol address through the operating system kernel to obtain the first sending packet.
[0037] In the embodiment of the present application, network layer encapsulation is performed on the to-be-sent data through the operating system kernel, data link layer encapsulation is performed through the target processing module, and the second sending packet obtained after encapsulation is sent through the network card set on the target processing module, without the need to separately deploy a secure communication strategy on the operating system kernel and the target processing module, and without the need to repeatedly encapsulate on the operating system kernel and the target processing module, thereby reducing the implementation cost and the maintenance cost, and avoiding resource waste. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only show some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0039] Figure 1 A flow chart of a communication method provided by the application is shown;
[0040] Figure 2 A flow chart of receiving an external message in a communication method provided by the application is shown;
[0041] Figure 3 A structural schematic diagram of a communication device provided by the application is shown;
[0042] Figure 4 A structural schematic diagram of an electronic device provided by the application is shown. DETAILED DESCRIPTION
[0043] The various schemes and features of the application are described herein with reference to the accompanying drawings.
[0044] It should be understood that various modifications can be made to the embodiments of the application herein. Therefore, the above description should not be regarded as limiting, but only as an example of the embodiments. Those skilled in the art will think of other modifications within the scope and spirit of the application.
[0045] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with the general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the application.
[0046] These and other characteristics of the present application will become apparent from the following description of the preferred forms given, by way of non-limiting example only, with reference to the attached drawings.
[0047] It should also be understood that, although the application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of the application, which have the features as claimed and thus all fall within the protection scope defined thereby.
[0048] The above and other aspects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0049] Specific embodiments of the application are described herein with reference to the accompanying drawings. However, it will be understood that the application is not limited to these particular embodiments, which can be embodied in many different forms. Familiar and / or repeated functions and structures are not described in detail in order to avoid obscuring the application in unnecessary detail. Therefore, specific structural and functional details disclosed herein are not intended to limit the scope of the claims but merely serve as examples of representative embodiments of the application.
[0050] The specification can use phrases such as "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which can refer to one or more of the same or different embodiments of the application.
[0051] To facilitate the understanding of the application, first, a communication method provided by the application is described in detail. Here, the communication method of the embodiment of the application is applied to a scenario in which a vector packet processing engine (VPP) is used for forwarding in a data plane and a Linux kernel communication is used for communication in a protocol plane. Figure 1 A flowchart of the communication method provided by the embodiment of the application is shown, and the specific steps include S101-S104.
[0052] S101, network layer encapsulation is performed on the to-be-sent data by the operating system kernel to obtain a first sending packet.
[0053] In a specific implementation, when it is determined that data needs to be forwarded through a network in an upper layer application, network layer encapsulation is performed on the to-be-sent data by the operating system kernel to obtain a first sending packet.
[0054] As one of the examples, when network layer encapsulation is performed on the to-be-sent data by the operating system kernel, an Internet protocol address corresponding to a first virtual interface is obtained first, wherein the first virtual interface is pre-created, and the first virtual interface corresponds to a network layer interface in the operating system kernel and a target processing module. The Internet protocol address corresponding to the first virtual interface is generated at the same time when the first virtual interface is created, and a route corresponding to the Internet protocol address is generated. Here, the target processing module includes a vector packet processing engine (VPP).
[0055] In the embodiment of the present application, the route corresponding to the internet protocol address of the first virtual interface is a direct connection route, that is, after the internet protocol address of the first virtual interface is determined, the direct connection route is automatically generated based on the internet protocol address. Moreover, the direct connection route is used to map the first virtual interface and the network layer interface on the target processing module, that is, based on the direct connection route, the transmission of the network layer encapsulated first sending packet between the target processing module and the operating system kernel is realized.
[0056] Afterwards, the network layer encapsulation is performed on the to-be-sent data based on the internet protocol address corresponding to the first virtual interface and the direct connection route by the operating system kernel, and the first sending packet is obtained.
[0057] S102, the first sending packet is transmitted to the target processing module, and the target processing module and the operating system kernel are in communication connection.
[0058] After the first sending packet is obtained, the first sending packet is transmitted to the target processing module. Optionally, based on the direct connection route, the first sending packet is transmitted from the upper layer protocol stack of the operating system kernel to the target processing module.
[0059] The first sending packet after network layer encapsulation contains the internet protocol address of the first virtual interface and the direct connection route corresponding thereto. Based on this, when the first sending packet is transmitted to the target processing module, based on the direct connection route, the first sending packet is transmitted from the operating system kernel to the target processing module through the first virtual interface and the network layer interface corresponding to the first virtual interface.
[0060] In yet another example, there are multiple first sending packets, at this time, when the first sending packet is transmitted from the operating system kernel to the target processing module, the number of queues is first determined, wherein the number of queues is set in the operating system kernel. Afterwards, the first sending packet is transmitted from the operating system kernel to the target processing module according to the number of queues.
[0061] Specifically, the user space is set in the operating system kernel, such as the iptables component, through the function of NFQUEUE in the iptables component, the target port corresponding to the target processing module is configured, and at the same time, the target processing module is configured to obtain rules and queue parameters, so that when there is a message conforming to the obtaining rules in the upper layer protocol stack of the operating system kernel, the message conforming to the obtaining rules is intercepted through the target port and transmitted to the target processing module. Wherein, the obtaining rules at least include source address, destination address and transmission protocol, and the queue parameters include queue number and load parameter.
[0062] In a specific implementation, after obtaining the first sending packet, a target port is determined based on the acquisition rule, and the number of queues corresponding to the target port is determined, and then the first sending packet is transmitted from the operating system kernel to the target processing module according to the number of queues.
[0063] Correspondingly, when the target processing module receives the first sending packet, a transmission task is created according to the number of queues, that is, the number of transmission tasks is the same as the number of queues.
[0064] S103, data link layer encapsulation of the first sending packet is performed by the target processing module to obtain a second sending packet.
[0065] After the first sending packet is transmitted to the target processing module, data link layer encapsulation of the first sending packet is performed by the target processing module to obtain a second sending packet. Wherein, the data link layer encapsulation of the first sending packet is performed by the target processing module based on the physical address to obtain the second sending packet. Wherein, the physical address is the address of the network card such as the Media Access Control (MCA) address, and the network card is arranged in the target processing module.
[0066] Here, the data link layer encapsulation is performed by the target processing module, that is, the physical address (also known as the MAC address) is resolved by the target processing module using the Address Resolution Protocol (ARP) according to the Internet Protocol address in the first sending packet, so that the packet can be sent without the operating system kernel performing ARP and data link layer encapsulation, avoiding resource waste caused by repeated encapsulation on the operating system kernel and the target processing module.
[0067] S104, the second sending packet is transmitted by the network card.
[0068] Then, the second sending packet is transmitted by the network card arranged in the target processing module, so that the terminal corresponding to the destination address of the second sending packet receives the second sending packet and parses to obtain the to-be-sent data.
[0069] In a specific implementation, before the second sending packet is transmitted, the network card port is determined according to the destination address included in the second sending packet, so that the second sending packet is transmitted through the network card port corresponding to the destination address, to ensure that the second sending packet can reach the terminal corresponding to the target address. Wherein, the destination address is the destination address corresponding to the second sending packet, that is, the to-be-sent data.
[0070] In the embodiment of the present application, for the to-be-sent data, network layer encapsulation is performed by the operating system kernel and data link layer encapsulation is performed by the target processing module, and the second sending packet obtained after encapsulation is sent by the network card arranged on the target processing module, without the need to separately deploy a secure communication strategy on the operating system kernel and the target processing module, and without the need to repeatedly encapsulate on the operating system kernel and the target processing module, thereby reducing the implementation cost and maintenance cost, and avoiding resource waste.
[0071] The communication method of the embodiment of the present application further includes a method step of receiving an external packet, which can be specifically referred to Figure 2 The flowchart is shown, and the specific steps include S201 and S202.
[0072] S201, obtaining a receiving packet by a network card.
[0073] S202, transmitting the receiving packet to the operating system kernel through a first virtual interface corresponding to the receiving packet.
[0074] When obtaining external data sent by an external terminal, a receiving packet is first obtained by the network card arranged on the target processing module, and the receiving packet is sent by the external terminal and includes external data, a source address (an Internet Protocol address and a physical address of the external terminal), and a destination address (an Internet Protocol address and a physical address corresponding to a device to which the operating system kernel belongs).
[0075] The receiving packet is parsed by the target processing module to obtain an Internet Protocol address, the first virtual interface is determined according to the Internet Protocol address, and the receiving packet is transmitted to the operating system kernel through the first virtual interface, thereby completing the reception of data.
[0076] In the embodiment of the present application, a second virtual interface is further arranged on the operating system kernel, and the virtual local area network corresponding to the operating system kernel is controlled through the second virtual interface arranged on the operating system kernel, wherein the second virtual interface corresponds to a network layer interface on the target processing module. Through the second virtual interface, a management interface can be called out, so as to configure the current virtual local area network based on the management interface and the like.
[0077] Optionally, the second virtual interface and the first virtual interface can be arranged as the same interface, without the need to separately establish a management interface, thereby reducing the implementation cost and maintenance cost to a certain extent.
[0078] The second aspect of the present application further provides a communication device corresponding to the communication method, and since the principle of solving problems in the communication device of the present application is similar to the above-mentioned communication method of the present application, the implementation of the electronic device can be referred to the implementation of the method, and the repeated parts will not be described herein.
[0079] Figure 3 A schematic diagram of a communication device provided by an embodiment of the present application is shown, and specifically includes:
[0080] The first encapsulation module 301 is configured to perform network layer encapsulation on the to-be-sent data through an operating system kernel, to obtain a first sending packet;
[0081] The first transmission module 302 is configured to transmit the first sending packet to a target processing module, which is in communication connection with the operating system kernel;
[0082] The second encapsulation module 303 is configured to perform data link layer encapsulation on the first sending packet through the target processing module, to obtain a second sending packet;
[0083] The sending module 304 is configured to send the second sending packet through a network card, which is arranged in the target processing module.
[0084] In yet another embodiment, the first encapsulation module 301 is specifically configured to:
[0085] Obtain an Internet Protocol address corresponding to a first virtual interface, which is pre-created;
[0086] Perform network layer encapsulation on the to-be-sent data based on the Internet Protocol address through the operating system kernel, to obtain a first sending packet.
[0087] In yet another embodiment, the first encapsulation module 301 is further configured to:
[0088] Generate a direct connection route based on the Internet Protocol address, the direct connection route being used to map the first virtual interface and a network layer interface on the target processing module;
[0089] Perform network layer encapsulation on the to-be-sent data based on the Internet Protocol address and the direct connection route.
[0090] In yet another embodiment, the first transmission module 302 is specifically configured to:
[0091] Transmit the first sending packet from the operating system kernel to the target processing module through the first virtual interface and a network layer interface corresponding to the first virtual interface based on the direct connection route.
[0092] In yet another embodiment, the first transmission module 302 is further configured to:
[0093] When the first sending packet is multiple, determine a queue number, which is arranged in the operating system kernel;
[0094] According to the number of queues, the first sending packet is transmitted by the operating system kernel to the target processing module.
[0095] In yet another embodiment, the second encapsulation module 303 is specifically configured to:
[0096] Based on the physical address, the first sending packet is data link layer encapsulated by the target processing module to obtain a second sending packet.
[0097] The physical address is the address of a network card.
[0098] In yet another embodiment, the communication device further comprises:
[0099] The obtaining module 305 is configured to obtain a receiving packet through the network card.
[0100] The second transmission module 306 is configured to transmit the receiving packet to the operating system kernel through a first virtual interface corresponding to the receiving packet.
[0101] In yet another embodiment, the communication device further comprises a control module 307 configured to:
[0102] The control module 307 is configured to control a virtual local area network corresponding to the operating system kernel through a second virtual interface set on the operating system kernel, wherein the second virtual interface corresponds to a network layer interface on the target processing module.
[0103] In the embodiments of the present application, for the data to be sent, network layer encapsulation is performed through the operating system kernel and data link layer encapsulation is performed through the target processing module, and the second sending packet obtained after encapsulation is sent through the network card set on the target processing module, without the need to deploy security communication strategies on the operating system kernel and the target processing module respectively, and without the need to perform repeated encapsulation on the operating system kernel and the target processing module, thereby reducing the implementation cost and maintenance cost, and avoiding resource waste.
[0104] The present application also provides an electronic device, and a structural schematic diagram of the electronic device can be as shown in Figure 4 The electronic device at least includes a memory 401 and a processor 402, the memory 401 stores a computer program, and the processor 402 implements the method provided by any embodiment of the present application when executing the computer program on the memory 401. For example, the computer program steps of the electronic device are as follows S11-S14:
[0105] S11, network layer encapsulation is performed on the data to be sent by the operating system kernel to obtain a first sending packet.
[0106] S12, transmit the first sending packet to a target processing module, the target processing module being in communication connection with the operating system kernel;
[0107] S13, perform data link layer encapsulation on the first sending packet by the target processing module to obtain a second sending packet;
[0108] S14, send the second sending packet by a network card, the network card being arranged in the target processing module.
[0109] The embodiment of the present application provides a storage medium, which is a computer readable medium and stores a computer program, the computer program is executed by a processor to implement the method provided by any embodiment of the present application, and includes the following steps S21-S24:
[0110] S21, perform network layer encapsulation on the to-be-sent data by an operating system kernel to obtain a first sending packet;
[0111] S22, transmit the first sending packet to a target processing module, the target processing module being in communication connection with the operating system kernel;
[0112] S23, perform data link layer encapsulation on the first sending packet by the target processing module to obtain a second sending packet;
[0113] S24, send the second sending packet by a network card, the network card being arranged in the target processing module.
[0114] In the embodiment of the present application, for the to-be-sent data, network layer encapsulation is performed by an operating system kernel, data link layer encapsulation is performed by a target processing module, and the second sending packet obtained after encapsulation is sent by a network card arranged on the target processing module, without the need to respectively deploy security communication strategies on the operating system kernel and the target processing module, and without the need to repeatedly encapsulate on the operating system kernel and the target processing module, so that the implementation cost and the maintenance cost are reduced, and resource waste is avoided.
[0115] Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes. Optionally, in the embodiment, the processor executes the method steps recorded in the above embodiments according to the program codes stored in the storage medium. Optionally, the specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, which will not be described here. Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by a general computing device, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be realized by program codes executable by a computing device, so that they can be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described can be executed in a different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific hardware and software combination.
[0116] In addition, although the exemplary embodiments have been described herein, the scope of their protection is to be understood as including any and all equivalents based on the same basic concept embodied in the application. The language of the claims should be construed as not limited to the normal meaning at all circumstances but to encompass everything of which an artisan would have considered to embrace the subject matter sought for protection. The examples above are to be construed as non-exhaustive. For example, the above examples (or one or more aspects thereof) can be used in combination with each other. For example, those of ordinary skill in the art may, using the above description, utilize other embodiments. Additionally, in the above detailed description, various features can be grouped together in one or more embodiments. This should not be interpreted as an intention that an unclaimed disclosed feature is essential to any claim. On the contrary, claimed subject matter can be less than all of the disclosed embodiments. Thus, the following claims are hereby incorporated into the detailed description, by way of examples or embodiments, where each claim can stand on its own as a separate embodiment, and the subject matter can be combined in various combinations or permutations of the embodiments. The scope of the application is to be determined with reference to the following claims along with the full scope of equivalents to which such claims are entitled.
[0117] The above description is intended to be illustrative, and not restrictive. For example, the above-described examples (or one or more aspects thereof) can be used in combination with each other. For example, other embodiments utilizing the above description can be employed without departing from the scope of the application. Additionally, in the above detailed description, various features can be grouped together in one or more embodiments. This should not be interpreted as an intention that an unclaimed disclosed feature is essential to any claim. On the contrary, claimed subject matter can be less than all of the disclosed embodiments. Thus, the following claims are hereby incorporated into the detailed description, by way of examples or embodiments, where each claim can stand on its own as a separate embodiment, and the subject matter can be combined in various combinations or permutations of the embodiments. The scope of the application is to be determined with reference to the following claims along with the full scope of equivalents to which such claims are entitled.
[0118] The above has carried out the detailed explanation to the multiple embodiments of the application, but the application is not limited to these specific embodiments, and the person skilled in the art can make various modified embodiments on the basis of the concept of the application, and these modifications shall fall within the scope of the application claimed.
Claims
1. A communication method, comprising: The operating system kernel performs network layer encapsulation on the data to be sent to obtain the first message to be sent. The first message is transmitted to the target processing module, which is communicatively connected to the operating system kernel; wherein, the target processing module includes a vector packet processing engine; The target processing module performs data link layer encapsulation on the first transmission message to obtain the second transmission message; The second transmission message is sent via a network interface card (NIC), wherein the NIC is configured in the target processing module; the first transmission message is obtained by network layer encapsulation of the data to be transmitted through the operating system kernel, including: Obtain the Internet Protocol address corresponding to the first virtual interface, which is pre-created; The operating system kernel encapsulates the data to be sent at the network layer based on the Internet Protocol address to obtain a first transmission message. The process of encapsulating the data to be sent based on the Internet Protocol address at the network layer includes: Based on the Internet Protocol address, a direct connection route is generated, which is used to map the first virtual interface to the network layer interface on the target processing module. Based on the Internet Protocol address and the direct route, the data to be sent is encapsulated at the network layer. The step of transmitting the first message to the target processing module includes: Based on the direct connection route, the first transmission message is transmitted from the operating system kernel to the target processing module through the first virtual interface and the network layer interface corresponding to the first virtual interface.
2. The communication method according to claim 1, wherein transmitting the first transmission message from the operating system kernel to the target processing module comprises: When there are multiple first sent messages, the number of queues is determined, and the number of queues is set in the operating system kernel; According to the number of queues, the first message is transmitted from the operating system kernel to the target processing module.
3. The communication method according to claim 1, wherein the step of encapsulating the first transmission message at the data link layer through the target processing module to obtain the second transmission message includes: Based on the physical address, the first transmission packet is encapsulated at the data link layer by the target processing module to obtain the second transmission packet; The physical address is the address of the network card.
4. The communication method according to claim 1 further includes: The received message is obtained through the network card; The received message is transmitted to the operating system kernel through the first virtual interface corresponding to the received message.
5. The communication method according to any one of claims 1-4, further comprising: The virtual local area network corresponding to the operating system kernel is controlled through a second virtual interface set on the operating system kernel, wherein the second virtual interface corresponds to the network layer interface on the target processing module.
6. A communication device, comprising: The first encapsulation module is configured to encapsulate the data to be sent at the network layer through the operating system kernel to obtain the first transmission message. A first transmission module is configured to transmit a first message to a target processing module, the target processing module being communicatively connected to the operating system kernel; wherein the target processing module includes a vector packet processing engine. The second encapsulation module is configured to encapsulate the first transmission message at the data link layer through the target processing module to obtain the second transmission message. A sending module configured to send the second sending message via a network interface card (NIC), wherein the NIC is located in the target processing module; The first encapsulation module is specifically configured as follows: Obtain the Internet Protocol address corresponding to the first virtual interface, which is pre-created; The operating system kernel encapsulates the data to be sent at the network layer based on the Internet Protocol address to obtain a first transmission message. The first encapsulation module is also configured as follows: Based on the Internet Protocol address, a direct connection route is generated, which is used to map the first virtual interface to the network layer interface on the target processing module. Based on the Internet Protocol address and the direct route, the data to be sent is encapsulated at the network layer. The first transmission module is specifically configured as follows: Based on the direct connection route, the first transmission message is transmitted from the operating system kernel to the target processing module through the first virtual interface and the network layer interface corresponding to the first virtual interface.
Citation Information
Patent Citations
Method and system for communication of user state and inner core
CN103428226A
Network communication method and device
CN115834665A