Message processing method and device, electronic equipment and storage medium
By implementing data packet shunt operations on the access point (AP) side of the wireless LAN, data core load imbalance is solved by implementing data packets based on the five-tuple information of the data packet and the data core number in the access controller (AC), the data core load imbalance is solved The problem of excessive load of the access controller improves the packet processing efficiency.
Patent Information
- Application Number
- CN202411093028.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-08
AI Technical Summary
In a wireless LAN with a centralized forwarding mode, the access controller has an unbalanced load on the data core due to the same hash value corresponding to the same data core, and the access controller has an overload of load when receiving a large number of CAPWAP messages. question.
The target data core is determined by determining the five-tuple information of the data packet and the data core number in the access controller (AC) on the access point (AP) side of the wireless LAN, and carrying the target core in the CAPWAP data packet. Numbering is sent to the AC, so that the AC can directly call the corresponding data core to process the packet, thereby realizing the data packet diversion operation.
It improves the load imbalance of each data core in the AC, reduces the overall load of the AC, and improves the efficiency of message processing.
Smart Images

Figure CN118921699A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method, device, electronic device and storage medium. Background Art
[0002] In a wireless local area network (WLAN) with a centralized forwarding mode, an access controller (AC) usually processes Controlling and Provisioning of Wireless Access Point (CAPWAP) messages (which may be CAPWAP control messages or CAPWAP data messages) from access points (APs) in a flow-by-flow manner. That is, the AC calculates a hash value based on the five-tuple information of the CAPWAP header of the CAPWAP message, and sends the CAPWAP message to the corresponding control core or data core for further processing according to the calculated hash value.
[0003] However, in this message processing mode, the same hash value corresponds to the same data core, which may easily cause a load imbalance problem of the data core. In addition, when the AC receives a large number of CAPWAP messages, the AC load may be heavy. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present application provides a message processing method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present application, a message processing method is provided, the method being applied to an AP, the method comprising:
[0006] When a data message needs to be sent to the AC to which it is connected, the target data core that needs to process the data message is determined according to the five-tuple information of the data message and the core number of each data core in the AC obtained;
[0007] Performing CAPWAP encapsulation on the data message to obtain a CAPWAP data message, wherein a CAPWAP header of the CAPWAP data message carries a first target core number corresponding to the target data core;
[0008] The CAPWAP data message is sent to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
[0009] According to a second aspect of an embodiment of the present application, a message processing device is provided, the device being applied to an AP, the device comprising:
[0010] An acquisition and determination module, used for determining a target data core that needs to process the data core according to the five-tuple information of the data core and the core number of each data core in the AC when a data core needs to be sent to the AC to which the data core is connected;
[0011] an encapsulation module, configured to perform CAPWAP encapsulation on the data message to obtain a CAPWAP data message, wherein a CAPWAP header of the CAPWAP data message carries a first target core number corresponding to the target data core;
[0012] The sending module is used to send the CAPWAP data message to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
[0013] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps of the above-mentioned message processing method.
[0014] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of the above-mentioned message processing method are implemented.
[0015] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0016] In an embodiment of the present application, a message diversion operation of the data message is implemented on the AP side based on the five-tuple information of the data message that needs to be sent to the AC, and the AP carries the core number of the data core that needs to process the data message in the corresponding CAPWAP data message and sends it to the AC, so that the AC can directly call the data core corresponding to the core number to process the CAPWAP data message.
[0017] In this way, for data packets with different quintuple information, the data cores that need to process these data packets decided by the AP may be different, which improves the load imbalance problem of each data core in the AC; and the packet diversion operation of the data packet is implemented on the AP side, which also reduces the load on the AC.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0020] Figure 1 A flowchart of a message processing method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0024] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0025] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" or "if" as used herein may be interpreted as "at the time of" or "when...".
[0026] Next, the embodiments of the present application are described in detail.
[0027] The present application embodiment provides a message processing method, which is applied to an AP, such as Figure 1As shown, the method may include the following steps:
[0028] S11. When a data message needs to be sent to the AC to which it is connected, a target data core that needs to process the data message is determined according to the five-tuple information of the data message and the core number of each data core in the AC obtained.
[0029] In this step, the data message is sent by the source wireless terminal of the data message.
[0030] S12: Perform CAPWAP encapsulation on the data message to obtain a CAPWAP data message.
[0031] In this step, the CAPWAP header of the CAPWAP data message carries the first target core number corresponding to the target data core.
[0032] S13: Send the CAPWAP data message to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
[0033] Specifically, in the above step S11, the AP may obtain the core number of each data core in the AC in the following manner:
[0034] Receive a discovery response message sent by the AC, wherein the CAPWAP header of the discovery response message carries the core number of each data core in the AC;
[0035] The core number of each data core in the AC is obtained from the CAPWAP header of the discovery response message.
[0036] In addition, in the above step S11, the AP may determine the target data core that needs to process the data message in the following manner:
[0037] Perform hash calculation on the five-tuple information of the data message according to a preset hash algorithm to obtain a first hash value;
[0038] Performing a modulo operation on the first hash value and the total number of core numbers of all data cores to obtain a first operation result;
[0039] The data core whose core number is the first operation result is determined as the target data core that needs to process the data message.
[0040] It should be noted that the present application is not limited to determining the target data core that needs to process the data message by the above-mentioned determination method, and other methods can also be used to determine the target data core that needs to process the data message, which are not listed one by one here.
[0041] It should be further explained that, by executing the above steps S11 to S13, the AP can implement the message diversion operation of the data message on the AP side, and the AC will then directly call the corresponding data core to process the corresponding CAPWAP data message. In this way, not only can the load of the AC be reduced, but also the load imbalance problem of each data core in the AC can be improved.
[0042] Furthermore, in the embodiment of the present application, in order to further reduce the AC load, the AP may also perform the following operations:
[0043] After receiving the discovery response message sent by the AC, obtain the core number of each control core in the AC from the CAPWAP header of the discovery response message;
[0044] Determine the target control core that needs to process the CAPWAP control message other than the discovery request message according to the five-tuple information included in the CAPWAP header of the discovery response message and the core number of each control core in the AC obtained;
[0045] When it is necessary to send a CAPWAP control message other than a discovery request message to the AC, a CAPWAP control message carrying a second target core number corresponding to the target control core is generated, and the generated CAPWAP control message is sent to the AC, so that the AC calls the corresponding target control core to process the CAPWAP control message based on the second target core number carried in the CAPWAP header of the CAPWAP control message.
[0046] In this operation process, the AP can specifically determine the target control core that needs to process CAPWAP control messages other than discovery request messages in the following ways:
[0047] Performing a hash calculation on the five-tuple information included in the CAPWAP header of the discovery response message according to a preset hash algorithm to obtain a second hash value;
[0048] Performing a modulo operation on the second hash value and the total number of core numbers of all control cores to obtain a second operation result;
[0049] The control core whose core number is the second operation result is determined as a target control core that needs to process CAPWAP control messages other than the discovery request message.
[0050] It should be noted that in the embodiment of the present application, the preset hash algorithm may be an MD5 message digest algorithm (MD5 Message-Digest Algorithm) or a SHA-1 algorithm, etc.
[0051] It should be further explained that in an embodiment of the present application, after receiving the discovery response message sent by the AC, the AP can obtain the core numbers of each data core in the AC (i.e., the CPU core used to process CAPWAP data messages) and the core numbers of each control core in the AC (i.e., the CPU core used to process CAPWAP control messages) from the CAPWAP header of the discovery response message at one time.
[0052] The above message processing method is described in detail below in conjunction with specific embodiments.
[0053] Assume that in a certain WLAN network, the only AC in the WLAN network has 2 control cores and 3 data cores. For example, the 2 control cores are control core 11 and control core 12, the core number corresponding to control core 11 is 0, and the core number corresponding to control core 12 is 1; the 3 data cores are data core 21, data core 22, and data core 23, the core number corresponding to data core 21 is 0, the core number corresponding to data core 22 is 1, and the core number corresponding to data core 23 is 2.
[0054] Assume that at time 1, AP1 in the WLAN network needs to send data packet 1 from wireless terminal 1 in the WLAN network to the AC. In this case, AP1 determines the data core that needs to process data packet 1 based on the quintuple information of data packet 1 and the core number of each data core in the AC obtained from the CAPWAP header of the discovery response message.
[0055] Assume that the data core determined by AP1 is data core 22 with core number 1. At this time, AP1 performs CAPWAP encapsulation on data message 1 to obtain CAPWAP data message 1. The CAPWAP header of CAPWAP data message 1 carries the core number corresponding to data core 22 (ie, 1).
[0056] Afterwards, AP1 sends CAPWAP data packet 1 to the AC.
[0057] The AC calls the corresponding data core (ie, data core 22 ) to process CAPWAP data message 1 based on the core number carried in the CAPWAP header of CAPWAP data message 1 . The subsequent processing flow is the prior art and will not be described in detail here.
[0058] Next, assume that at time 2, AP1 needs to send data packet 2 from wireless terminal 2 in the WLAN network to the AC. In this case, AP1 determines the data core that needs to process data packet 2 based on the quintuple information of data packet 2 and the core number of each data core in the AC.
[0059] Assume that the data core determined by AP1 is data core 23 with core number 2, then AP1 performs CAPWAP encapsulation on data message 2 to obtain CAPWAP data message 2. The CAPWAP header of CAPWAP data message 2 carries the core number corresponding to data core 23 (ie, 2).
[0060] Afterwards, AP1 sends CAPWAP data packet 2 to the AC.
[0061] After receiving CAPWAP data message 2 , the AC calls the corresponding data core (ie, data core 23 ) to process CAPWAP data message 2 based on the core number carried in the CAPWAP header of CAPWAP data message 2 .
[0062] Assume that at time 3, AP1 needs to send CAPWAP control message 1 in addition to the discovery request message to the AC. In this case, since AP1 has previously determined the control core that needs to process CAPWAP control messages in addition to the discovery request message based on the quintuple information of the discovery response message and the core number of each control core in the AC obtained from the CAPWAP header of the discovery response message, AP1 directly generates CAPWAP control message 1 carrying the core number corresponding to the determined control core (for example, 0), and sends CAPWAP control message 1 to the AC.
[0063] After receiving CAPWAP control message 1 , AC calls the corresponding control core (ie, control core 11 ) to process CAPWAP control message 1 based on the core number carried in the CAPWAP header of CAPWAP control message 1 .
[0064] It can be seen from the above technical solution that in an embodiment of the present application, the message diversion operation of the data message is implemented on the AP side based on the five-tuple information of the data message that needs to be sent to the AC, and the AP carries the core number of the data core that needs to process the data message in the corresponding CAPWAP data message and sends it to the AC, so that the AC can directly call the data core corresponding to the core number to process the CAPWAP data message.
[0065] In this way, for data packets with different quintuple information, the data cores that need to process these data packets decided by the AP may be different, which improves the load imbalance problem of each data core in the AC; and the packet diversion operation of the data packet is implemented on the AP side, which also reduces the load on the AC.
[0066] Based on the same inventive concept, the present application also provides a message processing device, which is applied to AP, and its structural diagram is as follows: Figure 2 As shown, specifically including:
[0067] The acquisition and determination module 21 is used to determine the target data core that needs to process the data message according to the five-tuple information of the data message and the core number of each data core in the AC obtained when a data message needs to be sent to the access controller AC to which it is connected;
[0068] An encapsulation module 22 is used to perform wireless access point control and provisioning CAPWAP encapsulation on the data message to obtain a CAPWAP data message, wherein a CAPWAP header of the CAPWAP data message carries a first target core number corresponding to the target data core;
[0069] The sending module 23 is used to send the CAPWAP data message to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
[0070] Preferably, the acquisition and determination module 21 is specifically configured to acquire the core number of each data core in the AC in the following manner:
[0071] receiving a discovery response message sent by the AC, wherein a CAPWAP header of the discovery response message carries a core number of each data core in the AC;
[0072] The core number of each data core in the AC is obtained from the CAPWAP header of the discovery response message.
[0073] Preferably, the acquisition determination module 21 is specifically used to determine the target data core that needs to process the data message in the following manner:
[0074] Performing hash calculation on the five-tuple information of the data message according to a preset hash algorithm to obtain a first hash value;
[0075] Performing a modulo operation on the first hash value and the total number of core numbers of all data cores to obtain a first operation result;
[0076] The data core whose core number is the first operation result is determined as the target data core that needs to process the data message.
[0077] Preferably, the acquisition and determination module 21 is further used for:
[0078] After receiving the discovery response message sent by the AC, obtaining the core number of each control core in the AC from the CAPWAP header of the discovery response message;
[0079] Determine, according to the five-tuple information included in the CAPWAP header of the discovery response message and the core numbers of the control cores in the AC obtained, a target control core that needs to process the CAPWAP control message other than the discovery request message;
[0080] The device also includes:
[0081] Generate a sending module ( Figure 2 (not shown) is used to generate a CAPWAP control message carrying a second target core number corresponding to the target control core when a CAPWAP control message other than a discovery request message needs to be sent to the AC, and send the generated CAPWAP control message to the AC, so that the AC calls the corresponding target control core to process the CAPWAP control message based on the second target core number carried in the CAPWAP header of the CAPWAP control message.
[0082] Preferably, the acquisition determination module 21 is specifically used to determine the target control core that needs to process the CAPWAP control message other than the discovery request message in the following manner:
[0083] Performing a hash calculation on the five-tuple information included in the CAPWAP header of the discovery response message according to a preset hash algorithm to obtain a second hash value;
[0084] Performing a modulo operation on the second hash value and the total number of core numbers of all control cores to obtain a second operation result;
[0085] A control core whose core number is the second operation result is determined as a target control core that needs to process CAPWAP control messages other than the discovery request message.
[0086] It can be seen from the above technical solution that in an embodiment of the present application, the message diversion operation of the data message is implemented on the AP side based on the five-tuple information of the data message that needs to be sent to the AC, and the AP carries the core number of the data core that needs to process the data message in the corresponding CAPWAP data message and sends it to the AC, so that the AC can directly call the data core corresponding to the core number to process the CAPWAP data message.
[0087] In this way, for data packets with different quintuple information, the data cores that need to process these data packets decided by the AP may be different, which improves the load imbalance problem of each data core in the AC; and the packet diversion operation of the data packet is implemented on the AP side, which also reduces the load on the AC.
[0088] The present application also provides an electronic device, such as Figure 3As shown, it includes a processor 31 and a machine-readable storage medium 32, the machine-readable storage medium 32 stores machine-executable instructions that can be executed by the processor 31, and the processor 1401 is prompted by the machine-executable instructions to implement the steps of the above-mentioned message processing method.
[0089] The machine-readable storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the machine-readable storage medium may also be at least one storage device located away from the processor.
[0090] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0091] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned message processing method are implemented.
[0092] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A message processing method, characterized in that: The method is applied to an access point AP, and the method comprises: When a data message needs to be sent to the access controller AC to which it is connected, the target data core that needs to process the data message is determined according to the five-tuple information of the data message and the core number of each data core in the AC obtained; Performing wireless access point control and provisioning CAPWAP encapsulation on the data message to obtain a CAPWAP data message, wherein a CAPWAP header of the CAPWAP data message carries a first target core number corresponding to the target data core; The CAPWAP data message is sent to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
2. The method according to claim 1, characterized in that: The core number of each data core in the AC is obtained by: receiving a discovery response message sent by the AC, wherein a CAPWAP header of the discovery response message carries a core number of each data core in the AC; The core number of each data core in the AC is obtained from the CAPWAP header of the discovery response message.
3. The method according to claim 1, characterized in that The target data core that needs to process the data message is determined in the following manner: Performing hash calculation on the five-tuple information of the data message according to a preset hash algorithm to obtain a first hash value; Performing a modulo operation on the first hash value and the total number of core numbers of all data cores to obtain a first operation result; The data core whose core number is the first operation result is determined as the target data core that needs to process the data message.
4. The method according to claim 2, characterized in that: The method further comprises: After receiving the discovery response message sent by the AC, obtaining the core number of each control core in the AC from the CAPWAP header of the discovery response message; Determine, according to the five-tuple information included in the CAPWAP header of the discovery response message and the core numbers of the control cores in the AC obtained, a target control core that needs to process the CAPWAP control message other than the discovery request message; When it is necessary to send a CAPWAP control message other than a discovery request message to the AC, a CAPWAP control message carrying a second target core number corresponding to the target control core is generated, and the generated CAPWAP control message is sent to the AC, so that the AC calls the corresponding target control core to process the CAPWAP control message based on the second target core number carried in the CAPWAP header of the CAPWAP control message.
5. The method according to claim 4, characterized in that The target control core that needs to process CAPWAP control messages other than discovery request messages is determined in the following ways: Performing a hash calculation on the five-tuple information included in the CAPWAP header of the discovery response message according to a preset hash algorithm to obtain a second hash value; Performing a modulo operation on the second hash value and the total number of core numbers of all control cores to obtain a second operation result; A control core whose core number is the second operation result is determined as a target control core that needs to process CAPWAP control messages other than the discovery request message.
6. A message processing device, characterized in that: The device is applied to an access point AP, and the device includes: an acquisition and determination module, configured to determine, when a data message needs to be sent to an access controller AC to which it is connected, a target data core that needs to process the data message according to the five-tuple information of the data message and the core number of each data core in the AC obtained; An encapsulation module, configured to perform wireless access point control and provisioning CAPWAP encapsulation on the data message to obtain a CAPWAP data message, wherein a CAPWAP header of the CAPWAP data message carries a first target core number corresponding to the target data core; The sending module is used to send the CAPWAP data message to the AC, so that the AC calls the corresponding target data core to process the CAPWAP data message based on the first target core number carried in the CAPWAP header of the CAPWAP data message.
7. The device according to claim 6, characterized in that The acquisition and determination module is specifically used to obtain the core number of each data core in the AC in the following manner: receiving a discovery response message sent by the AC, wherein a CAPWAP header of the discovery response message carries a core number of each data core in the AC; The core number of each data core in the AC is obtained from the CAPWAP header of the discovery response message.
8. The device according to claim 6, characterized in that The acquisition and determination module is specifically used to determine the target data core that needs to process the data message in the following manner: Performing hash calculation on the five-tuple information of the data message according to a preset hash algorithm to obtain a first hash value; Performing a modulo operation on the first hash value and the total number of core numbers of all data cores to obtain a first operation result; The data core whose core number is the first operation result is determined as the target data core that needs to process the data message.
9. The device according to claim 7, characterized in that The acquisition and determination module is further used for: After receiving the discovery response message sent by the AC, obtaining the core number of each control core in the AC from the CAPWAP header of the discovery response message; Determine, according to the five-tuple information included in the CAPWAP header of the discovery response message and the core numbers of the control cores in the AC obtained, a target control core that needs to process the CAPWAP control message other than the discovery request message; The device also includes: A sending module is generated, which is used to generate a CAPWAP control message carrying a second target core number corresponding to the target control core when a CAPWAP control message other than a discovery request message needs to be sent to the AC, and send the generated CAPWAP control message to the AC, so that the AC calls the corresponding target control core to process the CAPWAP control message based on the second target core number carried in the CAPWAP header of the CAPWAP control message.
10. The device according to claim 9, characterized in that The acquisition and determination module is specifically used to determine the target control core that needs to process the CAPWAP control message other than the discovery request message in the following manner: Performing a hash calculation on the five-tuple information included in the CAPWAP header of the discovery response message according to a preset hash algorithm to obtain a second hash value; Performing a modulo operation on the second hash value and the total number of core numbers of all control cores to obtain a second operation result; A control core whose core number is the second operation result is determined as a target control core that needs to process CAPWAP control messages other than the discovery request message.
11. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps described in any one of claims 1 to 5.
12. 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 5 are implemented.
