An ap device debugging and diagnosing method and device based on eapol message
By adding custom index values and data to EAPOL messages, passwordless proactive diagnosis of AP devices is achieved, solving the problem of inefficient STA device debugging in existing technologies and improving the diagnostic efficiency and security of AP devices.
Patent Information
- Application Number
- CN202510071131.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-01-16
AI Technical Summary
In existing technologies, AP device debugging requires STA devices to enter hotspot passwords for authentication access one by one, which is inefficient and cannot actively diagnose, especially when the password is unknown, it cannot be effectively debugged.
By adopting the WPA/WPA2 authentication process and adding custom-type index values and data to EAPOL messages, passwordless active diagnosis between STA devices and AP devices can be achieved. Diagnostic operations can be automatically executed by carrying diagnostic instructions and results in EAPOL messages.
Active diagnostics of AP devices can be performed without entering a hotspot password, improving debugging efficiency and security, and avoiding cumbersome password input and underlying code changes.
Smart Images

Figure CN119907031B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication, and in particular to a method and apparatus for debugging and diagnosing AP devices based on EAPOL messages. Background Technology
[0002] When debugging multiple AP (Access Point) devices, wireless connection is usually used.
[0003] In existing technologies, technicians typically need to use a STA (Station) device to authenticate and access each AP device individually using its SSID (Service Set Identifier) and password, then log in to a management webpage to view and debug the device. Alternatively, custom data can be added to the beacon frames of the wireless signal to enable the AP device to periodically broadcast its status. The first method requires recording a large number of hotspot passwords; when the hotspot password of an AP device is unknown, this method cannot be used to diagnose the AP device, thus resulting in low efficiency. The second method relies on the wireless communication chip manufacturer to provide underlying API interfaces and is highly passive, unable to actively debug the AP device through the STA.
[0004] Therefore, how to perform proactive diagnosis and debugging of AP devices through STA devices without requiring a password is a technical problem that needs to be solved. Summary of the Invention
[0005] This application provides an AP device debugging and diagnostic method and apparatus based on EAPOL messages to solve the technical problem of how to perform active diagnosis and debugging of AP devices through STA devices without the need for a password.
[0006] To address the aforementioned technical problems, in a first aspect, embodiments of this application provide an AP device debugging and diagnostic method based on EAPOL messages, applied to AP devices. The debugging and diagnostic method employs a WPA / WPA2 authentication process and includes:
[0007] When a first association request is received from the first STA device, an association is established with the first STA device, and a first message is returned to the first STA device;
[0008] When a first EAPOL message is received from the first STA device within a first preset time, the first EAPOL message is parsed to obtain the first MAC address of the first STA device; the first EAPOL message is an EAPOL message of a first custom type.
[0009] When a first diagnostic instruction is obtained by parsing the first EAPOL message, a second EAPOL message is generated based on the first diagnostic instruction;
[0010] Based on the first MAC address, the second EAPOL message is returned to the corresponding first STA device, so that the first STA device can parse the second EAPOL message to obtain the first diagnostic result; the second EAPOL message is an EAPOL message of the first custom type.
[0011] Compared to existing technologies, the embodiments of this application have the following advantages: In the standard WPA / WPA2 authentication process between a STA device and an AP device, after the STA device and the AP device are associated, a further four-way handshake authentication process is required to establish a connection between the two devices. In the standard four-way handshake process, after the AP device sends the first message (i.e., Message 1) to the STA device, the STA device should generate Message 2 based on the hotspot password and return Message 2 to the AP device until the complete four-way handshake process is completed. Therefore, to avoid using the hotspot password, Message 2 generated based on the hotspot password is replaced with a first custom type EAPOL message, so that the first EAPOL message sent by the first STA device contains diagnostic instructions. Subsequently, when the first AP device parses and obtains the diagnostic instructions from the first EAPOL message, it automatically executes the diagnostic process and obtains the first diagnostic result. Thus, it can actively obtain the diagnostic debugging results of the first AP device without the need for cumbersome hotspot password input or code changes at the underlying level.
[0012] In some embodiments of the first aspect of this application, the first custom type EAPOL message includes: first custom data and a first preset index value of the first custom type EAPOL message;
[0013] The first custom data includes: first data content and the type of the first data content; the first data content includes either the first diagnostic instruction or the first diagnostic result.
[0014] Compared with the prior art, the above embodiments have the following beneficial effects: by adding a first preset index value with an identifying function to the EAPOL message of the first custom type, the first AP device can accurately identify the function of the data carried in the currently received EAPOL message during the second handshake, so as to execute the corresponding first diagnostic instruction to generate a diagnostic result according to the first custom data, so as to obtain the diagnostic result of the first AP device without having to establish a connection communication through a hotspot password.
[0015] In some embodiments of the first aspect of this application, the step of generating a second EAPOL message based on the first diagnostic instruction when the first diagnostic instruction is parsed and obtained from the first EAPOL message includes:
[0016] When the first preset index value can be obtained from the first EAPOL message, and the first data content is determined to be the first diagnostic instruction based on the type of the first data content, then a diagnostic operation is performed according to the first diagnosis to obtain the first diagnostic result.
[0017] The first diagnostic result is encapsulated into an EAPOL message of the first custom type to generate the second EAPOL message.
[0018] Compared with the prior art, the above embodiments have the following beneficial effects: When the first preset index value is parsed in the first EAPOL message, it means that the first EAPOL message is a first custom type of EAPOL message. At this time, the type of the first data content can be used to determine whether the first data content is a first diagnostic instruction or a first diagnostic result. When the first data content is a first diagnostic instruction, the first AP device can perform the corresponding diagnostic operation according to the first diagnostic instruction, generate the first diagnostic result, encapsulate the first diagnostic result and return it to the first STA device, so that the first STA device can obtain the diagnostic result of the first AP device without establishing a connection communication through a hotspot password.
[0019] In some embodiments of the first aspect of this application, when no EAPOL message is received for a first preset time, the association with the first STA device is disconnected.
[0020] Compared to existing technologies, the above embodiments have the following advantages: After the first AP device returns a first message to the first STA device, it waits for the first STA device to respond and return an EAPOL message within a specified time. If the first AP device does not receive any EAPOL message within the first preset time, it indicates that the first STA device cannot respond in time. This may mean that there is a problem with the entire connection authentication process, and it is necessary to disconnect the association with the first STA device. This helps to avoid invalid connection requests that have been suspended for a long time, thereby improving network efficiency and security.
[0021] Secondly, embodiments of this application also provide an AP device debugging and diagnostic method based on EAPOL messages, applied to a second STA device. The debugging and diagnostic method adopts the WPA / WPA2 authentication process and includes:
[0022] Send a second association request to the second AP device to be diagnosed;
[0023] When the second message returned by the second AP device according to the second association request is received, a third EAPOL message is generated according to the second diagnostic command input by the user, and the third EAPOL message is returned to the second AP device; the third EAPOL message is a second custom type EAPOL message;
[0024] When the second AP device receives the fourth EAPOL message returned by the second AP device based on the third EAPOL message, the fourth EAPOL message is parsed to obtain the second diagnostic result of the second AP device; the fourth EAPOL message is a second custom type of EAPOL message.
[0025] Compared with the prior art, the above embodiments have the following beneficial effects: In order to avoid the second AP device using the hotspot password, Message 2 generated according to the hotspot password is replaced with a second custom type of EAPOL message, so that the second EAPOL message sent by the second STA device contains diagnostic instructions. Subsequently, when the second AP device parses and obtains the diagnostic instructions from the third EAPOL message, it automatically executes the diagnostic process and obtains the second diagnostic result. Therefore, it is not necessary to perform cumbersome hotspot password input or change the code from the underlying level, and the diagnostic debugging results of the second AP device can be actively obtained.
[0026] In some embodiments of the second aspect of this application, the second custom type of EAPOL message includes: second custom data and a second preset index value of the second custom type of EAPOL message;
[0027] The second custom data includes: second data content and the type of the second data content; the second data content includes either the second diagnostic instruction or the second diagnostic result.
[0028] Compared with the prior art, the above embodiments have the following beneficial effects: by adding a second preset index value with an identifying function to the EAPOL message of the second custom type, the second AP device can accurately identify the role of the data carried in the currently received EAPOL message during the second handshake, so as to execute the corresponding second diagnostic instruction to generate diagnostic results according to the second custom data, so as to obtain the diagnostic results of the second AP device without having to establish a connection communication through a hotspot password.
[0029] In some embodiments of the second aspect of this application, parsing the fourth EAPOL message to obtain the second diagnostic result of the second AP device includes:
[0030] When the second preset index value can be obtained from the fourth EAPOL message, and the second data content is determined to be the second diagnostic result based on the type of the second data content, the second data content is obtained by parsing.
[0031] Compared with the prior art, the above embodiments have the following beneficial effects: when the second preset index value is obtained from the fourth EAPOL message, it means that the fourth EAPOL message is a custom type of EAPOL message. At this time, if the type of the second data content in the fourth EAPOL message is a diagnostic result, the second data content can be obtained from the fourth EAPOL message as the second diagnostic result.
[0032] In some embodiments of the second aspect of this application, generating a third EAPOL message based on a second diagnostic instruction input by the user includes: encapsulating the second diagnostic instruction into an EAPOL message of the second custom type to generate the third EAPOL message.
[0033] Compared with the prior art, the above embodiments have the following beneficial effects: by encapsulating the diagnostic instructions into a second custom type of EAPOL message to generate a third EAPOL message, the second AP device can parse and obtain the diagnostic instructions from the third EAPOL message, automatically execute the diagnostic process, and obtain the second diagnostic result. Thus, without having to perform cumbersome hotspot password input or change the code from the underlying layer, the diagnostic debugging results of the second AP device can be actively obtained.
[0034] Thirdly, this application also provides an AP device debugging and diagnostic device based on EAPOL messages, applied to a first AP device. The debugging and diagnostic device adopts the WPA / WPA2 authentication process and includes: an associated response module, a first EAPOL message receiving module, a diagnostic instruction parsing module, and a diagnostic result sending module.
[0035] The association response module is used to establish an association with the first STA device and return a first message to the first STA device when it receives a first association request sent by the first STA device.
[0036] The first EAPOL message receiving module is configured to parse the first EAPOL message and obtain the first MAC address of the first STA device when it receives the first EAPOL message returned by the first STA device according to the first message within a first preset time; the first EAPOL message is an EAPOL message of a first custom type.
[0037] The diagnostic instruction parsing module is used to generate a second EAPOL message based on the first diagnostic instruction when a first diagnostic instruction is parsed and obtained from the first EAPOL message.
[0038] The diagnostic result sending module is used to return the second EAPOL message to the corresponding first STA device according to the first MAC address, so that the first STA device can parse the second EAPOL message to obtain the first diagnostic result; the second EAPOL message is an EAPOL message of a first custom type.
[0039] Fourthly, this application also provides an AP device debugging and diagnostic device based on EAPOL messages, applied to a second STA device. The debugging and diagnostic device adopts the WPA / WPA2 authentication process and includes: an association request sending module, a diagnostic instruction encapsulation module, and a diagnostic result receiving module.
[0040] The association request sending module is used to send a second association request to the second AP device to be diagnosed.
[0041] The diagnostic instruction encapsulation module is used to generate a third EAPOL message based on the second diagnostic instruction input by the user when it receives a second message returned by the second AP device according to the second association request, and to return the third EAPOL message to the second AP device; the third EAPOL message is a second custom type of EAPOL message;
[0042] The diagnostic result receiving module is used to parse the fourth EAPOL message and obtain the second diagnostic result of the second AP device when it receives the fourth EAPOL message returned by the second AP device based on the third EAPOL message; the fourth EAPOL message is an EAPOL message of a second custom type. Attached Figure Description
[0043] Figure 1 This is a flowchart illustrating an AP device debugging and diagnostic method based on EAPOL messages for a first AP device, provided in some embodiments of this application.
[0044] Figure 2 This is a flowchart illustrating an AP device debugging and diagnostic method based on EAPOL messages for a second STA device, provided in some embodiments of this application.
[0045] Figure 3 This is a schematic diagram of the encapsulation structure of a custom type of EAPOL message provided in some embodiments of this application;
[0046] Figure 4This is another flowchart illustrating an AP device debugging and diagnostic method provided in some embodiments of this application;
[0047] Figure 5 This is an example diagram of a custom type of EAPOL message in Wireshark, provided in some embodiments of this application.
[0048] Figure 6 This is a schematic diagram of the WPA / WPA2 authentication process provided in some embodiments of this application;
[0049] Figure 7 This diagram illustrates the difference between custom-type EAPOL messages and standard four-way handshake authentication messages in some embodiments of this application.
[0050] Figure 8 This is a schematic diagram of the structure of an AP device debugging and diagnostic device based on EAPOL messages for a first AP device provided in some embodiments of this application;
[0051] Figure 9 This is a schematic diagram of the structure of an AP device debugging and diagnostic device based on EAPOL messages for a second STA device provided in some embodiments of this application. Detailed Implementation
[0052] In existing technologies, technicians typically need to authenticate each AP device individually using a STA device with its SSID and password before logging into a management webpage to view and debug the device. Alternatively, custom data can be added to the beacon frames of the wireless signal to enable the AP device to periodically broadcast its status. The first method requires recording a large number of hotspot passwords, making it inefficient to diagnose AP devices without knowing their hotspot passwords. The second method relies on the wireless communication chip manufacturer to provide underlying API interfaces and is highly passive, preventing active debugging of AP devices via the STA.
[0053] To address the aforementioned technical problems, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0054] Example 1
[0055] Please refer to Figure 1This application provides an AP device debugging and diagnosis method based on EAPOL messages, which is applied to a first AP device. The debugging and diagnosis method adopts the WPA / WPA2 authentication process and includes the following S10 to S40.
[0056] Preferably, in some embodiments of this application, the WPA / WPA2 authentication process used in the debugging and diagnostic method adopts development system authentication. That is, when the AP device is associated with the STA device, the AP device does not verify the authenticity of the STA device. The authenticity verification of the AP device is performed in the subsequent four-way handshake process. In other words, in the prior art, the STA device returns the hotspot password to the AP device to establish a connection.
[0057] S10: When a first association request is received from the first STA device, an association is established with the first STA device, and a first message is returned to the first STA device.
[0058] Preferably, in some embodiments of this application, the first AP device includes, but is not limited to: traditional wireless access points, integrated wireless access points, Mesh wireless access points, and enterprise-level wireless access points, etc., and all of the above devices need to have the function of parsing custom type EAPOL messages.
[0059] S20: When the first EAPOL message returned by the first STA device according to the first message is received within a first preset time, the first EAPOL message is parsed to obtain the first MAC address of the first STA device; the first EAPOL message is an EAPOL message of a first custom type.
[0060] Furthermore, in some embodiments of this application, the first custom type EAPOL message includes: first custom data and a first preset index value of the first custom type EAPOL message;
[0061] The first custom data includes: first data content and the type of the first data content; the first data content includes either the first diagnostic instruction or the first diagnostic result.
[0062] By adding a first preset index value with an identifying function to the EAPOL message of the first custom type, the first AP device can accurately identify the role of the data carried in the currently received EAPOL message during the second handshake. Thus, it can execute the corresponding first diagnostic instruction to generate a diagnostic result based on the first custom data, thereby enabling the acquisition of the diagnostic result of the first AP device without having to establish a connection and communication through a hotspot password.
[0063] Furthermore, in some embodiments of this application, when no EAPOL message is received for a first preset time, the association with the first STA device is disconnected.
[0064] After the first AP device sends the first message to the first STA device, it will wait for the first STA device to respond and send an EAPOL message within a specified time. If the first AP device does not receive any EAPOL message within the first preset time, it means that the first STA device cannot respond in time. This may mean that there is a problem with the entire connection authentication process, and it is necessary to disconnect from the first STA device. This helps to avoid invalid connection requests that have been suspended for a long time, thereby improving network efficiency and security.
[0065] Preferably, in some embodiments of this application, when a non-custom type EAPOL message is received within a first preset time, the received EAPOL message is processed according to the normal four-way handshake process.
[0066] S30: When the first diagnostic instruction is obtained by parsing from the first EAPOL message, a second EAPOL message is generated according to the first diagnostic instruction.
[0067] Furthermore, in some embodiments of this application, the step of generating a second EAPOL message based on the first diagnostic instruction when the first diagnostic instruction is parsed and obtained from the first EAPOL message includes:
[0068] When the first preset index value can be obtained from the first EAPOL message, and the first data content is determined to be the first diagnostic instruction based on the type of the first data content, then a diagnostic operation is performed according to the first diagnosis to obtain the first diagnostic result.
[0069] The first diagnostic result is encapsulated into an EAPOL message of the first custom type to generate the second EAPOL message.
[0070] When the first preset index value is parsed in the first EAPOL message, it means that the first EAPOL message is a first custom type of EAPOL message. At this time, the type of the first data content can be used to determine whether the first data content is a first diagnostic instruction or a first diagnostic result. When the first data content is a first diagnostic instruction, the first AP device can perform the corresponding diagnostic operation according to the first diagnostic instruction, generate the first diagnostic result, encapsulate the first diagnostic result and return it to the first STA device, so that the first STA device can obtain the diagnostic result of the first AP device without establishing a connection through a hotspot password.
[0071] S40: Based on the first MAC address, the second EAPOL message is returned to the corresponding first STA device, so that the first STA device can parse the second EAPOL message to obtain the first diagnostic result; the second EAPOL message is an EAPOL message of the first custom type.
[0072] In summary, the AP device debugging and diagnostic method based on EAPOL messages provided in this application has the following beneficial effects: In the standard WPA / WPA2 authentication process between STA and AP devices, after the STA and AP devices are associated, a further four-way handshake authentication process is required to establish a connection between the two devices. In the standard four-way handshake process, after the AP device sends the first message (i.e., Message 1) to the STA device, the STA device should generate Message 2 based on the hotspot password and return Message 2 to the AP device until the complete four-way handshake process is completed. Therefore, to avoid using the hotspot password, Message 2 generated based on the hotspot password is replaced with a first custom type of EAPOL message, so that the first EAPOL message sent by the first STA device contains diagnostic instructions. Subsequently, when the first AP device parses and obtains the diagnostic instructions from the first EAPOL message, it automatically executes the diagnostic process and obtains the first diagnostic result. Thus, it can actively obtain the diagnostic debugging result of the first AP device without the need for cumbersome hotspot password input or code modification at the underlying level.
[0073] Example 2
[0074] Please refer to Figure 2 This application provides an AP device debugging and diagnosis method based on EAPOL messages, applied to a second STA device. The debugging and diagnosis method adopts the WPA / WPA2 authentication process and includes S50 to S70.
[0075] S50: Send a second association request to the second AP device to be diagnosed.
[0076] Preferably, in some embodiments of this application, the second AP device includes, but is not limited to: traditional wireless access points, integrated wireless access points, Mesh wireless access points, and enterprise-grade wireless access points, etc., and all of the above devices need to have the function of parsing custom type EAPOL messages.
[0077] S60: When the second message returned by the second AP device according to the second association request is received, a third EAPOL message is generated according to the second diagnostic command input by the user, and the third EAPOL message is returned to the second AP device; the third EAPOL message is a second custom type EAPOL message.
[0078] Furthermore, in some embodiments of this application, the second custom type EAPOL message includes: second custom data and a second preset index value of the second custom type EAPOL message;
[0079] The second custom data includes: second data content and the type of the second data content; the second data content includes either the second diagnostic instruction or the second diagnostic result.
[0080] Preferably, refer to Figure 3 This is a custom type of EAPOL message provided in some embodiments of this application. The first custom type of EAPOL message in Embodiment 1 and the second custom type of EAPOL message in this embodiment can be adopted as follows: Figure 3 The EAPOL message encapsulation structure shown is shown.
[0081] Combination Figure 3 The EAPOL message encapsulation structure shown includes an Ethernet header and an 802.1X Auth payload, comprising the first custom type EAPOL message and the second custom type EAPOL message. The Ethernet header includes the destination MAC address, source MAC address, and Ethernet type, where the Ethernet type value is eth.type = 0x888e, indicating an 802.1X Authentication (0x888e) message. The destination MAC address refers to the address to which this message needs to be sent. The source MAC address refers to the source address from which this message was sent. The 802.1X Auth payload includes a series of index values and custom data content, such as: eapol.version is a fixed index; eapol.type is the index of the EAPOL packet type; eapol.length represents the length of the packet starting from the current byte; eapol.keydes.type identifies whether the EAPOL packet is a custom type, in which case eapol.keydes.type = 8, and in a standard four-way handshake, eapol.keydes.type = 2; eapol.keydes.body is the custom data (i.e., the first custom data or the second custom data), including the magic word, data content (i.e., the first data content or the second data content), and the data content type (i.e., the...). Figure 3The packet type is defined as follows: the magic word is a pre-defined numerical value used as a special identifier to distinguish custom-type EAPOL messages. The magic word can use values such as 0xA1B2C3D4. The packet type is used to identify whether the data content is a diagnostic instruction or a diagnostic result.
[0082] By adding a second preset index value with an identifying function to the EAPOL message of the second custom type, the second AP device can accurately identify the role of the data carried in the currently received EAPOL message during the second handshake. Thus, it can execute the corresponding second diagnostic command based on the second custom data to generate diagnostic results, thereby enabling the acquisition of the diagnostic results of the second AP device without having to establish a connection through a hotspot password.
[0083] S70: When the second AP device receives the fourth EAPOL message returned by the second AP device based on the third EAPOL message, the fourth EAPOL message is parsed to obtain the second diagnostic result of the second AP device; the fourth EAPOL message is a second custom type EAPOL message.
[0084] Furthermore, in some embodiments of this application, parsing the fourth EAPOL message to obtain the second diagnostic result of the second AP device includes:
[0085] When the second preset index value can be obtained from the fourth EAPOL message, and the second data content is determined to be the second diagnostic result based on the type of the second data content, the second data content is obtained by parsing.
[0086] When the second preset index value is obtained from the fourth EAPOL message, it means that the fourth EAPOL message is a custom type of EAPOL message. If the type of the second data content in the fourth EAPOL message is a diagnostic result, the second data content can be obtained from the fourth EAPOL message as the second diagnostic result.
[0087] Furthermore, in some embodiments of this application, generating a third EAPOL message based on a second diagnostic instruction input by the user includes: encapsulating the second diagnostic instruction into a second custom type of EAPOL message to generate the third EAPOL message.
[0088] By encapsulating diagnostic commands into a second custom type of EAPOL message to generate a third EAPOL message, the second AP device can parse and obtain the diagnostic commands from the third EAPOL message, automatically execute the diagnostic process, and obtain the second diagnostic results. This eliminates the need for cumbersome hotspot password input or code modifications at the underlying level, allowing the device to proactively obtain the diagnostic and debugging results of the second AP device.
[0089] In summary, the AP device debugging and diagnosis method based on EAPOL messages for a second STA device provided in this application embodiment has the following beneficial effects: To avoid the second AP device using a hotspot password, Message 2 generated based on the hotspot password is replaced with a second custom type of EAPOL message, so that the second EAPOL message sent by the second STA device contains diagnostic instructions. Subsequently, when the second AP device parses and obtains the diagnostic instructions from the third EAPOL message, it automatically executes the diagnostic process and obtains the second diagnostic result. Therefore, it is not necessary to perform cumbersome hotspot password input or change the underlying code, and the diagnostic debugging result of the second AP device can be actively obtained.
[0090] Example 3
[0091] To better understand Embodiment 1 and Embodiment 2 above, the following will be combined with... Figure 4 This embodiment details the specific process of the AP device debugging and diagnosis method based on EAPOL messages.
[0092] S80: First, the AP device waits for the STA device to associate with it. After the AP device and the STA device are associated, they enter the four-way handshake authentication phase (at this time, the AP device will send msg1 to the STA device. In this application, for the sake of simplicity in explaining the four-way handshake authentication process, msg1, msg2, msg3 and msg4 are used to represent the message information transmitted in the four-way handshake authentication process, respectively). At the same time, the AP device starts the authentication timeout timer. If the EAPOL message is received before the authentication timeout timer is triggered, the process jumps to S90; otherwise, it executes S81.
[0093] S81: The AP device terminates the four-way handshake authentication phase with the corresponding STA device, disconnects from the corresponding STA device, and re-executes S80.
[0094] S90: Determine if the EAPOL message is... Figure 3 If the EAPOL message is of the custom type shown, execute S100; otherwise, execute S91.
[0095] S91: After processing the received EAPOL message according to the standard four-way handshake authentication process, continue to execute S80.
[0096] S100: Parse custom type EAPOL messages, obtain the MAC address of the STA device (i.e., the source MAC address in the received EAPOL message) and diagnostic instructions, and generate corresponding diagnostic results based on the diagnostic instructions.
[0097] S110: After encapsulating the diagnostic results into a custom type of EAPOL message, send the message to the STA device corresponding to the MAC address and execute S80.
[0098] refer to Figure 5 This is an example of a Wireshark message, where the left side shows the diagnostic command message sent by the STA to the AP, and the right side shows the diagnostic result message sent by the AP to the STA. It can be seen that some of the diagnostic commands mentioned in this application are actually index values. After the AP device parses and obtains the diagnostic command, it determines the operation to be performed based on this value, such as querying CPU utilization. After the AP device completes the relevant diagnostic operation, it sends the diagnostic result back to the STA device, such as... Figure 5 As shown on the right, the AP device encapsulates the occupancy rate in hexadecimal into an EAPOL message. After the STA device obtains this result, it converts it to decimal and performs certain calculations to obtain the actual diagnostic result.
[0099] In addition, refer to Figure 6 Since the WPA / WPA2 authentication process in this application uses open system authentication, the authenticity of the STA device's identity will not be authenticated before association. Figure 6 In the sequence, the first two messages are generated when the STA device scans the hotspots of the AP device; the first two messages are STA authentication messages using Open Systems Authentication; the first three messages are for association between the STA and the AP, with messages 6 and 7 being identical, which can be understood as a retransmission operation after packet loss; the first 11 messages are the four-way handshake authentication process. At this time, the AP and STA can send EAPOL messages, but cannot send IP messages. Therefore, the STA can actively send diagnostic commands to the AP device through EAPOL messages and actively obtain diagnostic results.
[0100] refer to Figure 7 This diagram illustrates the difference between custom-type EAPOL messages in this application and EAPOL messages in the standard four-way handshake authentication process. The left side shows an example of an EAPOL message in the standard four-way handshake authentication process, and the right side shows an example of a custom-type EAPOL message mentioned in some embodiments of this application. In the custom-type EAPOL message, eapol.keydes.type = 8, which differs from eapol.keydes.type = 2 in the standard four-way handshake authentication process. The subsequent data payload also differs; in the custom-type EAPOL message, the subsequent data payload contains custom data including diagnostic instructions or diagnostic content.
[0101] As can be seen from the above embodiment 3, the AP device debugging and diagnosis method based on EAPOL messages provided in some embodiments of this application has the following beneficial effects: In the WPA / WPA2 authentication process of wireless communication, after the STA is associated with the AP, it cannot send IP messages but can send EAPOL messages to perform four-way handshake authentication. Therefore, this application realizes the function of debugging and diagnosing the AP device without a password by sending EAPOL messages with custom data after the STA is associated with the AP, thereby improving the flexibility of AP device debugging and diagnosis.
[0102] Example 4
[0103] refer to Figure 8 This application provides an AP device debugging and diagnostic device based on EAPOL messages for a first AP device in some embodiments. The debugging and diagnostic device adopts the WPA / WPA2 authentication process and includes: an associated response module 11, a first EAPOL message receiving module 12, a diagnostic instruction parsing module 13, and a diagnostic result sending module 14.
[0104] The association response module 11 is configured to establish an association with the first STA device and return a first message to the first STA device when it receives a first association request sent by the first STA device; the first EAPOL message receiving module 12 is configured to parse the first EAPOL message and obtain the first MAC address of the first STA device when it receives the first EAPOL message returned by the first STA device according to the first message within a first preset time; the first EAPOL message is an EAPOL message of a first custom type; the diagnostic instruction parsing module 13 is configured to generate a second EAPOL message according to the first diagnostic instruction when it parses and obtains the first diagnostic instruction from the first EAPOL message; the diagnostic result sending module 14 is configured to return the second EAPOL message to the corresponding first STA device according to the first MAC address, so that the first STA device can parse the second EAPOL message to obtain a first diagnostic result; the second EAPOL message is an EAPOL message of a first custom type.
[0105] Furthermore, in some embodiments of this application, the first custom type EAPOL message includes: first custom data and a first preset index value of the first custom type EAPOL message; wherein, the first custom data includes: first data content and the type of the first data content; the first data content includes any one of the first diagnostic instruction or the first diagnostic result.
[0106] Furthermore, in some embodiments of this application, the step of generating a second EAPOL message based on the first diagnostic instruction when the first diagnostic instruction is parsed from the first EAPOL message includes: when the first preset index value can be parsed from the first EAPOL message, and the first data content is determined to be the first diagnostic instruction based on the type of the first data content, then a diagnostic operation is performed based on the first diagnosis to obtain a first diagnostic result; and the first diagnostic result is encapsulated into the first custom type EAPOL message to generate the second EAPOL message.
[0107] Furthermore, in some embodiments of this application, when no EAPOL message is received for a first preset time, the association with the first STA device is disconnected.
[0108] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention. The AP device debugging and diagnosis device based on EAPOL messages provided by the embodiments of the present invention can implement any one of the method embodiments of the present invention, namely the AP device debugging and diagnosis method based on EAPOL messages provided in embodiments one to three.
[0109] In summary, the AP device debugging and diagnostic method based on EAPOL messages provided in this application has the following beneficial effects: In the standard WPA / WPA2 authentication process between STA and AP devices, after the STA and AP devices are associated, a further four-way handshake authentication process is required to establish a connection between the two devices. In the standard four-way handshake process, after the AP device sends the first message (i.e., Message 1) to the STA device, the STA device should generate Message 2 based on the hotspot password and return Message 2 to the AP device until the complete four-way handshake process is completed. Therefore, to avoid using the hotspot password, Message 2 generated based on the hotspot password is replaced with a first custom type of EAPOL message, so that the first EAPOL message sent by the first STA device contains diagnostic instructions. Subsequently, when the first AP device parses and obtains the diagnostic instructions from the first EAPOL message, it automatically executes the diagnostic process and obtains the first diagnostic result. Thus, it can actively obtain the diagnostic debugging result of the first AP device without the need for cumbersome hotspot password input or code modification at the underlying level.
[0110] Example 5
[0111] refer to Figure 9This application provides an AP device debugging and diagnostic device based on EAPOL messages for a second STA device in some embodiments. The debugging and diagnostic device adopts the WPA / WPA2 authentication process and includes: an association request sending module 15, a diagnostic instruction encapsulation module 16, and a diagnostic result receiving module 17.
[0112] Further, in some embodiments of this application, the association request sending module 15 is used to send a second association request to the second AP device to be diagnosed; the diagnostic instruction encapsulation module 16 is used to generate a third EAPOL message according to the second diagnostic instruction input by the user when receiving a second message returned by the second AP device according to the second association request, and return the third EAPOL message to the second AP device; the third EAPOL message is a second custom type EAPOL message; the diagnostic result receiving module 17 is used to parse the fourth EAPOL message and obtain the second diagnostic result of the second AP device when receiving a fourth EAPOL message returned by the second AP device according to the third EAPOL message; the fourth EAPOL message is a second custom type EAPOL message.
[0113] Furthermore, in some embodiments of this application, the second custom type EAPOL message includes: second custom data and a second preset index value of the second custom type EAPOL message; wherein, the second custom data includes: second data content and the type of the second data content; the second data content includes either the second diagnostic instruction or the second diagnostic result.
[0114] Furthermore, in some embodiments of this application, parsing the fourth EAPOL message to obtain the second diagnostic result of the second AP device includes: parsing and obtaining the second preset index value from the fourth EAPOL message, and determining the second data content as the second diagnostic result based on the type of the second data content, then parsing and obtaining the second data content.
[0115] Furthermore, in some embodiments of this application, generating a third EAPOL message based on a second diagnostic instruction input by the user includes: encapsulating the second diagnostic instruction into a second custom type of EAPOL message to generate the third EAPOL message.
[0116] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention. The AP device debugging and diagnosis device based on EAPOL messages provided by the embodiments of the present invention can implement any one of the method embodiments of the present invention, namely the AP device debugging and diagnosis method based on EAPOL messages provided in embodiments one to three.
[0117] In summary, the AP device debugging and diagnosis method based on EAPOL messages for a second STA device provided in this application embodiment has the following beneficial effects: To avoid the second AP device using a hotspot password, Message 2 generated based on the hotspot password is replaced with a second custom type of EAPOL message, so that the second EAPOL message sent by the second STA device contains diagnostic instructions. Subsequently, when the second AP device parses and obtains the diagnostic instructions from the third EAPOL message, it automatically executes the diagnostic process and obtains the second diagnostic result. Therefore, it is not necessary to perform cumbersome hotspot password input or change the underlying code, and the diagnostic debugging result of the second AP device can be actively obtained.
[0118] Example 6
[0119] Based on the above-described embodiments of the AP device debugging and diagnosis method based on EAPOL messages, another embodiment of this application provides an AP device debugging and diagnosis terminal device based on EAPOL messages. The AP device debugging and diagnosis terminal device based on EAPOL messages includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the AP device debugging and diagnosis method based on EAPOL messages according to any embodiment of this application.
[0120] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the EAPOL message-based AP device debugging and diagnostic device.
[0121] The AP device debugging and diagnostic equipment based on EAPOL messages can be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. The AP device debugging and diagnostic terminal equipment based on EAPOL messages may include, but is not limited to, processors and memory.
[0122] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the EAPOL message-based AP device debugging and diagnostic equipment, connecting various parts of the entire EAPOL message-based AP device debugging and diagnostic equipment via various interfaces and lines. The memory can be used to store the computer programs and / or modules. The processor implements various functions of the EAPOL message-based AP device debugging and diagnostic equipment by running or executing the computer programs and / or modules stored in the memory, and by calling data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0123] Example 7
[0124] Based on the above embodiments of the AP device debugging and diagnosis method based on EAPOL messages, another embodiment of this application provides a storage medium, the storage medium including a stored computer program, wherein, when the computer program is running, the device where the storage medium is located controls the execution of the AP device debugging and diagnosis method based on EAPOL messages of any embodiment of this application.
[0125] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0126] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. A debugging and diagnostic method for an AP device based on EAPOL messages, applied to a first AP device, wherein the debugging and diagnostic method adopts a WPA / WPA2 authentication process, characterized in that, include: When a first association request is received from the first STA device, an association is established with the first STA device, and a first message is returned to the first STA device; When a first EAPOL message is received from the first STA device within a first preset time, the first EAPOL message is parsed to obtain the first MAC address of the first STA device. The first EAPOL message is an EAPOL message of the first custom type; When a first diagnostic instruction is obtained by parsing the first EAPOL message, a second EAPOL message is generated based on the first diagnostic instruction. Based on the first MAC address, the second EAPOL message is returned to the corresponding first STA device, so that the first STA device can parse the second EAPOL message to obtain the first diagnostic result; the second EAPOL message is an EAPOL message of the first custom type.
2. The AP device debugging and diagnosis method based on EAPOL messages as described in claim 1, characterized in that, The first custom type of EAPOL message includes: first custom data and a first preset index value of the first custom type of EAPOL message; The first custom data includes: first data content and the type of the first data content; the first data content includes either the first diagnostic instruction or the first diagnostic result.
3. The AP device debugging and diagnosis method based on EAPOL messages as described in claim 2, characterized in that, When a first diagnostic instruction is obtained by parsing from the first EAPOL message, generating a second EAPOL message based on the first diagnostic instruction includes: When the first preset index value can be obtained from the first EAPOL message, and the first data content is determined to be the first diagnostic instruction based on the type of the first data content, then a diagnostic operation is performed according to the first diagnosis to obtain the first diagnostic result. The first diagnostic result is encapsulated into an EAPOL message of the first custom type to generate the second EAPOL message.
4. The AP device debugging and diagnosis method based on EAPOL messages as described in claim 1, characterized in that, If no EAPOL message is received within a first preset time, the association with the first STA device is disconnected.
5. A debugging and diagnostic method for AP devices based on EAPOL messages, applied to a second STA device, wherein the debugging and diagnostic method adopts the WPA / WPA2 authentication process, characterized in that... include: Send a second association request to the second AP device to be diagnosed; When the second message returned by the second AP device according to the second association request is received, a third EAPOL message is generated according to the second diagnostic command input by the user, and the third EAPOL message is returned to the second AP device; The third EAPOL message is an EAPOL message of the second custom type; When the second AP device receives the fourth EAPOL message returned by the second AP device based on the third EAPOL message, the fourth EAPOL message is parsed to obtain the second diagnostic result of the second AP device; the fourth EAPOL message is a second custom type of EAPOL message.
6. The AP device debugging and diagnostic method based on EAPOL messages as described in claim 5, characterized in that, The second custom type of EAPOL message includes: second custom data and a second preset index value of the second custom type of EAPOL message; The second custom data includes: second data content and the type of the second data content; the second data content includes either the second diagnostic instruction or the second diagnostic result.
7. The AP device debugging and diagnosis method based on EAPOL messages as described in claim 6, characterized in that, The step of parsing the fourth EAPOL message to obtain the second diagnostic result of the second AP device includes: When the second preset index value can be obtained from the fourth EAPOL message, and the second data content is determined to be the second diagnostic result based on the type of the second data content, the second data content is obtained by parsing.
8. The AP device debugging and diagnostic method based on EAPOL messages as described in claim 5, characterized in that, The step of generating a third EAPOL message based on the second diagnostic instruction input by the user includes: encapsulating the second diagnostic instruction into an EAPOL message of the second custom type to generate the third EAPOL message.
9. An AP device debugging and diagnostic device based on EAPOL messages, applied to a first AP device, wherein the debugging and diagnostic device adopts the WPA / WPA2 authentication process, characterized in that, include: The module includes an associated response module, a first EAPOL message receiving module, a diagnostic instruction parsing module, and a diagnostic result sending module. The association response module is used to establish an association with the first STA device and return a first message to the first STA device when it receives a first association request sent by the first STA device. The first EAPOL message receiving module is configured to parse the first EAPOL message and obtain the first MAC address of the first STA device when it receives the first EAPOL message returned by the first STA device according to the first message within a first preset time; the first EAPOL message is an EAPOL message of a first custom type. The diagnostic instruction parsing module is used to generate a second EAPOL message based on the first diagnostic instruction when a first diagnostic instruction is parsed and obtained from the first EAPOL message. The diagnostic result sending module is used to return the second EAPOL message to the corresponding first STA device according to the first MAC address, so that the first STA device can parse the second EAPOL message to obtain the first diagnostic result; the second EAPOL message is an EAPOL message of a first custom type.
10. An AP device debugging and diagnostic device based on EAPOL messages, applied to a second STA device, wherein the debugging and diagnostic device adopts the WPA / WPA2 authentication process, characterized in that, include: The module includes a request sending module, a diagnostic instruction encapsulation module, and a diagnostic result receiving module. The association request sending module is used to send a second association request to the second AP device to be diagnosed. The diagnostic instruction encapsulation module is used to generate a third EAPOL message based on the second diagnostic instruction input by the user when it receives a second message returned by the second AP device according to the second association request, and to return the third EAPOL message to the second AP device; the third EAPOL message is a second custom type of EAPOL message; The diagnostic result receiving module is used to parse the fourth EAPOL message and obtain the second diagnostic result of the second AP device when it receives the fourth EAPOL message returned by the second AP device based on the third EAPOL message; the fourth EAPOL message is an EAPOL message of a second custom type.
Citation Information
Patent Citations
Electronic part information analysis method, system and device, terminal and storage medium
CN118400286A
Assisted wireless connection setup
US20170064760A1