Message compression method, device, equipment and storage medium
By creating and synchronizing mapping table entries at the sending and receiving ends of the communication tunnel and replacing the five-tuple in the data packet, the problem of increasing the length of the packet in the tunnel transmission is solved, and efficient tunnel transmission is achieved.
Patent Information
- Application Number
- CN202111333478.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In tunnel transmission, the tunnel header needs to be encapsulated on the basis of the original data packet, resulting in an increase in the length of the tunnel packet, resulting in an increase in transmission overhead and may cause the tunnel packet to exceed the maximum transmission unit (MTU), thereby affecting transmission performance.
By creating a mapping entry at the sending end of the communication tunnel, describing the correspondence between the first five-tuple and the second five-tuple, the source IP address and destination IP address of the second five-tuple are the IP addresses of the sending end and the receiving end respectively. The mapping table entry is synchronized to the receiving end, and the first five tuple is replaced with the second five tuple, and a second data message is generated and sent to the receiving end. The receiver restores the second 5 tuple to the first 5 tuple according to the mapping table entry and obtains the original data packet.
The tunnel transmission without increasing the length of the message is realized, which avoids the transmission performance degradation caused by the increase in the length of the tunnel message and ensures the efficiency of data transmission.
Smart Images

Figure CN114040029B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a message compression method, device, equipment and storage medium. Background Art
[0002] Tunneling is a method of transmitting data between networks through network infrastructure. When using a tunnel to transmit data, you need to encapsulate the tunnel header in the original data message to obtain a tunnel message, and then send the tunnel message to the tunnel receiving end. After receiving the tunnel message, the tunnel receiving end needs to decapsulate the tunnel message to obtain the original data message.
[0003] When transmitting data in a tunnel, the tunnel header needs to be encapsulated on the basis of the original data message, so the length of the tunnel message is greater than the length of the original data message. The longer the length of the tunnel message, the greater the transmission overhead. When the length of the tunnel message is greater than the Maximum Transmission Unit (MTU), the tunnel message will be fragmented, which will affect the transmission performance. Summary of the invention
[0004] The embodiments of the present invention provide a message compression method, device, equipment and storage medium, which realize tunnel transmission without increasing the message length and ensure transmission performance.
[0005] In a first aspect, an embodiment of the present invention provides a message compression method, which is applied to a sending end of a communication tunnel, and the method includes:
[0006] Receive a first data message sent by a first device, wherein the first data message includes a first quintuple;
[0007] If a mapping table entry corresponding to the first quintuple is not found in the set mapping table, a mapping table entry corresponding to the first quintuple is created, wherein the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively;
[0008] Synchronizing the mapping table entry to the receiving end;
[0009] Replacing the first quintuple with the second quintuple to generate a second data message;
[0010] The second data packet is sent to the receiving end, so that the receiving end restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data packet, and sends the first data packet to the second device.
[0011] Optionally, the method further comprises:
[0012] If a mapping table entry corresponding to the first five-tuple is found in the mapping table, the first five-tuple is replaced with the second five-tuple included in the mapping table entry to generate a second data message.
[0013] Optionally, the communication tunnel includes a control tunnel and a data tunnel;
[0014] The synchronizing the mapping table entry to the receiving end comprises: synchronizing the mapping table entry to the receiving end through the control tunnel;
[0015] The sending the second data message to the receiving end includes: sending the second data message to the receiving end through the data tunnel.
[0016] Optionally, after replacing the first quintuple with the second quintuple, the method further comprises:
[0017] Based on the second quintuple, a checksum corresponding to the second data message is regenerated.
[0018] Optionally, the communication tunnel comprises a tunnel supporting a control and configuration protocol of a wireless access point.
[0019] In a second aspect, an embodiment of the present invention provides a message compression device, located at a sending end of a communication tunnel, the device comprising:
[0020] A receiving module, configured to receive a first data message sent by a first device, wherein the first data message includes a first quintuple;
[0021] a creation module, configured to create a mapping table entry corresponding to the first quintuple if a mapping table entry corresponding to the first quintuple is not found in a set mapping table, the mapping table entry being used to describe a correspondence between the first quintuple and a second quintuple, wherein a source IP address and a destination IP address in the second quintuple are an IP address of a sending end of the communication tunnel and an IP address of a receiving end of the communication tunnel, respectively;
[0022] A synchronization module, used for synchronizing the mapping table entry to the receiving end;
[0023] A replacement module, used for replacing the first quintuple with the second quintuple to generate a second data message;
[0024] A sending module is used to send the second data message to the receiving end, so that the receiving end restores the second five-tuple to the first five-tuple according to the mapping table entry to obtain the first data message, and sends the first data message to the second device.
[0025] Optionally, the message compression device may further include a replacement module, which may be specifically used for:
[0026] If a mapping table entry corresponding to the first five-tuple is found in the mapping table, the first five-tuple is replaced with the second five-tuple included in the mapping table entry to generate a second data message.
[0027] Optionally, the communication tunnel may include a control tunnel and a data tunnel, and the synchronization module may be specifically used for:
[0028] The mapping table entry is synchronized to the receiving end through a control tunnel.
[0029] Optionally, the communication tunnel may include a control tunnel and a data tunnel, and the sending module may be specifically used to: send the second data packet to the receiving end through the data tunnel, so that the receiving end restores the second five-tuple to the first five-tuple according to the mapping table entry to obtain the first data packet, and sends the first data packet to the second device.
[0030] Optionally, the replacement module may further include a checksum module, which is specifically used to:
[0031] Based on the second quintuple, a checksum corresponding to the second data message is regenerated.
[0032] Optionally, the communication tunnel comprises a tunnel supporting a control and configuration protocol of a wireless access point.
[0033] In a third aspect, an embodiment of the present invention provides a sending end device of a communication tunnel, comprising: a memory, a processor, and a communication interface; wherein, executable code is stored on the memory, and when the executable code is executed by the processor, the processor can at least implement the message compression method described in the first aspect.
[0034] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of a computing device, the processor can at least implement the message compression method described in the first aspect.
[0035] In a fifth aspect, an embodiment of the present invention provides a message compression method, which is applied to a receiving end of a communication tunnel, and the method includes:
[0036] Receive a mapping table entry sent by a sending end of the communication tunnel, the mapping table entry being used to describe a correspondence between a first quintuple and a second quintuple, wherein a source IP address and a destination IP address in the second quintuple are the IP address of the sending end and the IP address of the receiving end, respectively;
[0037] receiving a data message sent by the sending end, wherein the data message includes a second quintuple;
[0038] Replacing the second quintuple with the first quintuple according to the mapping table entry;
[0039] The replaced data packet is sent to the device corresponding to the destination IP address in the first quintuple.
[0040] Optionally, after replacing the second quintuple with the first quintuple according to the mapping table entry, the method further includes:
[0041] Based on the first quintuple, a checksum corresponding to the replaced data message is regenerated.
[0042] In a sixth aspect, an embodiment of the present invention provides a message compression device, located at a receiving end of a communication tunnel, the device comprising:
[0043] a receiving module, configured to receive a mapping table entry sent by a sending end of the communication tunnel, the mapping table entry being used to describe a correspondence between a first quintuple and a second quintuple, the source IP address and the destination IP address in the second quintuple being the IP address of the sending end and the IP address of the receiving end, respectively, and receive a data message sent by the sending end, the data message including the second quintuple;
[0044] A replacement module, used for replacing the second quintuple with the first quintuple according to the mapping table entry;
[0045] A sending module is used to send the replaced data message to the device corresponding to the destination IP address in the first quintuple.
[0046] Optionally, the replacement module may further include a checksum module 34, which is specifically used to:
[0047] Based on the first quintuple, a checksum corresponding to the replaced data message is regenerated.
[0048] In the seventh aspect, an embodiment of the present invention provides a receiving end device of a communication tunnel, comprising: a memory, a processor, and a communication interface; wherein, executable code is stored on the memory, and when the executable code is executed by the processor, the processor can at least implement the message compression method described in the fifth aspect.
[0049] In an eighth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of a computing device, the processor can at least implement the message compression method as described in the fifth aspect.
[0050] In a ninth aspect, a message compression system includes a first device, a transmitting end of a communication tunnel, a receiving end of the communication tunnel, and a second device;
[0051] The first device is used to send a first data message to a sending end of the communication tunnel, wherein the first data message includes a first quintuple;
[0052] The sending end of the communication tunnel is used to create a mapping table entry corresponding to the first quintuple if the mapping table entry corresponding to the first quintuple is not found in the set mapping table, the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively; synchronize the mapping table entry to the receiving end of the communication tunnel, and replace the first quintuple with the second quintuple to generate a second data message, and send the second data message to the receiving end of the communication tunnel;
[0053] The receiving end of the communication tunnel is used to restore the second quintuple to the first quintuple according to the mapping table entry to obtain the first data message, and send the first data message to the second device;
[0054] The second device is used to receive the first data message sent by the receiving end of the communication tunnel.
[0055] The message compression scheme provided in the embodiment of the present invention can be applied to a communication architecture composed of a sending end of a communication tunnel and a receiving end of a communication tunnel. In the communication architecture, for the sending end of any communication tunnel, in the process of data message transmission, first, the sending end of the communication tunnel receives a first data message sent by a first device, and the first data message includes a first quintuple. Then, a mapping table entry corresponding to the first quintuple is searched in the set mapping table. If the mapping table entry corresponding to the first quintuple is not found in the set mapping table, a mapping table entry corresponding to the first quintuple is created, wherein the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively, that is, the mapping table entry stores the correspondence between the first quintuple and the second quintuple. At the same time, the mapping table entry is synchronized to the receiving end of the communication tunnel. Afterwards, according to the correspondence between the first quintuple and the second quintuple in the mapping table entry, the first quintuple is replaced with the second quintuple to generate a second data message. Finally, the second data message is sent to the receiving end of the communication tunnel, so that the receiving end restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data message, and sends the first data message to the second device.
[0056] In this scheme, the data packet is compressed by replacing the first quintuple and the second quintuple according to the correspondence between the first quintuple and the second quintuple in the mapping table entry, so that the length of the data packet does not increase, thereby achieving tunnel transmission without increasing the packet length and ensuring transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 A schematic diagram of the composition of a message compression system provided by an embodiment of the present invention;
[0059] Figure 2 An interactive flow chart of a message compression method provided by an embodiment of the present invention;
[0060] Figure 3 A schematic diagram of an application of a message compression method provided by an embodiment of the present invention;
[0061] Figure 4 An interactive flow chart of another message compression method provided by an embodiment of the present invention;
[0062] Figure 5 A schematic diagram of the structure of a message compression device provided by an embodiment of the present invention;
[0063] Figure 6 For Figure 5 A schematic diagram of the structure of an electronic device corresponding to the message compression device provided in the illustrated embodiment;
[0064] Figure 7 A schematic diagram of the structure of a message compression device provided by an embodiment of the present invention;
[0065] Figure 8 For Figure 7 A schematic diagram of the structure of an electronic device corresponding to the message compression device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0068] With the rapid development of the Internet, more and more data will be generated. When transmitting data in a tunnel, it is necessary to encapsulate a tunnel header based on the original data message, which increases the length of the tunnel message and often encounters bandwidth resource shortage during the transmission process. In view of this problem, an embodiment of the present invention provides a solution. When using a communication tunnel for data transmission, the message is first compressed and then transmitted through the tunnel, thereby improving data transmission performance.
[0069] Figure 1 A schematic diagram of the composition of a message compression system provided by an embodiment of the present invention is as follows Figure 1 As shown, the system includes a first device, a sending end of a communication tunnel, a receiving end of the communication tunnel, and a second device, wherein the first device is a sending end of a data message, and the second device is a receiving end of a data message.
[0070] In the embodiment of the present invention, the first device and the second device may be different devices in different application scenarios, and corresponding devices may be selected as the first device and the second device according to actual needs. For example, in a scenario where a user sends data to a target server, the first device may be a user device and the second device may be a target server. Then, in a scenario where the target server sends data to a user terminal, the first device may be the target server and the second device may be a user device.
[0071] Tunnel technology can be used to transmit data between networks. Tunnel technology is a way to transmit data between networks by using the infrastructure of the Internet. When a first device transmits data to a second device, the data is transmitted through a communication tunnel. When transmitting in the tunnel, a transmitting end of the communication tunnel and a receiving end of the communication tunnel are required to complete the transmission of data. The communication tunnel can be a tunnel of the Control And Provisioning of Wireless Access Points Protocol Specification (CAPWAP for short), and its communication tunnel includes a control tunnel and a data tunnel. The CAPWAP control tunnel is used to transmit control messages, and the CAPWAP data tunnel is used to transmit data messages. The CAPWAP tunnel is mainly used to complete information interaction and data transmission through a wireless access point (Access Point, AP for short) and a wireless controller (AC for short).
[0072] When using tunnel technology for data transmission, there are both a sending end and a receiving end of the communication tunnel. The sending end and the receiving end of the communication tunnel can be changed, depending on the direction of data transmission. For example, when the user end transmits data to the target server and a CAPWAP tunnel is used, the sending end of the communication tunnel can be the AP and the receiving end of the communication tunnel can be the AC. However, when the target server transmits data to the user end, the sending end of the communication tunnel can be the AC and the receiving end of the communication tunnel can be the AP.
[0073] In actual application, when the first device transmits data to the second device, during the data transmission process, the first device first sends the data to be transmitted to the sending end of the communication tunnel in the form of a data message. After receiving the first data message, the sending end of the communication tunnel searches the set mapping table for a mapping table entry corresponding to the first five-tuple corresponding to the first data message. If the mapping table entry corresponding to the first five-tuple is not found in the set mapping table, a mapping table entry corresponding to the first five-tuple is created, wherein the mapping table entry is used to describe the correspondence between the first five-tuple and the second five-tuple, and the source IP address and the destination IP address in the second five-tuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively. At the same time, the mapping table entry is synchronized to the receiving end of the communication tunnel. Afterwards, according to the correspondence between the first five-tuple and the second five-tuple in the mapping table entry, the first five-tuple is replaced by the second five-tuple to generate a second data message. If the mapping table entry corresponding to the first five-tuple is found in the mapping table, the first five-tuple is replaced by the second five-tuple contained in the mapping table entry to generate a second data message. Finally, the second data message is sent to the receiving end of the communication tunnel. When the receiving end of the communication tunnel receives the second data message, the second data message includes the second quintuple, and then the second quintuple is replaced with the first quintuple according to the mapping table entry to obtain the first data message, and the first data message is sent to the second device.
[0074] Under this communication architecture, the first device and the second device cannot perceive the internal composition and working process of the communication tunnel. That is, the first and second devices only maintain their own operations and do not need to care about the transmission of data in the communication tunnel.
[0075] In summary, in the message compression system provided by the embodiment of the present invention, the first quintuple and the second quintuple are replaced by the correspondence between the first quintuple and the second quintuple stored in the mapping table. It is no longer necessary to encapsulate the tunnel message header on the basis of the original data message, and tunnel transmission can be achieved. Since the length of the tunnel message is not increased, the transmission performance is improved during the transmission process.
[0076] The above briefly introduces the message compression system based on which message compression is implemented. The following is an exemplary description of the message compression process performed based on the message compression system.
[0077] Figure 2 An interactive flow chart of a message compression method provided by an embodiment of the present invention, such as Figure 2 As shown, the method may include the following steps:
[0078] 201. A sending end of a communication tunnel receives a first data packet sent by a first device, where the first data packet includes a first quintuple.
[0079] 202. If the sending end of the communication tunnel does not find the mapping table entry corresponding to the first quintuple in the set mapping table, a mapping table entry corresponding to the first quintuple is created. The mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple. The source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively.
[0080] 203. The sending end of the communication tunnel synchronizes the mapping table entry to the receiving end.
[0081] 204. The sending end of the communication tunnel replaces the first quintuple with the second quintuple to generate a second data message.
[0082] 205. The sending end of the communication tunnel sends the second data message to the receiving end.
[0083] 206. The receiving end of the communication tunnel restores the second quintuple to the first quintuple according to the mapping table entry to obtain a first data message, and sends the first data message to the second device.
[0084] In the embodiment of the present invention, the sending end of the communication tunnel may be Figure 1 The sending end is shown in the figure. The receiving end of the communication tunnel can be Figure 1 In actual applications, the sending end and the receiving end of the communication tunnel can change with the change of application scenarios. The sending end of the communication tunnel can also be the receiving end, and the receiving end of the communication tunnel can also be the sending end. The sending end and the receiving end can be determined according to the transmission direction of the data.
[0085] When the first device sends a first data message to the second device through the tunnel technology, the first data message is first sent by the first device, and then transmitted through the communication tunnel to reach the second device. The first data message sent by the first device includes a first five-tuple, and the source IP address and the destination IP address in the first five-tuple are the IP address of the first device and the IP address of the second device respectively.
[0086] When a communication tunnel transmits a data message, the first data message sent by the first device is first received by the sending end of the communication tunnel, wherein the first data message includes the first five-tuple. Then, the first five-tuple is replaced at the sending end of the communication tunnel to generate a second data message. Then, the sending end of the communication tunnel sends the second data message to the receiving end of the communication tunnel, and the second five-tuple is replaced with the first five-tuple at the receiving end of the communication tunnel to obtain the first data message.
[0087] Among them, there are two quintuple replacements in the communication tunnel. The first time is to replace the first quintuple with the second quintuple that can be recognized by the receiving end of the communication tunnel at the sending end of the communication tunnel, and the second time is to replace the second quintuple with the first quintuple that can be recognized by the second device at the receiving end of the communication tunnel. After two quintuple replacements, the data message sent by the receiving end of the communication tunnel to the second device is the first data message originally received by the first device, so that the second device can recognize the first data message and receive the first data message.
[0088] Specifically, the process of replacing the first quintuple with the second quintuple can be as follows: the sending end of the communication tunnel first searches in the set mapping table whether there is a mapping table entry corresponding to the first quintuple. If the mapping table entry corresponding to the first quintuple is not found in the set mapping table, a mapping table entry corresponding to the first quintuple is created. At the same time, the newly created mapping table entry is synchronized to the receiving end of the communication tunnel. The mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple. The source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively. Then, the sending end of the communication tunnel replaces the first quintuple with the second quintuple according to the mapping table entry to generate a second data message.
[0089] Specifically, the process of replacing the second quintuple with the first quintuple may be: the receiving end of the communication tunnel first receives the mapping table entry sent by the sending end of the communication tunnel, receives the data message sent by the sending end, and the data message received by the receiving end of the communication tunnel includes the second quintuple. Afterwards, the receiving end of the communication tunnel replaces the second quintuple with the first quintuple according to the mapping table entry, and sends the replaced data message to the device corresponding to the destination IP address in the first quintuple, that is, the second device.
[0090] In the embodiment of the present invention, after the process of replacing the first quintuple with the second quintuple according to the mapping table entry, a checksum process may also be included. Based on the second quintuple, a checksum corresponding to the second data message is regenerated. Generating a checksum corresponding to the second data message can avoid the occurrence of a situation where part of the data message is lost during the transmission process, thereby ensuring the integrity and accuracy of the data during the transmission process.
[0091] Similarly, in the embodiment of the present invention, after the process of replacing the second quintuple with the first quintuple according to the mapping table entry, a checksum process may also be included. Based on the first quintuple, the checksum corresponding to the replaced data message is regenerated to ensure the integrity and accuracy of the replaced data message during transmission.
[0092] The data message is transmitted in the communication tunnel, and the communication tunnel may include a control tunnel and a data tunnel. The control message may be transmitted through the control tunnel, and the data message may be transmitted through the data tunnel.
[0093] Specifically, the specific process of synchronizing the mapping table entry to the receiving end of the communication tunnel may be: synchronizing the mapping table entry to the receiving end through the control tunnel.
[0094] Specifically, the specific process of sending the second data message to the receiving end may be: sending the second data message to the receiving end through the data tunnel.
[0095] In the embodiment of the present invention, the length of the data message is not increased during the message compression process, and the data message is compressed by replacing the five-tuple twice. The purpose of implementing message compression is to solve the problem that when the data message is transmitted through the tunnel, the tunnel message header is encapsulated on the basis of the data message, which increases the length of the tunnel message, thereby improving the transmission performance of the data message.
[0096] In summary, when the receiving end of the communication tunnel receives the first data message sent by the first device, the first data message includes the first quintuple. Then, the receiving end of the communication tunnel searches the set mapping table to see whether the mapping table item corresponding to the first quintuple is included. If the mapping table item corresponding to the first quintuple is not found in the set mapping table, a mapping table item corresponding to the first quintuple is created, wherein the mapping table item is used to describe the correspondence between the first quintuple and the second quintuple, the source IP address and the destination IP address in the first quintuple are the IP address of the first device and the IP address of the second device, respectively, and the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively, that is, the mapping table item stores the correspondence between the first quintuple and the second quintuple. At the same time, the mapping table item is synchronized to the receiving end of the communication tunnel. Afterwards, the receiving end of the communication tunnel replaces the first quintuple with the second quintuple according to the correspondence between the first quintuple and the second quintuple in the mapping table item to generate the second data message. Finally, the sending end of the communication tunnel sends the second data message to the receiving end of the communication tunnel. The receiving end of the communication tunnel restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data message, and sends the first data message to the second device. According to the correspondence between the first quintuple and the second quintuple in the mapping table entry, the first quintuple is replaced with the second quintuple, so that the length of the data message does not increase, the data message is compressed, and the transmission performance of the data message is guaranteed.
[0097] For ease of understanding, combined Figure 3 For example, in Figure 3In the example, assume that user device 1 sends data to target server A through a CAPWAP tunnel. In this scenario, the first device is user device 1, the second device is target server A, the sending end of the communication tunnel is AP, and the receiving end of the communication tunnel is AC. Assume that the IP address of user device 1 is 1.1.100, the IP address of target server A is 1.1.200, the IP address of AP is 1.1.300, and the IP address of AC is 1.1.400.
[0098] like Figure 3 As shown in , when user 1 has a data transmission requirement, data is sent to target server A through the CAPWAP tunnel. First, user device 1 sends a first data message to AP, wherein the first data message includes a first quintuple, assuming that the source IP address in the first quintuple is 1.1.100 and the destination IP address is 1.1.200. AP first receives the first data message sent by user device 1. After receiving the first data message, it searches the set mapping table for a mapping table entry corresponding to the first quintuple. If the mapping table entry corresponding to the first quintuple is not found in the set mapping table, a mapping table entry corresponding to the first quintuple is created, and the newly created mapping table entry is synchronized to AC. The mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address of the second quintuple is 1.1.300 and the destination IP address is 1.1.400. Afterwards, according to the mapping table entry corresponding to the first quintuple, the first quintuple is replaced with the second quintuple to obtain a second data message. Specifically, the source IP address 1.1.100 is replaced with the IP address 1.1.300, and the destination IP address 1.1.200 is replaced with the IP address 1.1.400. Here, the source IP address and the destination IP address in the first five-tuple are used as examples. In addition to replacing the five-tuple, the source MAC and the destination MAC can also be replaced at the same time. The specific replacement form is set according to actual needs. Finally, the AP sends the second data message to the AC.
[0099] AC first receives the mapping table entry synchronized by AP and the second data message sent by AP, wherein the second data message includes a second quintuple, the source IP address in the second quintuple is 1.1.300, and the destination IP address is 1.1.400. Then, according to the mapping table entry, the second quintuple is replaced with the first quintuple to obtain the first data message. Specifically, the source IP address 1.1.300 is replaced with the IP address 1.1.100, and the destination IP address 1.1.200 is replaced with the IP address 1.1.400. Here, the source IP address and the destination IP address in the first quintuple are used as examples. Finally, the replaced data message, i.e., the first data message, is sent to the device corresponding to the destination IP address 1.1.200 in the first quintuple, i.e., to the target server A.
[0100] In the above embodiments, when searching for mapping table items, it is assumed that the mapping table item corresponding to the first five-tuple cannot be found in the set mapping table. However, in reality, there may be a situation where the mapping table item corresponding to the first five-tuple can be found in the set mapping table. For this situation, the following method can be used: Figure 4 The solution provided by the illustrated embodiment.
[0101] Figure 4 An interactive flow chart of another message compression method provided by an embodiment of the present invention, such as Figure 4 As shown, the method may include the following steps:
[0102] 401. A sending end of a communication tunnel receives a first data packet sent by a first device, where the first data packet includes a first quintuple.
[0103] 402. If the sending end of the communication tunnel finds a mapping table entry corresponding to the first quintuple in the set mapping table, the first quintuple is replaced with the second quintuple included in the mapping table entry to generate a second data message.
[0104] 403. The sending end of the communication tunnel sends the second data message to the receiving end of the communication tunnel.
[0105] 404. The receiving end of the communication tunnel restores the second quintuple to the first quintuple according to the mapping table entry to obtain a first data message, and sends the first data message to the second device.
[0106] When the first device sends a data message to the second device, the transmission is performed through the communication tunnel. First, the sending end of the communication tunnel receives the first data message sent by the first device, wherein the first data message includes a first quintuple. According to the first quintuple, a search is performed in the set mapping table to determine whether there is a corresponding mapping table entry. If a mapping table entry corresponding to the first quintuple is found in the set mapping table entry, the first quintuple is directly replaced with the second quintuple contained in the mapping table entry to generate a second data message. Then, the sending end of the communication tunnel sends the second data message to the receiving end of the communication tunnel. The receiving end of the communication tunnel restores the second quintuple to the first quintuple according to the mapping table entry corresponding to the first quintuple in the set mapping table, obtains the first data message, and sends the first data message to the second device.
[0107] Here, the operation of replacing the first quintuple with the second quintuple can make the receiving end of the communication tunnel recognize its data message when it is transmitted to the receiving end of the communication tunnel, so as to prevent the receiving end of the communication tunnel from discarding the data message as a junk message. And directly replacing the first quintuple with the second quintuple eliminates the need to encapsulate the communication tunnel message header, and the receiving end of the communication tunnel can also recognize the data message, so that the length of the data message does not increase. Then restoring the second quintuple to the first quintuple can make the data message transmitted to the second device the first data message sent by the first device.
[0108] The specific execution process of some steps of the solution provided in the embodiment of the present invention can refer to the relevant descriptions in the aforementioned other embodiments and will not be repeated here.
[0109] In addition to the above-mentioned example scenarios, the message compression method provided by the embodiment of the present invention can also be applied to the scenario where the target server A sends data to the user device 1. When the target server A sends data to the user device 1 through the CAPWAP tunnel, in this scenario, the sending end of the communication tunnel and the receiving end of the communication tunnel change, the sending end of the communication tunnel is AC, and the receiving end of the communication tunnel is AP, but the specific implementation method of the receiving end of the communication tunnel and the sending end of the communication tunnel does not change, and the data transmission is still completed according to the steps that the sending end of the communication tunnel and the receiving end of the communication tunnel need to complete.
[0110] The message compression device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.
[0111] Figure 5 A schematic diagram of the structure of a message compression device provided by an embodiment of the present invention, the device is located at the sending end of a communication tunnel, such as Figure 5 As shown, the device includes: a receiving module 11, a creating module 12, a synchronizing module 13, a replacing module 14, and a sending module 15.
[0112] The receiving module 11 is configured to receive a first data message sent by a first device, wherein the first data message includes a first quintuple.
[0113] A creation module 12 is used to create a mapping table entry corresponding to the first quintuple if the mapping table entry corresponding to the first quintuple is not found in the set mapping table, and the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address and destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively.
[0114] The synchronization module 13 is used to synchronize the mapping table entry to the receiving end.
[0115] The replacement module 14 is used to replace the first quintuple with the second quintuple to generate a second data message.
[0116] The sending module 15 is used to send the second data message to the receiving end, so that the receiving end restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data message, and sends the first data message to the second device.
[0117] Optionally, the message compression device may further include a replacement module 16, which may be specifically used to: if a mapping table entry corresponding to the first quintuple is queried in the mapping table, replace the first quintuple with the second quintuple contained in the mapping table entry to generate a second data message.
[0118] Optionally, the synchronization module 13 may be specifically configured to: synchronize the mapping table entry to the receiving end via a control tunnel.
[0119] Optionally, the sending module 15 can be specifically used to: send the second data packet to the receiving end through the data tunnel, so that the receiving end restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data packet, and sends the first data packet to the second device.
[0120] Optionally, the communication tunnel may include a control tunnel and a data tunnel.
[0121] Optionally, the replacement module 14 may further include a checksum module 17, which is specifically used to regenerate a checksum corresponding to the second data message based on the second quintuple.
[0122] Optionally, the communication tunnel includes a tunnel that supports control and configuration protocols of the wireless access point.
[0123] Figure 5 The device shown can execute the steps executed by the sending end of the communication tunnel in the aforementioned embodiment. The detailed execution process and technical effects are described in the aforementioned embodiment and will not be repeated here.
[0124] In one possible design, the above Figure 5 The structure of the message compression device shown can be implemented as a sending end device of a communication tunnel, such as Figure 6As shown, the device may include: a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable code, and when the executable code is executed by the processor 21, the processor 21 can at least implement the steps performed by the sending end of the communication tunnel in the above embodiment.
[0125] Figure 7 A schematic diagram of the structure of a message compression device provided by an embodiment of the present invention, the device is located at the receiving end of a communication tunnel, such as Figure 7 As shown, the device includes: a receiving module 31, a replacing module 32, and a sending module 33.
[0126] The receiving module 31 is used to receive a mapping table entry sent by the sending end of the communication tunnel, the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, the source IP address and the destination IP address in the second quintuple are respectively the IP address of the sending end and the IP address of the receiving end, and receive a data packet sent by the sending end, the data packet including the second quintuple.
[0127] The replacement module 32 is used to replace the second quintuple with the first quintuple according to the mapping table entry.
[0128] The sending module 33 is used to send the replaced data message to the device corresponding to the destination IP address in the first quintuple.
[0129] Optionally, the replacement module 32 may further include a checksum module 34, which is specifically used to regenerate a checksum corresponding to the replaced data message based on the first quintuple.
[0130] Figure 7 The device shown can execute the steps executed by the receiving end of the communication tunnel in the aforementioned embodiment. The detailed execution process and technical effects are described in the aforementioned embodiment and will not be repeated here.
[0131] In one possible design, the above Figure 7 The structure of the message compression device shown can be implemented as a device at the receiving end of a communication tunnel, such as Figure 8 As shown, the device may include: a processor 41, a memory 42, and a communication interface 43. The memory 42 stores executable code, and when the executable code is executed by the processor 41, the processor 41 can at least implement the steps performed by the receiving end of the communication tunnel in the above embodiment.
[0132] In addition, an embodiment of the present invention provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of a network device, the processor can at least implement the message compression method provided in the aforementioned embodiment.
[0133] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0134] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A message compression method, characterized in that: Applicable to the sending end of the communication tunnel, including: Receive a first data message sent by a first device, where the first data message includes a first quintuple; a source IP address and a destination IP address in the first quintuple are respectively an IP address of the first device and an IP address of a second device; If a mapping table entry corresponding to the first quintuple is not found in the set mapping table, a mapping table entry corresponding to the first quintuple is created, wherein the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel, respectively; Synchronizing the mapping table entry to the receiving end; Replacing the first quintuple with the second quintuple to generate a second data message; The second data packet is sent to the receiving end, so that the receiving end restores the second quintuple to the first quintuple according to the mapping table entry to obtain the first data packet, and sends the first data packet to the second device.
2. The method according to claim 1, characterized in that The method further comprises: If a mapping table entry corresponding to the first five-tuple is found in the mapping table, the first five-tuple is replaced with the second five-tuple included in the mapping table entry to generate a second data message.
3. The method according to claim 1, characterized in that The communication tunnel includes a control tunnel and a data tunnel; The synchronizing the mapping table entry to the receiving end comprises: synchronizing the mapping table entry to the receiving end through the control tunnel; The sending the second data message to the receiving end includes: sending the second data message to the receiving end through the data tunnel.
4. The method according to claim 1, characterized in that: After replacing the first quintuple with the second quintuple, the method includes: Based on the second quintuple, a checksum corresponding to the second data message is regenerated.
5. The method according to claim 1, characterized in that The communication tunnels include tunnels that support control and configuration protocols for wireless access points.
6. A message compression method, characterized in that: Applied to the receiving end of the communication tunnel, including: Receive a mapping table entry sent by a sending end of the communication tunnel, the mapping table entry being used to describe a correspondence between a first quintuple and a second quintuple, the source IP address and the destination IP address in the second quintuple being the IP address of the sending end and the IP address of the receiving end, respectively, and the source IP address and the destination IP address in the first quintuple being the IP address of the first device and the IP address of the second device, respectively; receiving a data message sent by the sending end, wherein the data message includes a second quintuple; Replacing the second quintuple with the first quintuple according to the mapping table entry; The replaced data packet is sent to the second device corresponding to the destination IP address in the first quintuple.
7. The method according to claim 6, characterized in that After replacing the second quintuple with the first quintuple according to the mapping table entry, the method further includes: Based on the first quintuple, a checksum corresponding to the replaced data message is regenerated.
8. A message compression device, characterized in that: Located at the sending end of the communication tunnel, including: A receiving module, configured to receive a first data message sent by a first device, wherein the first data message includes a first quintuple; a source IP address and a destination IP address in the first quintuple are respectively an IP address of the first device and an IP address of a second device; a creation module, configured to create a mapping table entry corresponding to the first quintuple if a mapping table entry corresponding to the first quintuple is not found in a set mapping table, the mapping table entry being used to describe a correspondence between the first quintuple and a second quintuple, wherein a source IP address and a destination IP address in the second quintuple are an IP address of a sending end of the communication tunnel and an IP address of a receiving end of the communication tunnel, respectively; A synchronization module, used for synchronizing the mapping table entry to the receiving end; A replacement module, used for replacing the first quintuple with the second quintuple to generate a second data message; A sending module is used to send the second data message to the receiving end, so that the receiving end restores the second five-tuple to the first five-tuple according to the mapping table entry to obtain the first data message, and sends the first data message to the second device.
9. A message compression device, characterized in that: Located at the receiving end of the communication tunnel, including: a receiving module, configured to receive a mapping table entry sent by a sending end of the communication tunnel, the mapping table entry being used to describe a correspondence between a first quintuple and a second quintuple, the source IP address and the destination IP address in the second quintuple being the IP address of the sending end and the IP address of the receiving end, respectively, and the source IP address and the destination IP address in the first quintuple being the IP address of the first device and the IP address of the second device, respectively; and receive a data message sent by the sending end, the data message including the second quintuple; A replacement module, used for replacing the second quintuple with the first quintuple according to the mapping table entry; A sending module is used to send the replaced data message to the second device corresponding to the destination IP address in the first quintuple.
10. A message compression system, characterized in that: It includes a first device, a transmitting end of a communication tunnel, a receiving end of the communication tunnel, and a second device; The first device is used to send a first data message to a sending end of the communication tunnel, wherein the first data message includes a first quintuple; the source IP address and the destination IP address in the first quintuple are the IP address of the first device and the IP address of the second device respectively; The sending end of the communication tunnel is used to create a mapping table entry corresponding to the first quintuple if a mapping table entry corresponding to the first quintuple is not found in a set mapping table, the mapping table entry is used to describe the correspondence between the first quintuple and the second quintuple, and the source IP address and the destination IP address in the second quintuple are the IP address of the sending end of the communication tunnel and the IP address of the receiving end of the communication tunnel respectively; Synchronizing the mapping table entry to the receiving end of the communication tunnel, and replacing the first quintuple with the second quintuple to generate a second data message, and sending the second data message to the receiving end of the communication tunnel; The receiving end of the communication tunnel is used to restore the second quintuple to the first quintuple according to the mapping table entry to obtain the first data message, and send the first data message to the second device; The second device is used to receive the first data message sent by the receiving end of the communication tunnel.
11. A sending end device of a communication tunnel, characterized in that: include: Memory, processor, communication interface; The memory stores executable codes, and when the executable codes are executed by the processor, the processor executes the message compression method according to any one of claims 1 to 5.
12. A receiving end device of a communication tunnel, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the message compression method as described in claim 6 or 7.
13. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of a network device, the processor executes the message compression method as described in any one of claims 1 to 5, or the message compression method as described in claim 6 or 7.
Citation Information
Patent Citations
Method, device and system for forwarding message
CN101651606A