Communication method, device and computer readable storage medium

By establishing a layer 2 tunnel in device access, interoperability devices and proxy devices, the obstacles of communication between devices and equipment and industrial software on the cloud platform are solved, communication without sensing deployment forms is achieved, and IP addresses are not routed and Overlapping issues ensure the reliability and flexibility of communication.

CN115706682BActive Publication Date: 2024-11-15SHENZHEN AI LINK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110895884.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2024-11-15
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

Under the trend of industrial software virtualization and cloudization, equipment and industrial software cannot communicate effectively within the same IP subnet, resulting in communication barriers between equipment and equipment, equipment and industrial software, especially when deployed on cloud platforms IP addresses are not routed, and IP addresses set by different service providers may cause overlapping problems.

Method used

By deploying tunnel interfaces in device access devices, device intercommunication devices and intercommunication agents, establishing layer two tunnels, encapsulating and decapsulating data frames, enabling them to cross physical networks and cloud platforms to realize equipment and equipment and equipment and industrial software communication between.

Benefits of technology

It realizes communication between devices and devices and industrial software without sensing the deployment form, solves the problems of communication barriers and IP address overlap on the cloud platform, and ensures the reliability and flexibility of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115706682B_ABST
    Figure CN115706682B_ABST
Patent Text Reader

Abstract

The present application provides a communication method, apparatus, and computer-readable storage medium, wherein the method on the device access device side includes: receiving a layer 2 data frame sent by a device at a sending end through a network card on the device side; encapsulating the layer 2 data frame into a first layer 3 IP message through a tunnel interface and sending it out, wherein the first layer 3 IP message includes a layer 2 data frame and an encapsulation header, and the encapsulation header includes a tunnel identifier. The method on the device intercommunication device side includes: receiving a third layer 3 IP message, and determining a first tunnel interface for processing the third layer 3 IP message; decapsulating the third layer 3 IP message through the first tunnel interface to obtain an original layer 2 data frame, and forwarding the original layer 2 data frame to a second tunnel interface for processing the original layer 2 data frame through a bridge device; encapsulating the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface and sending it out. This method realizes communication between devices and applications without the need to perceive the deployment form.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method, device and computer-readable storage medium. Background Art

[0002] With the continuous development of wireless communication technology, in the industrial field, it has become a development trend to realize communication between devices and between devices and industrial software through wireless networks such as the fourth generation mobile communication technology (4G) network or the fifth generation mobile communication technology (5G) network.

[0003] Currently, devices and industrial software need to be deployed in the same IP subnet, and the IP address segment of the subnet is flexibly set by the service provider according to demand. Devices and industrial software communicate based on IP addresses in the same IP subnet.

[0004] However, with the trend of virtualization and cloudification of industrial software, industrial software is gradually deployed on cloud platforms. In this case, it is no longer possible to continue to use the existing communication method within the same IP subnet for communication between devices and industrial software. In addition, there is an urgent need to provide a communication method that can realize communication between devices and between devices and industrial software without perceiving the deployment form. Summary of the invention

[0005] One of the purposes of the present application is to provide a communication method, apparatus and computer-readable storage medium to address the deficiencies in the above-mentioned prior art, so as to enable communication between devices and between devices and industrial software without the need to perceive the deployment form.

[0006] In a first aspect, an embodiment of the present application provides a communication method, which is applied to a device access apparatus, wherein a device side network card, a terminal side network card, and a tunnel interface are deployed in the device access apparatus, and the method includes:

[0007] Receiving, through the network card on the device side, a layer 2 data frame sent by a device on the sending end;

[0008] Encapsulating the layer 2 data frame into a first layer 3 IP message through the tunnel interface, wherein the first layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of a tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the terminal side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface;

[0009] The first layer-3 IP message is sent to a network terminal through the terminal-side network card, and the first layer-3 IP message is sent to a device intercommunication apparatus corresponding to the destination IP address in the IP header through the network terminal.

[0010] In a second aspect, an embodiment of the present application provides a communication method, which is applied to a device intercommunication device, wherein at least one tunnel interface and a bridge device are deployed in the device intercommunication device, and each of the tunnel interfaces is respectively mounted on the bridge device, and the method includes:

[0011] receiving a third layer 3 IP message, parsing the third layer 3 IP message, and determining a first tunnel interface for processing the third layer 3 IP message;

[0012] Decapsulating the third layer-3 IP message through the first tunnel interface to obtain an original layer-2 data frame, and forwarding the original layer-2 data frame to the second tunnel interface for processing the original layer-2 data frame through the bridge device;

[0013] Encapsulating the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface, the fourth layer 3 IP message including the original layer 2 data frame and an encapsulation header, the encapsulation header including an IP header, the source IP address in the IP header being the IP address of the network card of the device intercommunication apparatus, and the destination IP address in the IP header being the IP address of the tunnel peer corresponding to the second tunnel interface;

[0014] The fourth layer 3 IP message is sent to a target device, and the fourth layer 3 IP message is sent to a target device corresponding to a destination IP address in the IP header via a network terminal at a receiving end, wherein the target device includes a network terminal or an intercommunication proxy device.

[0015] In a third aspect, an embodiment of the present application provides a communication method, which is applied to an intercommunication proxy device, wherein an application side network card, a network side network card, and a bridge device are deployed in the intercommunication proxy device, and a tunnel interface is mounted on the bridge device, and the method includes:

[0016] Receiving the layer 2 data frame sent by the application through the application side network card;

[0017] Encapsulate the layer 2 data frame into a layer 3 IP message through the tunnel interface, the layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the network side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface;

[0018] The three-layer IP message is sent to the device intercommunication device corresponding to the destination IP address in the IP header through the network side network card.

[0019] In a fourth aspect, the present application provides a communication device, which is applied to a device access device, wherein a device side network card, a terminal side network card and a tunnel interface are deployed in the device access device, and the device includes:

[0020] A first receiving module, used for receiving a layer 2 data frame sent by a device at a sending end through the device side network card;

[0021] an encapsulation module, configured to encapsulate the layer 2 data frame into a first layer 3 IP message through the tunnel interface, wherein the first layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of a tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the terminal side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface;

[0022] The first sending module is used to send the first three-layer IP message to the network terminal through the terminal side network card, and send the first three-layer IP message to the device intercommunication device corresponding to the destination IP address in the IP header via the network terminal.

[0023] In a fifth aspect, the present application provides a communication device, which is applied to a device intercommunication device, wherein at least one tunnel interface and a bridge device are deployed in the device intercommunication device, and each of the tunnel interfaces is respectively mounted on the bridge device, and the device includes:

[0024] A receiving module, used for receiving a third layer-3 IP message, parsing the third layer-3 IP message, and determining a first tunnel interface for processing the third layer-3 IP message;

[0025] a decapsulation module, configured to decapsulate the third layer-3 IP message through the first tunnel interface to obtain an original layer-2 data frame, and forward the original layer-2 data frame to the second tunnel interface for processing the original layer-2 data frame through the bridge device;

[0026] an encapsulation module, configured to encapsulate the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface, wherein the fourth layer 3 IP message includes the original layer 2 data frame and an encapsulation header, wherein the encapsulation header includes an IP header, wherein the source IP address in the IP header is the IP address of the network card of the device intercommunication apparatus, and the destination IP address in the IP header is the IP address of the tunnel peer corresponding to the second tunnel interface;

[0027] The sending module is used to send the fourth third-layer IP message to the target device, and send the fourth third-layer IP message to the target device corresponding to the destination IP address in the IP header via the network terminal at the receiving end. The target device includes a network terminal or an intercommunication proxy device.

[0028] In a sixth aspect, the present application provides a communication device, which is applied to an intercommunication proxy device, wherein an application side network card, a network side network card and a bridge device are deployed in the intercommunication proxy device, and a tunnel interface is mounted on the bridge device, and the device includes:

[0029] A receiving module, used for receiving a layer 2 data frame sent by an application through the application side network card;

[0030] An encapsulation module, configured to encapsulate the layer 2 data frame into a layer 3 IP message through the tunnel interface, wherein the layer 3 IP message includes the layer 2 data frame and an encapsulation header, wherein the encapsulation header includes an IP header and a tunnel identifier of a tunnel corresponding to the tunnel interface, wherein the source IP address in the IP header is the IP address of the network side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface;

[0031] The sending module is used to send the three-layer IP message to the device intercommunication device corresponding to the destination IP address in the IP header through the network side network card.

[0032] In the seventh aspect, an embodiment of the present application provides a communication device, the device comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, when the communication device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to execute the method described in the first aspect, the second aspect or the third aspect above.

[0033] In an eighth aspect, an embodiment of the present application provides a computer storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the method steps described in the first aspect, the second aspect or the third aspect.

[0034] The communication method, device and computer-readable storage medium provided by the present application are that after receiving the layer 2 data frame of the device at the sending end, the device access device encapsulates the layer 2 data frame into a layer 3 IP message through the tunnel interface, and carries the tunnel identifier of the tunnel corresponding to the tunnel interface in the layer 3 IP message, so that the layer 3 IP message can be transmitted to the device intercommunication device through the tunnel encapsulation, and then through the cooperation and processing of the device intercommunication device, the layer 2 data frame can be sent to the device or application at the receiving end, thereby realizing the communication between devices and devices and between devices and applications without perceiving the deployment form. In addition, after receiving the layer 3 IP message, the device intercommunication device parses the tunnel identifier of the encapsulated and processed message from it, and determines the first tunnel interface for processing the message according to the tunnel identifier, and the first tunnel interface decapsulates the layer 3 IP message to obtain the original layer 2 data frame, and then the bridge device forwards the original layer 2 data frame to the second tunnel interface, and the second tunnel interface encapsulates it into an IP message and sends it to the target device, so that the layer 2 data frame can be sent to the device or application, thereby realizing the communication between devices and devices and between devices and applications without perceiving the deployment form. In addition, after receiving the layer 2 data frame of the application, the intercommunication proxy device encapsulates the layer 2 data frame into a layer 3 IP message through the tunnel interface, and carries the tunnel identifier of the tunnel corresponding to the tunnel interface in the layer 3 IP message, so that the layer 3 IP message can be transmitted to the device intercommunication device through the tunnel encapsulation, and then through the cooperative processing of the device intercommunication device, the layer 2 data frame can be sent to the device at the receiving end, thereby realizing communication between the device and the application without perceiving the deployment form. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A system architecture diagram of a communication system used by the communication method provided in an embodiment of the present application;

[0037] Figure 2 It is a structural diagram of the device access device;

[0038] Figure 3 It is a structural schematic diagram of a device intercommunication device;

[0039] Figure 4 It is a structural diagram of an intercommunication proxy device;

[0040] Figure 5A schematic diagram of a flow chart of a device access apparatus communication method provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of a flow chart of another device access apparatus communication method provided in an embodiment of the present application;

[0042] Figure 7 A schematic diagram of a device intercommunication method for communication provided in an embodiment of the present application;

[0043] Figure 8 A flow chart of a communication method for an intercommunication proxy device provided in an embodiment of the present application;

[0044] Fig. 9 A flowchart of another intercommunication proxy device communication method provided in an embodiment of the present application;

[0045] Fig.10 This is a schematic diagram of the interaction between devices in the present application for transmitting layer 2 data frames;

[0046] Fig.11 A schematic diagram of the interaction between the device and the application for transmitting layer 2 data frames in this application;

[0047] Fig.12 A module structure diagram of a communication device provided by the present application;

[0048] Fig.13 A module structure diagram of another communication device provided by the present application;

[0049] Fig.14 A module structure diagram of another communication device provided by the present application;

[0050] Fig.15 A schematic diagram of the structure of a communication device 150 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0052] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0053] When the deployment form of industrial software changes, for example, when it is deployed on a cloud platform, it is no longer possible to continue to use the communication method in the same IP subnet in the existing technology to communicate between devices and industrial software. This is specifically manifested in the following two aspects.

[0054] First, the equipment and industrial software are deployed in the same IP subnet. The IP address segment of the IP subnet is flexibly set by the service provider according to demand. However, the IP addresses in this IP address segment are not routable in the cloud platform network. Therefore, the equipment and industrial software deployed on the cloud platform cannot achieve intercommunication at the IP layer.

[0055] Secondly, devices and industrial software may need to exchange Layer 2 data frames, but these Layer 2 data frames cannot pass through the physical network and the Layer 3 network of the cloud platform, resulting in the inability of devices and industrial software deployed on the cloud platform to achieve Layer 2 intercommunication.

[0056] In addition, IP addresses between devices may overlap due to settings of different service providers, and it is impossible to continue to use the communication method in the same IP subnet in the existing technology to communicate between devices.

[0057] Based on the above-mentioned problems, an embodiment of the present application proposes a communication method, which provides a device access device, a device intercommunication device and an intercommunication proxy device, and these devices establish a layer 2 tunnel on the data transmission path, so that data communication can be carried out between devices and between devices and industrial software through the tunnel, thereby realizing communication between devices and between devices and industrial software without perceiving the deployment form.

[0058] For ease of description, IP packets are referred to as packets in some of the following embodiments. It should be understood that the two have the same meaning.

[0059] Figure 1 A system architecture diagram of a communication system used by the communication method provided in the embodiment of the present application, such as Figure 1 As shown, the communication system includes: a device, a device access device and a network terminal at the sending end, a device intercommunication device, a network terminal, a device access device and a device at the receiving end, an intercommunication agent device and an application.

[0060] The device may refer to any entity that supports Ethernet communication, for example, a programmable logic controller, a personal computer, an industrial computer, a robotic arm, etc.

[0061] It should be understood that the above description of the device is applicable to both the device at the transmitting end and the device at the receiving end.

[0062] The device access device may be a physical entity. Figure 2 It is a structural diagram of the device access device, such as Figure 2 As shown, at least a device-side network card, a terminal-side network card and a tunnel interface are deployed in the device access device. Among them, the device-side network card is used to connect the device, and the terminal-side network card is used to connect the network terminal. Optionally, a bridge device is also deployed in the device access device, and the above-mentioned tunnel interface is mounted on the bridge device. The tunnel interface receives encapsulated messages and sends encapsulated messages through the terminal-side network card. The device access device establishes one or more layer 2 tunnels between the device intercommunication device and the device intercommunication device through the above-mentioned tunnel interface. Specifically, the tunnel interface receives a layer 2 data frame sent by the device, encapsulates the layer 2 data frame in a layer 2 tunnel and sends it to the device intercommunication device. At the same time, the tunnel interface receives a message sent by the device intercommunication device through the layer 2 tunnel, decapsulates the message, and sends the decapsulated layer 2 data frame to the device.

[0063] It should be understood that the above description of the device access device is applicable to both the device access device at the transmitting end and the device access device at the receiving end.

[0064] The network terminal may be, for example, a 5G terminal, a 4G terminal, etc. The network terminal includes at least one network-side interface and one device-side interface. The network terminal may perform address conversion on the tunnel-encapsulated message sent by the device access device, replace the source IP address in the IP message with the network-side interface IP address of the network terminal, and send the IP message to the device intercommunication device via the wireless network. In addition, after receiving the IP message from the wireless network, the network terminal performs address conversion on the IP message, replaces the destination address with the IP address of the terminal-side network card of the device access device, and sends the IP message to the device access device.

[0065] It should be understood that the above description of the network terminal is applicable to both the network terminal at the sending end and the network terminal at the receiving end.

[0066] The device intercommunication device can be deployed on a cloud platform, specifically in the form of a virtual machine, container, or physical machine. This application does not limit the specific form of the device intercommunication device. A layer 2 tunnel can be established between the device intercommunication device and each device access device, and intercommunication between devices connected to each tunnel and between devices and applications can be achieved. Figure 3 It is a structural diagram of the device intercommunication device, such as Figure 3As shown, a network card, at least one tunnel interface and a bridge device are deployed in the device intercommunication device, and each tunnel interface is respectively mounted on the bridge device. The device intercommunication device establishes a layer 2 tunnel between the device access device or the intercommunication proxy device through the tunnel interface. After receiving the tunnel-encapsulated IP message, the network card of the device intercommunication device sends the IP message to the corresponding tunnel interface. The tunnel interface decapsulates the tunnel message, and the decapsulated original layer 2 data frame is forwarded through the bridge device.

[0067] Optionally, a plurality of virtual Ethernet pairs and routers are also deployed in the device intercommunication device, each virtual Ethernet pair corresponds to an IP subnet, and the virtual Ethernet pair includes a pair of virtual interfaces, one of which is mounted on a bridge device, and the other of which is set with a gateway IP address of the corresponding subnet. In a virtual Ethernet pair, a data frame received from one interface can be forwarded to another interface without modification. The forwarding of messages between devices in different subnets is completed through a router. Specifically, an interface with a gateway IP address of a subnet set in a virtual Ethernet pair communicates with a router to complete the forwarding of messages. The specific process will be described in detail in the following embodiments.

[0068] It is worth mentioning that Figure 3 Two virtual Ethernet pairs and three tunnel interfaces are illustrated in the figure. It should be understood that this is only an example and not a limitation to the present application.

[0069] The intercommunication proxy device can be deployed on a cloud platform, specifically in the form of a virtual machine, a container, or a physical machine. This application does not limit the specific form of the intercommunication proxy device. In addition, the application can also be deployed on a cloud platform, specifically in a virtual machine or a container, which has a network card for communicating with other devices. Figure 4 is a schematic diagram of the structure of the intercommunication proxy device, such as Figure 4 As shown, the intercommunication proxy device deploys an application-side network card, a network-side network card, and a bridge device, and a tunnel interface is mounted on the bridge device. Among them, the application-side network card connects to the application, and the network-side network card communicates with the device intercommunication device. At the same time, the bridge device is deployed in the intercommunication proxy device to realize the forwarding of the second-layer data frame. The tunnel interface mounted on the bridge device receives and sends tunnel-encapsulated messages through the network-side network card. The intercommunication proxy device establishes a second-layer tunnel between the tunnel interface and the device intercommunication device, receives the second-layer data frame sent by the application through the bridge device, encapsulates it in the second-layer tunnel and sends it to the device intercommunication device. At the same time, it also receives the message sent from the device intercommunication device through the second-layer tunnel, decapsulates the message, and sends the decapsulated second-layer data frame to the application via the bridge device.

[0070] Continue to refer to Figure 4The intercommunication proxy device and the application can be deployed on the same physical server. A bridge device is deployed in the physical server, and the bridge device can be, for example, a Linux bridge or an Open vSwitch bridge. The network card on the virtual machine or container where the application is located is mounted on the bridge device, and an application-side network card of the intercommunication proxy device is also mounted on the bridge device.

[0071] Optional, above Figure 2 , Figure 3 as well as Figure 4 The bridge devices shown in the figure can each be a software component.

[0072] The following describes the communication processing procedures of the device access device, the device intercommunication device, and the intercommunication proxy device respectively.

[0073] Figure 5 A flow chart of a device access device communication method provided in an embodiment of the present application, wherein the execution subject of the method is the above-mentioned device access device, such as Figure 5 As shown, the method includes:

[0074] S501. Receive a layer 2 data frame sent by a device at a sending end through a network card at a device side.

[0075] As described above, the device access device deploys a device-side network card, a terminal-side network card, and a tunnel interface. When the device at the sending end generates and sends out a layer 2 data frame to be sent, the device-side network card can receive the layer 2 data frame accordingly.

[0076] Optionally, the layer 2 data frame may be a unicast data frame, such as a media access control (MAC) address of a device at the receiving end. Alternatively, the layer 2 data frame may also be a broadcast data frame, such as an address resolution protocol (ARP) broadcast data frame for querying the mapping relationship between an IP address and a MAC address.

[0077] S502. Encapsulate the above-mentioned layer 2 data frame into a first layer 3 IP message through a tunnel interface.

[0078] Among them, the first three-layer IP message includes the above-mentioned two-layer data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the above-mentioned tunnel interface, the source IP address in the IP header is the IP address of the terminal side network card of the device access device, and the destination IP address in the IP header is the IP address of the other end of the tunnel corresponding to the above-mentioned tunnel interface.

[0079] Exemplarily, the tunnel interface can use a virtual eXtensible Local Area Network (VxLAN) to tunnel the layer 2 data frame. Specifically, the tunnel interface sequentially encapsulates an IP header, a User Datagram Protocol (UDP) header, and a VxLAN header based on the layer 2 data frame. The tunnel identifier of the tunnel corresponding to the tunnel interface can be included in the VxLAN header.

[0080] Optionally, the tunnel identifier of the tunnel corresponding to the above-mentioned tunnel interface can be determined in advance by negotiation between the device access device and the device intercommunication device, or can also be pre-configured by the user on the device access device and the device intercommunication device. Taking negotiation as an example, the device access device and the device intercommunication device can negotiate in advance to establish one or more Layer 2 tunnels between the two, and negotiate to determine the tunnel identifier of each tunnel. Accordingly, in this step, when the device access device encapsulates the Layer 2 data frame, it can first determine which tunnel is responsible for encapsulating and transmitting the Layer 2 data frame, and write the tunnel identifier of the tunnel into the VxLAN header of the encapsulated first Layer 3 IP message.

[0081] S503: Send the first layer-3 IP message to the network terminal through the terminal-side network card, and send the first layer-3 IP message to the device intercommunication apparatus corresponding to the destination IP address in the IP header through the network terminal.

[0082] The network terminal refers to the network terminal at the sending end. After the device access device encapsulates the layer 2 data frame into the layer 1 and layer 3 IP message, the terminal side network card sends the layer 1 and layer 3 IP message to the network terminal, and then the network terminal sends the layer 1 and layer 3 IP message to the device intercommunication device.

[0083] Optionally, after receiving the above-mentioned first three-layer IP message, the network terminal performs source IP address conversion on the first three-layer IP message, converting the source IP address into the IP address of the network side interface of the network terminal, and the network terminal then sends the converted first three-layer IP message to the device intercommunication device through the wireless network.

[0084] In this embodiment, after receiving the layer 2 data frame from the device at the sending end, the device access device encapsulates the layer 2 data frame into a layer 3 IP message through the tunnel interface, and carries the tunnel identifier of the tunnel corresponding to the tunnel interface in the layer 3 IP message, so that the layer 3 IP message can be transmitted to the device intercommunication device through the tunnel encapsulation, and then through the cooperative processing of the device intercommunication device, the layer 2 data frame can be sent to the device or application at the receiving end, thereby realizing communication between devices and devices and between devices and applications without perceiving the deployment form.

[0085] Refer to the aforementioned Figure 2 As an optional implementation, a bridge device is also deployed in the device access apparatus, and the above-mentioned tunnel interface is mounted on the bridge device. Accordingly, an optional manner of the above-mentioned step S502 includes:

[0086] The above-mentioned layer 2 data frame is forwarded to the above-mentioned tunnel interface through the above-mentioned bridge device, and the above-mentioned layer 2 data frame is encapsulated into a first layer 3 IP message through the above-mentioned tunnel interface.

[0087] Optionally, after receiving the layer 2 data frame, the device side network card forwards the layer 2 data frame to the bridge device, and the bridge device then forwards the layer 2 data frame to the tunnel interface mounted on the bridge device. Furthermore, the tunnel interface can encapsulate the layer 2 data frame into the first layer 3 IP message in the aforementioned manner.

[0088] The above steps S501-S503 describe the processing process when the device access device acts as a sending device access device to send data. The following describes the process of the device access device acting as a receiving device access device to receive and process data.

[0089] Figure 6 A flow chart of another device access apparatus communication method provided in an embodiment of the present application, such as Figure 6 As shown, the above method also includes:

[0090] S601. Receive a second layer-3 IP message sent by a network terminal, wherein the destination IP address of the second layer-3 IP message is the IP address of a terminal-side network card of a device access apparatus.

[0091] The specific structure of the second layer 3 IP message will be described in detail in steps S703-S704 of the embodiment of the device intercommunication apparatus described below.

[0092] The above-mentioned network terminal refers to a network terminal at the receiving end.

[0093] After the network terminal receives the second and third layer IP messages sent by the device intercommunication device through the wireless network, it converts the destination IP address of the second and third layer IP messages, converts the destination IP address into the IP address of the terminal side network card of the device access device at the receiving end, and sends the converted second and third layer IP messages to the terminal side network card of the device access device.

[0094] S602. Decapsulate the second layer-3 IP message through the tunnel interface to obtain an original layer-2 data frame.

[0095] Optionally, after receiving the second and third layer IP packets, the terminal side network card forwards the second and third layer IP packets to the bridge device, and then the bridge device forwards them to the above-mentioned tunnel interface.

[0096] After receiving the second and third layer IP messages, the tunnel interface decapsulates them. Specifically, the tunnel interface removes the encapsulation header in the second and third layer IP messages to obtain the original layer 2 data frame encapsulated therein.

[0097] S603: Send the original layer 2 data frame to the receiving device through the above-mentioned bridge device.

[0098] Optionally, a forwarding table is built into the bridge device. Based on the forwarding table, the bridge device can learn the receiving device of the original Layer 2 data frame. The bridge device then sends the original Layer 2 data frame to the receiving device via the device-side network card. Correspondingly, the receiving device receives the original Layer 2 data frame.

[0099] The following describes the communication processing procedure of the device intercommunication apparatus.

[0100] Figure 7 A schematic diagram of a flow chart of a device intercommunication method provided in an embodiment of the present application, wherein the execution subject of the method is the above-mentioned device intercommunication device, such as Figure 7 As shown, the method includes:

[0101] S701. Receive a third layer-3 IP message, parse the third layer-3 IP message, and determine a first tunnel interface for processing the third layer-3 IP message.

[0102] As mentioned above, at least one tunnel interface and a bridge device are deployed in the device intercommunication device, and each tunnel interface is mounted on the bridge device. In addition, a network card is also deployed in the device intercommunication device, and the network card receives the third layer IP message from the wireless network or the cloud network. The third layer IP message can be sent by the device access device or the interactive proxy device. Taking the sending by the device access device as an example, the structure of the third layer IP message is the message structure encapsulated by the tunnel interface in the aforementioned step S502, that is, it includes a layer 2 data frame and an encapsulation header. For details, please refer to the description in the aforementioned step S502. If the third layer IP message is sent by the interactive proxy device, the specific structure of the third layer IP message is the same as the message structure sent by the device access device, and will not be repeated.

[0103] Optionally, the device intercommunication device parses the third layer-3 IP message to obtain a tunnel identifier for transmitting the third layer-3 IP message, and determines, based on the tunnel identifier, a first tunnel interface corresponding to the tunnel identified by the tunnel identifier.

[0104] When the device intercommunication device parses the third layer 3 IP message, for example, it can read the tunnel identifier from the VxLAN header of the third layer 3 IP message, and determine the first tunnel interface for processing the third layer 3 IP message according to the tunnel identifier. As mentioned above, the device intercommunication device and the device access device can pre-negotiate to establish one or more layer 2 tunnels between the two, and negotiate to determine the tunnel identifier of each tunnel. At the same time, the device intercommunication device will also establish a tunnel interface for each tunnel, and establish a corresponding relationship between the tunnel identifier and the tunnel interface. Correspondingly, in this step, the device intercommunication device can determine the first tunnel interface for processing the third layer 3 IP message according to the resolved tunnel identifier and the corresponding relationship between the tunnel identifier and the tunnel interface. In addition, for the intercommunication proxy device, the same method as the device access device can also be used to establish one or more layer 2 tunnels between the intercommunication proxy device and the device intercommunication device. Correspondingly, if the above-mentioned third layer 3 IP message is a message sent by the intercommunication proxy device, the device intercommunication device can determine the first tunnel interface for processing the third layer 3 IP message according to the corresponding relationship between the tunnel identifier and the tunnel interface before the intercommunication proxy device.

[0105] S702. Decapsulate the third layer-3 IP message through the first tunnel interface to obtain an original layer-2 data frame, and forward the original layer-2 data frame to the second tunnel interface that processes the original layer-2 data frame through a bridge device.

[0106] Specifically, the first tunnel interface removes the encapsulation header in the third layer-3 IP message to obtain the original layer-2 data frame encapsulated therein, and forwards the original layer-2 data frame to the bridge device.

[0107] After receiving the original layer 2 data frame, the bridge device sends the original layer 2 data frame to the second tunnel interface according to the recorded forwarding table. The specific forwarding process will be described in detail in the following embodiments.

[0108] S703. Encapsulate the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface.

[0109] Among them, the above-mentioned fourth third-layer IP message includes the above-mentioned original second-layer data frame and an encapsulation header, the encapsulation header includes an IP header, the source IP address in the IP header is the IP address of the network card of the device intercommunication device, and the destination IP address in the IP header is the IP address of the tunnel peer corresponding to the second tunnel interface.

[0110] Specifically, if the receiving end of the fourth layer 3 IP message is a device, the destination IP address is the IP address of the network terminal of the receiving end. If the receiving end of the fourth layer 3 IP message is an application, the destination IP address is the IP address of the intercommunication proxy device corresponding to the application.

[0111] Taking the second tunnel interface encapsulated using VxLAN as an example, the second tunnel interface encapsulates the IP header, UDP header and VxLAN header in sequence based on the above-mentioned original Layer 2 data frame, thereby obtaining the above-mentioned fourth Layer 3 IP message.

[0112] S704: Send the fourth layer-3 IP message to a target device, which includes a network terminal or an intercommunication proxy device.

[0113] Optionally, when the receiving end of the fourth-third layer IP message is a device, the device intercommunication device sends the fourth-third layer IP message to the network terminal of the receiving end via the wireless network, and the network terminal modifies the destination IP address of the message to the IP address of the terminal side network card of the device access device of the receiving end, and sends the converted message to the device access device. The device access device uses the process of the aforementioned steps S601-S603 to decapsulate the second layer data frame from the message, and then sends the second layer data frame to the device at the receiving end.

[0114] When the receiving end of the fourth layer 3 IP message is an application, the device intercommunication device sends the fourth layer 3 IP message to the intercommunication proxy device corresponding to the application via the cloud network, and the intercommunication proxy device decapsulates the fourth layer 3 IP message to obtain a layer 2 data frame, and then sends the layer 2 data frame to the application. The processing process of the intercommunication proxy device will be described in detail in the following embodiments.

[0115] In this embodiment, after receiving a layer-3 IP message, the device intercommunication device parses out the tunnel identifier that encapsulates and processes the message, and determines the first tunnel interface that processes the message based on the tunnel identifier. The first tunnel interface decapsulates the layer-3 IP message to obtain the original layer-2 data frame, and then the bridge device forwards the original layer-2 data frame to the second tunnel interface, which encapsulates it into an IP message and sends it to the target device, so that the layer-2 data frame can be sent to the device or application, thereby realizing communication between devices and between devices and between devices and applications without sensing the deployment form.

[0116] The following describes the process in which the bridge device forwards the original layer 2 data frame to the second tunnel interface in the above step S702.

[0117] Optionally, the bridge device may forward the original layer 2 data frame for the data frame for communication within the same IP subnet or for communication across IP subnets. If the communication is within the same IP subnet, the bridge device may directly determine the second tunnel interface to be forwarded based on the forwarding table and forward the data frame. If the communication is across IP subnets, the bridge device may use a router for routing forwarding.

[0118] For details, refer to the above Figure 3, a plurality of virtual Ethernet pairs and routers are also deployed in the device intercommunication device, each virtual Ethernet pair corresponds to an IP subnet, each virtual Ethernet pair includes a pair of virtual interfaces, one of the interfaces in the pair of virtual interfaces is mounted on the bridge device, and the other interface in the pair of virtual interfaces is set with the gateway IP address of the corresponding subnet. When forwarding, the bridge device forwards the original layer 2 data frame to the second interface of the first virtual Ethernet pair through the first interface of the first virtual Ethernet pair, and the second interface of the first virtual Ethernet pair routes the IP message in the original layer 2 data frame to the third interface of the second virtual Ethernet pair via the router, and the third interface of the second virtual Ethernet pair encapsulates the IP message in the original layer 2 data frame with a MAC frame header to form an original layer 2 data frame and sends it to the fourth interface of the second virtual Ethernet pair, and the fourth interface of the second virtual Ethernet pair sends the original layer 2 data frame to the second tunnel interface.

[0119] Among them, the first interface is the interface in the first virtual Ethernet pair mounted on the bridge device, the second interface is the gateway interface of the subnet corresponding to the first virtual network pair, the third interface is the gateway interface of the subnet corresponding to the second virtual network pair, wherein the subnet corresponding to the second virtual network pair is the destination IP subnet of the original Layer 2 data frame, and the fourth interface is the interface in the second virtual Ethernet pair mounted on the bridge device.

[0120] As described above, the device intercommunication device can send the original layer 2 data frame to the second tunnel interface according to the recorded forwarding table. Specifically, the bridge device determines whether the forwarding table contains the forwarding information of the original layer 2 data frame. If so, the original layer 2 data frame is forwarded to the interface of the bridge device indicated by the forwarding information. If not, the original layer 2 data frame is forwarded to all interfaces on the bridge device.

[0121] Among them, the forwarding information of the above-mentioned original Layer 2 data frame may include the mapping relationship between the original Layer 2 data frame and the bridge interface. The bridge device has a learning function, which can record the mapping relationship between the MAC address and the bridge interface, and write the mapping relationship into the forwarding table. When the bridge device receives the original Layer 2 data frame, it queries the forwarding table whether there is a mapping relationship of the original Layer 2 data frame. If so, it forwards it according to the bridge interface recorded in the forwarding table. If it does not exist, or if the Layer 2 data frame is a broadcast Layer 2 data frame, the bridge device forwards the Layer 2 data frame to all interfaces on the bridge device. After the tunnel interface receives the data frame forwarded by the bridge device, it tunnel encapsulates the data frame and sends it.

[0122] The following describes the communication processing procedure of the intercommunication proxy device.

[0123] Figure 8A flow chart of a communication method of an intercommunication proxy device provided in an embodiment of the present application, wherein the execution subject of the method is the above-mentioned intercommunication proxy device, such as Figure 8 As shown, the method includes:

[0124] S801. Receive a layer 2 data frame sent by an application through an application-side network card.

[0125] As described above, the intercommunication proxy device deploys an application side network card, a network side network card and a bridge device, and the bridge device is connected to a tunnel interface. Figure 4 The application side network card connects to the application, and the network side network card communicates with the device intercommunication device. After the application generates a layer 2 data frame, it sends the layer 2 data frame to the application side network card of the intercommunication proxy device, and the intercommunication proxy device receives the layer 2 data frame through the application side network card.

[0126] As mentioned above, the application intercommunication proxy device and the application can be deployed on the same physical server, in which a bridge device is deployed. The network card on the virtual machine or container where the application is located and the application-side network card of the intercommunication proxy device can be respectively mounted on the bridge device deployed in the physical server.

[0127] Correspondingly, after the application generates a layer 2 data frame, the layer 2 data frame is first forwarded to the bridge device deployed in the physical server via the network card on the virtual machine or container where the application is located. The bridge device has a built-in forwarding table. Based on the forwarding table, the bridge device can send the layer 2 data frame to the bridge device in the intercommunication proxy device through the application side network card, and the bridge device in the intercommunication proxy device forwards the layer 2 data frame to the tunnel interface in the intercommunication proxy device based on its forwarding table. That is, the intercommunication proxy device receives the layer 2 data frame sent by the application from the bridge device deployed in the physical server through the application side network card, wherein the bridge device deployed in the physical server receives the layer 2 data frame sent by the application from the network card on the virtual machine or container where the application is located, and sends the layer 2 data frame to the application side network card based on its forwarding table.

[0128] The network card on the virtual machine or container where the application is located may refer to a network card on the virtual machine or container where the application is located that is used to communicate with the device.

[0129] The layer 2 data frame may be a unicast data frame, or the layer 2 data frame may also be a broadcast data frame.

[0130] S802. Encapsulate the layer 2 data frame into a layer 3 IP message through the tunnel interface.

[0131] Among them, the three-layer IP message includes the above-mentioned two-layer data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the network side network card, and the destination IP address in the IP header is the IP address of the other end of the tunnel corresponding to the tunnel interface.

[0132] Exemplarily, the intercommunication proxy device can use VxLAN to perform encapsulation. The specific process can refer to the encapsulation process in step S502, which will not be repeated here.

[0133] In addition, the tunnel establishment and tunnel identification determination between the intercommunication proxy apparatus and the device intercommunication apparatus may also be processed using the method corresponding to the device proxy apparatus in step S502 above, which will not be described in detail here.

[0134] S803: Send the layer-3 IP message to the device intercommunication apparatus corresponding to the destination IP address in the IP header through the network side network card.

[0135] In this embodiment, after receiving the layer 2 data frame of the application, the intercommunication proxy device encapsulates the layer 2 data frame into a layer 3 IP message through the tunnel interface, and carries the tunnel identifier of the tunnel corresponding to the tunnel interface in the layer 3 IP message, so that the layer 3 IP message can be transmitted to the device intercommunication device through the tunnel encapsulation, and then through the cooperative processing of the device intercommunication device, the layer 2 data frame can be sent to the device at the receiving end, thereby realizing communication between the device and the application without perceiving the deployment form.

[0136] The above steps S801-S803 describe the process of the intercommunication proxy device receiving data from the application and forwarding it to the device intercommunication device. The following describes the process of the device access device receiving data from the device intercommunication device and forwarding it to the application.

[0137] Fig. 9 A flow chart of another intercommunication proxy device communication method provided in an embodiment of the present application, such as Fig. 9 As shown, the method also includes:

[0138] S901. Receive a layer-3 IP message sent by a device intercommunication apparatus, where the destination IP address of the layer-3 IP message is the IP address of the intercommunication proxy apparatus.

[0139] The network-side network card receives the layer-3 IP message.

[0140] S902. Decapsulate the layer-3 IP message through the tunnel interface to obtain an original layer-2 data frame.

[0141] Optionally, after receiving the layer-3 IP message, the network side network card forwards the layer-3 IP message to a bridge device, which then forwards the message to the tunnel interface.

[0142] After receiving the layer-3 IP message, the tunnel interface decapsulates it. Specifically, the tunnel interface removes the encapsulation header in the layer-3 IP message to obtain the original layer-2 data frame encapsulated therein.

[0143] S903: Send the original layer 2 data frame to the application through the above-mentioned bridge device.

[0144] Optionally, a forwarding table is built into the bridge device. Based on the forwarding table, the bridge device can send the layer 2 data frame to the bridge device in the physical server where the application is located through the application-side network card. The bridge device in the physical server forwards the layer 2 data frame to the application based on its forwarding table and via the network card on the virtual machine or container where the application is located.

[0145] The solution of the embodiment of the present application is further illustrated by two specific examples below.

[0146] The following embodiment is an example of a device sending a layer 2 data frame to another device. For ease of description, in the following embodiment, the device at the sending end, the device access device and the network terminal are respectively referred to as device 1, device access device 1 and network terminal 1, and the device at the receiving end, the device access device and the network terminal are respectively referred to as device 2, device access device 2 and network terminal 2.

[0147] Fig.10 This is a schematic diagram of the interaction between devices in this application for transmitting layer 2 data frames, such as Fig.10 As shown, the interaction process includes:

[0148] S1001. Device 1 sends a layer 2 data frame to device access apparatus 1.

[0149] S1002. The device access apparatus 1 receives the layer 2 data frame sent by the device 1 through the device side network card, and forwards the data frame to the tunnel interface through the bridge device.

[0150] S1003. The tunnel interface of the device access apparatus 1 encapsulates the layer 2 data frame into a layer 3 IP message.

[0151] S1004 , the device access apparatus 1 sends the encapsulated layer-3 IP message to the network terminal 1 through the terminal-side network card.

[0152] S1005 . Network terminal 1 performs source IP address conversion on the encapsulated layer-3 IP message, and converts the source IP address into the IP address of the network side interface of network terminal 1 .

[0153] S1006. The network terminal 1 sends the encapsulated layer-3 IP message to the device intercommunication apparatus.

[0154] S1007. The device intercommunication device parses the encapsulated layer-3 IP message, identifies the tunnel identifier, and forwards the message to the corresponding tunnel interface according to the tunnel identifier.

[0155] S1008: The corresponding tunnel interface decapsulates the encapsulated layer 3 IP message to obtain a layer 2 data frame. The bridge device of the device intercommunication apparatus forwards the layer 2 data frame according to the forwarding table to forward it to the corresponding tunnel interface.

[0156] The following S1009-S1010 are optional processing steps when the layer 2 data frame is a data frame for cross-IP subnet communication.

[0157] S1009, Layer 2 data frame routing.

[0158] For Layer 2 data frames that communicate across IP subnets, the destination MAC address is the gateway MAC address of the IP subnet. The bridge device forwards the data frame to the corresponding gateway interface through the virtual Ethernet pair interface. The gateway interface routes the IP message in the data frame to the gateway interface of the destination IP subnet via the router. After the gateway interface of the destination IP subnet encapsulates the MAC frame header, it sends the Layer 2 data frame to the bridge device through the virtual Ethernet pair.

[0159] S1010. The bridge device of the device intercommunication apparatus forwards the layer 2 data frame to the corresponding tunnel interface according to the forwarding table.

[0160] S1011 , the corresponding tunnel interface of the device intercommunication apparatus encapsulates the data frame to obtain an encapsulated three-layer IP message. The destination IP address in the encapsulated three-layer IP message is the IP address of the network terminal 2 .

[0161] S1012 , the device intercommunication apparatus sends the encapsulated three-layer IP message to the network terminal 2 .

[0162] S1013 , the network terminal 2 performs destination IP address conversion on the encapsulated layer-3 IP message, and replaces the destination IP address with the IP address of the terminal-side network card of the device access apparatus 2 .

[0163] S1014 , the network terminal 2 forwards the encapsulated layer-3 IP message to the device access apparatus 2 .

[0164] S1015. The tunnel interface of the device access apparatus 2 decapsulates the encapsulated layer-3 message to obtain a layer-2 data frame.

[0165] S1016. The bridge device of device access apparatus 2 forwards the layer 2 data frame to device 2 according to the forwarding table.

[0166] S1017. Device 2 receives the layer 2 data frame sent by device 1 in response.

[0167] The following embodiment is an example of a device sending a layer 2 data frame to an application. For ease of description, the sending device, device access device and network terminal in the following embodiment are respectively referred to as device 1, device access device 1 and network terminal 1.

[0168] Fig.11 This is a schematic diagram of the interaction between the device and the application in this application for transmitting the second layer data frame, such as Fig.11 As shown, the interaction process includes:

[0169] S1101 . Device 1 sends a layer 2 data frame to device access apparatus 1 .

[0170] S1102. The device access apparatus 1 receives the layer 2 data frame sent by the device 1 through the device side network card, and forwards the data frame to the tunnel interface through the bridge device.

[0171] S1103. The tunnel interface of the device access apparatus 1 encapsulates the layer 2 data frame into a layer 3 IP message.

[0172] S1104 , the device access apparatus 1 sends the encapsulated three-layer IP message to the network terminal 1 through the terminal side network card.

[0173] S1105 . Network terminal 1 performs source IP address conversion on the encapsulated layer-3 IP message, and converts the source IP address into the IP address of the network side interface of network terminal 1 .

[0174] S1106. The network terminal 1 sends the encapsulated layer-3 IP message to the device intercommunication apparatus.

[0175] S1107. The device intercommunication device parses the encapsulated layer-3 IP message, identifies the tunnel identifier, and forwards the message to the corresponding tunnel interface according to the tunnel identifier.

[0176] S1108: The corresponding tunnel interface decapsulates the encapsulated layer 3 IP message to obtain a layer 2 data frame. The bridge device of the device intercommunication apparatus forwards the layer 2 data frame according to the forwarding table to forward it to the corresponding tunnel interface.

[0177] The following S1109-S1110 are optional processing steps when the layer 2 data frame is a data frame for cross-IP subnet communication.

[0178] S1109, Layer 2 data frame routing.

[0179] For Layer 2 data frames that communicate across IP subnets, the destination MAC address is the gateway MAC address of the IP subnet. The bridge device forwards the data frame to the corresponding gateway interface through the virtual Ethernet pair interface. The gateway interface routes the IP message in the data frame to the gateway interface of the destination IP subnet via the router. After the gateway interface of the destination IP subnet encapsulates the MAC frame header, it sends the Layer 2 data frame to the bridge device through the virtual Ethernet pair.

[0180] S1110. The bridge device of the device intercommunication apparatus forwards the layer 2 data frame to the corresponding tunnel interface according to the forwarding table.

[0181] S1111. The corresponding tunnel interface of the device intercommunication apparatus encapsulates the data frame to obtain an encapsulated three-layer IP message. The destination IP address in the encapsulated three-layer IP message is the IP address of the intercommunication proxy apparatus.

[0182] S1112. The device intercommunication device sends the encapsulated IP message to the intercommunication proxy device.

[0183] S1113. The intercommunication proxy device decapsulates the IP message to obtain a layer 2 data frame.

[0184] S1114. The network bridge device of the intercommunication proxy apparatus forwards the layer 2 data frame to the application side network card according to the forwarding table.

[0185] S1115. The application-side network card of the intercommunication proxy device forwards the layer 2 data frame to the network bridge device in the physical server.

[0186] S1116. The network bridge device in the physical server forwards the layer 2 data frame according to the forwarding table.

[0187] S1117. The application receives the layer 2 data frame sent by device 1 in response.

[0188] If device 1 and the application are in different IP subnets, the application receives the layer-3 IP message sent by device 1.

[0189] Based on the same inventive concept, a communication device corresponding to the communication method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned communication method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0190] Fig.12 A module structure diagram of a communication device provided in the present application, the communication device is applied to a device access device, wherein a device side network card, a terminal side network card and a tunnel interface are deployed in the device access device, such as Fig.12 As shown, the communication device includes:

[0191] The first receiving module 1201 is used to receive a layer 2 data frame sent by a sending device through the device side network card.

[0192] The encapsulation module 1202 is used to encapsulate the layer 2 data frame into a first layer 3 IP message through the tunnel interface, wherein the first layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the terminal side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface.

[0193] The first sending module 1203 is used to send the first three-layer IP message to the network terminal through the terminal side network card, and send the first three-layer IP message to the device intercommunication device corresponding to the destination IP address in the IP header via the network terminal.

[0194] In an optional implementation manner, a bridge device is further deployed in the device access apparatus, and the tunnel interface is mounted on the bridge device;

[0195] The encapsulation module 1202 is specifically used for:

[0196] The layer 2 data frame is forwarded to the tunnel interface through the network bridge device, and the layer 2 data frame is encapsulated into a first layer 3 IP message through the tunnel interface.

[0197] In an optional embodiment, referring to Fig.12 , the communication device further includes:

[0198] The second receiving module 1204 is used to receive a second layer-3 IP message sent by the network terminal, wherein the destination IP address of the second layer-3 IP message is the IP address of the terminal-side network card of the device access apparatus;

[0199] The decapsulation module 1205 is used to decapsulate the second layer-3 IP message through the tunnel interface to obtain an original layer-2 data frame;

[0200] The second sending module 1206 is used to send the original layer 2 data frame to the receiving end device through the bridge device.

[0201] Fig.13 A module structure diagram of another communication device provided in the present application is applied to a device intercommunication device, wherein at least one tunnel interface and a bridge device are deployed in the device intercommunication device, and each of the tunnel interfaces is respectively mounted on the bridge device, such as Fig.13 As shown, the communication device includes:

[0202] The receiving module 1301 is used to receive a third layer-3 IP message, parse the third layer-3 IP message, and determine a first tunnel interface for processing the third layer-3 IP message.

[0203] The decapsulation module 1302 is used to decapsulate the third layer-3 IP message through the first tunnel interface to obtain an original layer-2 data frame, and forward the original layer-2 data frame to the second tunnel interface for processing the original layer-2 data frame through the bridge device.

[0204] The encapsulation module 1303 is used to encapsulate the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface, wherein the fourth layer 3 IP message includes the original layer 2 data frame and an encapsulation header, wherein the encapsulation header includes an IP header, wherein the source IP address in the IP header is the IP address of the network card of the device intercommunication device, and the destination IP address in the IP header is the IP address of the tunnel peer corresponding to the second tunnel interface.

[0205] The sending module 1304 is used to send the fourth layer 3 IP message to the target device, and send the fourth layer 3 IP message to the target device corresponding to the destination IP address in the IP header via the network terminal at the receiving end. The target device includes a network terminal or an intercommunication proxy device.

[0206] In an optional embodiment, multiple virtual Ethernet pairs and routers are also deployed in the device intercommunication device, each virtual Ethernet pair corresponds to an IP subnet, and the virtual Ethernet pair includes a pair of virtual interfaces, one of the pair of virtual interfaces is mounted on the bridge device, and the other interface of the pair of virtual interfaces is set to the gateway IP address of the corresponding subnet.

[0207] The decapsulation module 1302 is specifically used for:

[0208] The network bridge device forwards the original layer 2 data frame to the second interface of the first virtual Ethernet pair through the first interface of the first virtual Ethernet pair, and the second interface of the first virtual Ethernet pair routes the IP message in the original layer 2 data frame to the third interface of the second virtual Ethernet pair via the router, and the third interface of the second virtual Ethernet pair encapsulates the IP message in the original layer 2 data frame with a media access control frame header to form the original layer 2 data frame and sends it to the fourth interface of the second virtual Ethernet pair, and the fourth interface of the second virtual Ethernet pair sends the original layer 2 data frame to the second tunnel interface;

[0209] Among them, the first interface is the interface in the first virtual Ethernet pair mounted on the bridge device, the second interface is the gateway interface of the subnet corresponding to the first virtual network pair, the third interface is the gateway interface of the subnet corresponding to the second virtual network pair, and the fourth interface is the interface in the second virtual Ethernet pair mounted on the bridge device.

[0210] In an optional implementation manner, the decapsulation module 1302 is specifically configured to:

[0211] The network bridge device determines whether the forwarding table contains the forwarding information of the original layer 2 data frame;

[0212] If yes, forwarding the original layer 2 data frame to the interface of the bridge device indicated by the forwarding information;

[0213] If not, the original layer 2 data frame is forwarded to all interfaces on the bridge device.

[0214] In an optional implementation manner, the receiving module 1301 is specifically configured to:

[0215] Parsing the third layer-3 IP message to obtain a tunnel identifier for transmitting the third layer-3 IP message;

[0216] Determine, according to the tunnel identifier, the first tunnel interface corresponding to the tunnel identified by the tunnel identifier.

[0217] Fig.14 A module structure diagram of another communication device provided by the present application is applied to an intercommunication proxy device, in which an application side network card, a network side network card and a bridge device are deployed, and a tunnel interface is mounted on the bridge device, such as Fig.14 As shown, the communication device includes:

[0218] The receiving module 1401 is used to receive the layer 2 data frame sent by the application through the application side network card;

[0219] The encapsulation module 1402 is used to encapsulate the layer 2 data frame into a layer 3 IP message through the tunnel interface, wherein the layer 3 IP message includes the layer 2 data frame and an encapsulation header, wherein the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the tunnel interface, wherein the source IP address in the IP header is the IP address of the network side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface;

[0220] The sending module 1403 is used to send the three-layer IP message to the device intercommunication device corresponding to the destination IP address in the IP header through the network side network card.

[0221] In an optional implementation, the intercommunication proxy device and the application are deployed on the same physical server, a bridge device is deployed in the physical server, and the network card on the virtual machine or container where the application is located and the application-side network card of the intercommunication proxy device are respectively mounted on the bridge device deployed in the physical server.

[0222] The receiving module 1401 is specifically used for:

[0223] The layer 2 data frame sent by the application is received from the bridge device deployed in the physical server through the application side network card, wherein the bridge device deployed in the physical server receives the layer 2 data frame sent by the application from the network card on the virtual machine or container where the application is located, and sends the layer 2 data frame to the application side network card based on the forwarding table.

[0224] The embodiment of the present application further provides a communication device 150, which may be the device where the aforementioned device access device, device intercommunication device, and intercommunication proxy device are located. Fig.15 As shown, it is a schematic diagram of the structure of the communication device 150 provided in the embodiment of the present application, including: a processor 151, a memory 152, and a bus 153. The memory 152 stores machine-readable instructions executable by the processor 151. When the communication device 150 is running, the processor 151 communicates with the memory 152 through the bus 153. When the machine-readable instructions are executed by the processor 151, the method steps executed by the device access device, the device intercommunication device or the intercommunication proxy device in the above method embodiment are executed.

[0225] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method steps performed by the device access device, the device intercommunication device or the intercommunication agent device in the aforementioned method embodiment are executed.

[0226] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0227] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.

[0228] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A communication method, characterized in that: Applied to a device access apparatus, in which a device side network card, a terminal side network card and a tunnel interface are deployed, the method includes: Receiving, through the network card on the device side, a layer 2 data frame sent by a device on the sending end; Encapsulating the layer 2 data frame into a first layer 3 IP message through the tunnel interface, wherein the first layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of a tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the terminal side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface; Sending the first layer-3 IP message to a network terminal through the terminal-side network card, and sending the first layer-3 IP message to a device intercommunication device corresponding to the destination IP address in the IP header through the network terminal; The step of encapsulating the layer 2 data frame into a first layer 3 IP message through the tunnel interface includes: The tunnel interface encapsulates an IP header, a UDP header, and a VxLAN header in sequence on the basis of the layer 2 data frame to obtain the first layer 3 IP message, and the tunnel identifier of the tunnel corresponding to the tunnel interface is included in the VxLAN header; The sending of the first layer-3 IP message to the device intercommunication device corresponding to the destination IP address in the IP header via the network terminal includes: Performing source IP address conversion on the first layer-3 IP message via the network terminal, converting the source IP address into an IP address of a network-side interface of the network terminal; The converted first layer-3 IP message is sent to the device intercommunication apparatus via the network terminal through the wireless network.

2. The method according to claim 1, characterized in that A network bridge device is also deployed in the device access apparatus, and the tunnel interface is mounted on the network bridge device; The step of encapsulating the layer 2 data frame into a first layer 3 IP message through the tunnel interface includes: The layer 2 data frame is forwarded to the tunnel interface through the network bridge device, and the layer 2 data frame is encapsulated into a first layer 3 IP message through the tunnel interface.

3. The method according to claim 2, characterized in that The method further comprises: receiving a second layer-3 IP message sent by a network terminal, wherein the destination IP address of the second layer-3 IP message is the IP address of the terminal-side network card of the device access apparatus; Decapsulate the second layer-3 IP message through the tunnel interface to obtain an original layer-2 data frame; The original layer 2 data frame is sent to the device at the receiving end through the bridge device.

4. A communication method, characterized in that: Applied to a device intercommunication apparatus, wherein at least one tunnel interface and a bridge device are deployed in the device intercommunication apparatus, and each of the tunnel interfaces is respectively mounted on the bridge device, and the method includes: receiving a third layer 3 IP message, parsing the third layer 3 IP message, and determining a first tunnel interface for processing the third layer 3 IP message; Decapsulating the third layer-3 IP message through the first tunnel interface to obtain an original layer-2 data frame, and forwarding the original layer-2 data frame to the second tunnel interface for processing the original layer-2 data frame through the bridge device; Encapsulating the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface, the fourth layer 3 IP message including the original layer 2 data frame and an encapsulation header, the encapsulation header including an IP header, the source IP address in the IP header being the IP address of the network card of the device intercommunication apparatus, and the destination IP address in the IP header being the IP address of the tunnel peer corresponding to the second tunnel interface; Sending the fourth layer 3 IP message to a target device, and sending the fourth layer 3 IP message to a target device corresponding to the destination IP address in the IP header via a network terminal at a receiving end, wherein the target device includes a network terminal or an intercommunication proxy device; The encapsulating the original layer 2 data frame into a fourth layer 3 IP message through the second tunnel interface includes: Through the second tunnel interface, the IP header, UDP header and VxLAN header are encapsulated in sequence on the basis of the original layer 2 data frame to obtain the fourth layer 3 IP message.

5. The method according to claim 4, characterized in that The device intercommunication device further comprises a plurality of virtual Ethernet pairs and routers, each virtual Ethernet pair corresponds to an IP subnet, the virtual Ethernet pair comprises a pair of virtual interfaces, one of the pair of virtual interfaces is mounted on the bridge device, and the other of the pair of virtual interfaces is provided with a gateway IP address of the corresponding subnet; The step of forwarding the original layer 2 data frame to a second tunnel interface for processing the original layer 2 data frame through the network bridge device includes: The network bridge device forwards the original layer 2 data frame to the second interface of the first virtual Ethernet pair through the first interface of the first virtual Ethernet pair, and the second interface of the first virtual Ethernet pair routes the IP message in the original layer 2 data frame to the third interface of the second virtual Ethernet pair via the router, and the third interface of the second virtual Ethernet pair encapsulates the IP message in the original layer 2 data frame with a media access control frame header to form the original layer 2 data frame and sends it to the fourth interface of the second virtual Ethernet pair, and the fourth interface of the second virtual Ethernet pair sends the original layer 2 data frame to the second tunnel interface; Among them, the first interface is the interface in the first virtual Ethernet pair mounted on the bridge device, the second interface is the gateway interface of the subnet corresponding to the first virtual Ethernet pair, the third interface is the gateway interface of the subnet corresponding to the second virtual Ethernet pair, and the fourth interface is the interface in the second virtual Ethernet pair mounted on the bridge device.

6. The method according to claim 5, characterized in that The step of forwarding the original layer 2 data frame to a second tunnel interface for processing the original layer 2 data frame through the network bridge device includes: The network bridge device determines whether the forwarding table contains the forwarding information of the original layer 2 data frame; If yes, forwarding the original layer 2 data frame to the interface of the bridge device indicated by the forwarding information; If not, the original layer 2 data frame is forwarded to all interfaces on the bridge device.

7. The method according to any one of claims 4 to 6, characterized in that: The step of parsing the third layer-3 IP message and determining a first tunnel interface for processing the third layer-3 IP message includes: Parsing the third layer-3 IP message to obtain a tunnel identifier for transmitting the third layer-3 IP message; Determine, according to the tunnel identifier, the first tunnel interface corresponding to the tunnel identified by the tunnel identifier.

8. A communication method, characterized in that: Applied to an intercommunication proxy device, in which an application side network card, a network side network card and a bridge device are deployed, and a tunnel interface is mounted on the bridge device, the method includes: Receiving the layer 2 data frame sent by the application through the application side network card; Encapsulate the layer 2 data frame into a layer 3 IP message through the tunnel interface, the layer 3 IP message includes the layer 2 data frame and an encapsulation header, the encapsulation header includes an IP header and a tunnel identifier of the tunnel corresponding to the tunnel interface, the source IP address in the IP header is the IP address of the network side network card, and the destination IP address in the IP header is the IP address of the opposite end of the tunnel corresponding to the tunnel interface; Sending the layer-3 IP message to the device intercommunication device corresponding to the destination IP address in the IP header through the network side network card; The step of encapsulating the layer 2 data frame into a layer 3 IP message through the tunnel interface includes: The tunnel interface encapsulates the IP header, UDP header and VxLAN header in sequence on the basis of the layer 2 data frame to obtain the layer 3 IP message, and the tunnel identifier of the tunnel corresponding to the tunnel interface is included in the VxLAN header.

9. The method according to claim 8, characterized in that The intercommunication proxy device and the application are deployed on the same physical server, a bridge device is deployed in the physical server, and the network card on the virtual machine or container where the application is located and the application-side network card of the intercommunication proxy device are respectively mounted on the bridge device deployed in the physical server; The receiving, through the application side network card, a layer 2 data frame sent by the application comprises: The layer 2 data frame sent by the application is received from the bridge device deployed in the physical server through the application side network card, wherein the bridge device deployed in the physical server receives the layer 2 data frame sent by the application from the network card on the virtual machine or container where the application is located, and sends the layer 2 data frame to the application side network card based on the forwarding table.

10. A communication device, characterized in that: The device includes: a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, when the communication device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to perform the method steps described in any one of claims 1-3, any one of claims 4-7, or claim 8 or 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of claims 1 to 3, any one of claims 4 to 7, or claim 8 or 9 are performed.

Citation Information

Patent Citations

  • Data forwarding device and data forwarding method used in software-defined network

    CN107800628A

  • Point-to-point message transmission method and network equipment

    CN109120526A

  • Communication method, device and system

    CN109672708A

  • Two layer message transmitting method

    CN1770766A

  • Learning of tunnel endpoint selections

    US20170163598A1