Wireless device bridging method, system and device and storage medium
By generating virtual layer 2 broadcast messages during the wireless device bridge and broadcasting and sending, identifying the address format of the bridged device, the problem of not being able to identify the address format is solved, improving the accuracy and efficiency of wireless bridges, and ensuring communication Normality.
Patent Information
- Application Number
- CN202411297045.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
AI Technical Summary
During the existing wireless bridging process, the address format supported by the bridged device cannot be accurately identified, making it difficult to set up a suitable bridge method, affecting the bridging effect of the wireless device.
When the wireless device is associated with the bridged device, a virtual layer 2 broadcast message is generated and broadcast in a four-address format is broadcast to determine whether the broadcast message of the bridged device has been received. If it is received, it is set to the four-address mode , otherwise it is set to three-address mode.
By accurately identifying whether the bridged device supports the four-address format, ensuring normal communication between the wireless device and the bridged device is improved, the wireless bridging effect is reduced, and the address detection time and security risks are reduced.
Smart Images

Figure CN119254573A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a wireless device bridging method, system, device and storage medium. Background Art
[0002] Wireless bridging is a local area network wireless connection technology that connects different wireless devices to the same network, which can expand the coverage of the wireless network and provide greater network flexibility and convenience.
[0003] At present, the communication methods of wireless bridging include three-address communication and four-address communication. When using three addresses to communicate with wireless devices, a MAC (Media Access Control Address) address will be lost, causing abnormal functions in some scenarios. Using four addresses to communicate with wireless devices can completely retain four MAC addresses, which is suitable for complex network environments and has greater flexibility. Since some wireless devices cannot recognize wireless data frames in four-address format, when performing wireless bridging, it is usually necessary to communicate through the address format supported by the bridged device. However, in the existing wireless bridging process, it is impossible to accurately identify the address format supported by the bridged device, which makes it difficult to set a suitable bridging method for wireless bridging, affecting the bridging effect of the wireless device. Summary of the invention
[0004] The present invention provides a wireless device bridging method, system, device and storage medium to solve the problem that in the existing wireless bridging process, the address format supported by the bridged device cannot be accurately identified, resulting in difficulty in setting a suitable bridging mode for wireless bridging, which affects the bridging effect of the wireless device.
[0005] In a first aspect, an embodiment of the present application provides a wireless device bridging method, including:
[0006] When a wireless device associates with a bridged device, a virtual layer 2 broadcast message is generated;
[0007] Broadcasting a layer 2 broadcast message in a four-address format and determining whether the layer 2 broadcast message broadcast by the bridge device is received;
[0008] If a layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridge mode with the bridged device is set to the four-address mode.
[0009] Optionally, after determining whether a layer 2 broadcast message broadcast by the bridge device is received, the method further includes:
[0010] If the layer 2 broadcast message broadcast by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridge mode with the bridged device is set to the three-address mode.
[0011] Optionally, broadcasting a layer 2 broadcast message in a four-address format and determining whether the layer 2 broadcast message broadcast by the bridge device is received includes:
[0012] The layer 2 broadcast message is continuously broadcasted and sent for a preset number of times at a preset frequency in a four-address format, and a timing is performed after the broadcasting and sending is stopped;
[0013] Determine within a preset timing period whether a layer 2 broadcast message broadcast by the bridged device through the basic service set is received.
[0014] Optionally, determining whether a layer 2 broadcast message broadcasted by a bridge device is received includes:
[0015] When receiving a layer 2 broadcast message broadcasted by a bridged device, compare the contents of the received layer 2 broadcast message with the contents of the sent layer 2 broadcast message to see if they are consistent;
[0016] If the content of the received layer 2 broadcast message is consistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridged device is received;
[0017] If the content of the received layer 2 broadcast message is inconsistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridge device is not received.
[0018] Optionally, the layer 2 broadcast message includes a destination MAC address, a source MAC address and a message type; the destination MAC address is a broadcast MAC address composed entirely of FFs, the source MAC address is a virtual MAC address, and the source MAC address is different from the MAC address of the wireless device that generates the layer 2 broadcast message.
[0019] Optionally, the source MAC address is a local MAC address in a non-multicast format.
[0020] Optionally, the layer 2 broadcast message is an address resolution protocol request ARP Request message.
[0021] Optionally, before broadcasting the layer 2 broadcast message in the four-address format, the method further includes:
[0022] When it is detected that the bridged device is an encryption device, a key verification is performed on the bridged device, and after the key verification passes, a layer 2 broadcast message is broadcasted in a four-address format.
[0023] In a second aspect, an embodiment of the present application provides a wireless device, including:
[0024] A generating module, used for generating a virtual layer 2 broadcast message when the wireless device is associated with the bridged device;
[0025] A sending module, used for broadcasting a layer 2 broadcast message in a four-address format;
[0026] A determination module, used to determine whether a layer 2 broadcast message broadcast by a bridge device is received;
[0027] The setting module is used for determining that the bridged device supports the four-address format if a layer 2 broadcast message broadcast by the bridged device is received, and setting the bridge mode with the bridged device to the four-address mode.
[0028] In a third aspect, an embodiment of the present application provides a wireless device bridging system, including a wireless device and at least one bridged device, wherein the wireless device is used to:
[0029] When a wireless device associates with a bridged device, a virtual layer 2 broadcast message is generated;
[0030] Broadcasting a layer 2 broadcast message in a four-address format and determining whether the layer 2 broadcast message broadcast by the bridge device is received;
[0031] If a layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridge mode of the bridged device is set to the four-address mode.
[0032] In a fourth aspect, an embodiment of the present application provides a wireless device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned wireless device bridging method when executing the computer program.
[0033] In a fifth aspect, an embodiment of the present application provides a readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned wireless device bridging method are implemented.
[0034] In a solution provided by the wireless device bridging method, system, device and storage medium, when the wireless device is associated with the bridged device, the wireless device generates a virtual layer 2 broadcast message, and broadcasts the layer 2 broadcast message in a four-address format. If the layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridging mode with the bridged device is set to the four-address mode. In this embodiment, by setting the layer 2 broadcast message to perform address detection on the bridged device, and monitoring whether the bridged device broadcasts the layer 2 broadcast message, it is possible to accurately determine whether the bridged device supports the four-address format, thereby performing wireless bridging with the target device in a suitable bridging mode, ensuring normal communication with the bridged device, and improving the wireless bridging effect between the wireless device and the bridged device. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0036] Figure 1 is a structural diagram of a wireless device bridging system in one embodiment of the present invention;
[0037] Figure 2 is a flow chart of a wireless device bridging method according to an embodiment of the present invention;
[0038] Figure 3 yes Figure 2 A schematic diagram of an implementation process of step S20;
[0039] Figure 4 yes Figure 2 Another implementation flow diagram of step S20;
[0040] Figure 5 is another flowchart of a wireless device bridging method according to an embodiment of the present invention;
[0041] Figure 6 is a schematic diagram of a structure of a wireless device in one embodiment of the present invention;
[0042] Figure 7 FIG. 4 is another schematic diagram of the structure of a wireless device in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or their collections. It should also be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0045] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0046] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0047] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0048] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0049] The wireless device bridging method provided by the embodiment of the present invention can be applied in Figure 1 In the wireless device bridging system shown, the wireless device bridging system includes a wireless device (backend device) that bridges other devices and at least one bridged device (i.e., the other wireless device that is bridged), wherein the bridged device communicates with the wireless device that bridges other devices through a wireless network.
[0050] It is important to understand that when performing wireless bridging, it is usually necessary to confirm the address format supported by the bridged device (i.e., the wireless data frame address format in the wireless standard protocol), so as to use the address format supported by the bridged wireless device to communicate with the bridged device. However, in the traditional wireless bridging process, it is impossible to automatically identify whether the bridged device supports the four-address format (i.e., the address format including 4 MAC addresses). For this reason, there are two main existing bridging solutions. The first solution is to directly use three addresses for bridging without identifying the address format, so as to avoid the situation where the wireless device does not support the four-address format and cannot communicate. However, this method can only use three-address bridging, that is, using the three-address format (i.e., the address format including 3 MAC addresses) to communicate with the bridged device. During the communication process, a MAC address will be lost, causing functional abnormalities in some scenarios.
[0051] The second solution is to use the Dynamic Host Configuration Protocol (DHCP) Discovery message, that is, the DHCPDiscover message to perform address detection, and determine the bridging method based on the address detection result. The back-end device sends a DHCPDiscover wireless message in a four-address format, and determines whether the front-end device (bridged device) supports the four-address format by observing whether the front-end device (bridged device) can respond to the DHCPDiscover message. If it supports the four-address format, four-address bridging is performed. If it does not support the four-address format, three-address bridging is performed. This method has two defects. One is that the address detection accuracy is poor. This method requires that there must be a DHCP server in the wireless network system. When the wireless network system does not have a DHCP server, even if the wireless device supports the four-address format, it cannot receive the DHCPDiscover message, resulting in address detection failure. The second is that the address detection speed is slow and it is easy to cause coupling between layers and various security risks. In the Open System Interconnect (OSI) model, the data link layer is generally called the second layer and the network layer is called the third layer. The three-address or four-address format communication of the wireless network is the functional attribute of the data link layer in the OSI model, that is, the second-layer functional attribute, but the DHCPDiscover message is the message of the network layer in the OSI model, that is, the third-layer message. After the back-end device sends the DHCPDiscover message, the front-end device needs to hand over the DHCPDiscover message to the third layer for processing. The use of the third-layer message for address format detection destroys the basic idea of wireless network layering and easily causes coupling between layers, leading to various security risks. In addition, if there are multiple front-end devices between the DHCP server and the current device, then the back-and-forth interaction of DHCP must cross all wireless devices, and the transmission takes a long time, resulting in slow address detection.
[0052] Based on the above problems, in this embodiment, when the wireless device is associated with the bridged device, the wireless device generates a virtual layer 2 broadcast message, and then the wireless device broadcasts the layer 2 broadcast message in a four-address format, and determines whether the layer 2 broadcast message broadcast by the bridged device is received; if the layer 2 broadcast message broadcast by the bridged device is received, the wireless device determines that the bridged device supports the four-address format, and sets the bridging mode with the bridged device to the four-address mode, that is, communicates with the bridged device in the four-address format. By setting the layer 2 broadcast message to perform address detection on the bridged device, and monitoring whether the bridged device broadcasts the layer 2 broadcast message, and cleverly utilizing the forwarding mechanism of the layer 2 broadcast message in the wireless network, it is possible to accurately and quickly determine whether the bridged device supports the four-address format, thereby setting a suitable bridging mode to perform wireless bridging with the bridged device, which can ensure normal communication between the two and improve the wireless bridging effect between the wireless device and the bridged device. At the same time, since the second-layer broadcast message belongs to the data link layer like the address format, the second-layer broadcast message is used for address detection, and only the message transmission processing is required at the data link layer, which can reduce the message transmission time, thereby increasing the address detection speed and improving the efficiency of wireless bridging. In addition, the second-layer broadcast message at the data link layer performs address detection, and the functional logic of the data link layer is complete and closed-loop, without crossing the network level, and has no dependency relationship with other levels, reducing or even avoiding coupling between levels, and reducing the security risk of wireless networks.
[0053] The wireless device that bridges other devices may be a wireless router. The bridged device is a wireless device, which may be a wireless router or various terminal devices, such as various personal computers, laptops, smart phones, tablet computers, portable wearable devices and other wireless devices.
[0054] In one embodiment, if Figure 2 As shown, a wireless device bridging method is provided, and the method is applied in Figure 1 The wireless device bridging system in the example is used to illustrate, including the following steps:
[0055] S10: When the wireless device is associated with the bridged device, a virtual layer 2 broadcast message is generated.
[0056] After the wireless bridging function is enabled, the wireless device and the bridged device are authenticated, and after the authentication is passed, the wireless device and the bridged device establish an association relationship to maintain the connection between the two networks.
[0057] The authentication process between the wireless device and the bridged device is an interactive process of the identity authentication frame based on the standard (IEEE802.11) protocol commonly used in wireless local area networks. If the wireless device bridge system is an open system, the authentication process includes 2-step authentication; if the wireless device bridge system is a shared key system, the authentication process includes 4-step authentication. The association process between the wireless device and the bridged device is an interactive process of the association request (Association Request) and the association response (Association Response) based on the IEEE 802.11 protocol.
[0058] When a wireless device is associated with a bridged device, it generates a virtual Layer 2 broadcast message. The Layer 2 broadcast message can be any type of data link layer broadcast message. A Layer 2 broadcast message is a Layer 2 message whose destination MAC address is composed entirely of FFs, i.e., the destination MAC address is FF:FF:FF:FF:FF. A Layer 2 broadcast message can be broadcast in a Layer 2 (data link layer) network, i.e., it can be broadcast within the local area network and will not be transmitted across network segments.
[0059] The layer 2 broadcast message includes a destination MAC address, a source MAC address, a message type, and a requested Internet Protocol (IP) address, i.e., the IP address of the bridged device. The destination MAC address of the layer 2 broadcast message is a broadcast MAC address composed entirely of FFs. The source MAC address of the layer 2 broadcast message is a virtual MAC address, and the source MAC address is different from the MAC address of the wireless device that generates the layer 2 broadcast message. The source MAC address is different from the MAC address of the wireless device (i.e., the wireless device that generates the layer 2 broadcast message), and the layer 2 broadcast message can be subsequently broadcast and sent in a four-address format, so that the subsequent bridged device can establish a four-address entry of the source MAC address based on the layer 2 broadcast message.
[0060] In addition, the source MAC address is a local MAC address in a non-multicast form, that is, the source MAC address is a non-Multicast LocalMAC address, that is, the source MAC address is a unicast LocalMAC address. Among them, the source MAC address is a Local MAC address, which can avoid MAC address conflicts between the source MAC address and other wireless devices (such as Global MAC devices) in the entire wireless network. Since the multicast MAC address cannot be used as the source MAC address of a legitimate terminal device, and the source MAC address is set to a non-multicast MAC address, it can simulate the MAC address of a legitimate terminal device under the backend device, thereby improving the accuracy of the Layer 2 broadcast message.
[0061] S20: Broadcasting and sending the layer 2 broadcast message in a four-address format, and determining whether the layer 2 broadcast message broadcast by the bridge device is received.
[0062] After generating the Layer 2 broadcast message, the wireless device broadcasts the Layer 2 broadcast message in a four-address format, that is, converts the Layer 2 broadcast message into a Layer 2 broadcast message in a four-address format, sends the Layer 2 broadcast message in the four-address format to the bridged device by broadcasting, and determines in real time whether the Layer 2 broadcast message broadcast by the bridged device is received.
[0063] Among them, the four-address format of the wireless data frame includes the MAC address of the transmitter (TA), the MAC address of the receiver (RA), the destination MAC address (DA), and the source MAC address (SA); and the three-address format of the wireless data frame lacks a destination MAC address compared with the four-address format. In the two-layer broadcast message of the four-address format, TA is the MAC address of the wireless device (i.e., the backend device) that generates the two-layer broadcast message; RA is the MAC address of the receiving device; SA is the virtual source MAC address in the two-layer broadcast message; DA is the destination MAC address in the two-layer broadcast message, that is, the broadcast MAC address composed entirely of FFs.
[0064] S30: If a layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridge mode with the bridged device is set to the four-address mode.
[0065] It should be understood that after the wireless device broadcasts a Layer 2 broadcast message in a four-address format, if the bridged device supports the four-address format, it will receive the Layer 2 broadcast message in the four-address format broadcast by the wireless device, and because the destination MAC address of the Layer 2 broadcast message is all FFs, the bridged device will broadcast the Layer 2 broadcast message in a three-address format to the Basic Service Set (BSS) of the wireless LAN, and broadcast the Layer 2 broadcast message to other wireless devices through the BSS, so that the wireless devices in the same BSS can receive the Layer 2 broadcast message in the three-address format broadcast by the bridged device.
[0066] Therefore, after the wireless device broadcasts a layer 2 broadcast message in a four-address format, if the wireless device receives the layer 2 broadcast message broadcast by the bridged device, it is determined that the bridged device supports the four-address format, and the bridging mode with the bridged device is set to the four-address mode, that is, the address format for communication between the wireless device and the bridged device is set to the four-address format, that is, the wireless device subsequently communicates with the bridged device in the four-address format.
[0067] S40: If the layer 2 broadcast message broadcast by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridge mode with the bridged device is set to the three-address mode.
[0068] After the wireless device broadcasts the Layer 2 broadcast message in the four-address format, if the bridged device does not support the four-address format, the bridged device cannot receive the Layer 2 broadcast message in the four-address format broadcasted by the wireless device, and the wireless device cannot receive the Layer 2 broadcast message broadcasted by the bridged device subsequently. If the Layer 2 broadcast message broadcasted by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridged device supports the three-address format, and the bridge mode with the bridged device is set to the three-address mode, that is, the address format for the wireless device to communicate with the bridged device is set to the three-address format, that is, the wireless device communicates with the bridged device in the three-address format subsequently.
[0069] In this embodiment, when the wireless device is associated with the bridged device, the wireless device generates a virtual layer-2 broadcast message, and then the wireless device broadcasts the layer-2 broadcast message in a four-address format, and determines whether the layer-2 broadcast message broadcast by the bridged device is received; if the layer-2 broadcast message broadcast by the bridged device is received, the wireless device determines that the bridged device supports the four-address format, and sets the bridging mode with the bridged device to the four-address mode, that is, communicates with the bridged device in the four-address format; if the layer-2 broadcast message broadcast by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridging mode with the bridged device is set to the three-address mode, that is, communicates with the bridged device in the three-address format. By setting up a layer 2 broadcast message to detect the address of the bridged device, and monitoring the broadcast of the layer 2 broadcast message by the bridged device, and cleverly utilizing the forwarding mechanism of the layer 2 broadcast message in the wireless network, it is possible to accurately and quickly determine whether the bridged device supports the four-address format, thereby setting a suitable bridging method to perform wireless bridging with the bridged device, which can ensure normal communication between the two and improve the wireless bridging effect between the wireless device and the bridged device. At the same time, since the layer 2 broadcast message belongs to the data link layer like the address format, the use of the layer 2 broadcast message for address detection only requires one layer 2 broadcast message interaction, and only requires message transmission processing at the data link layer, which can reduce the message transmission time, thereby increasing the address detection speed and improving the wireless bridging efficiency. In addition, the layer 2 broadcast message at the data link layer performs address detection, and the functional logic of the data link layer is complete and closed-loop, without crossing the network layer, and there is no dependency relationship with other layers, which reduces or even avoids the coupling between layers and reduces the security risk of the wireless network.
[0070] In one embodiment, the layer 2 broadcast message is a forged (virtual) Address Resolution Protocol (ARP) request message, that is, the layer 2 broadcast message is an ARP Request message. In this embodiment, address detection is performed using the ARP Request message, and the address detection work can be achieved quickly and accurately without affecting normal network communication.
[0071] The ARP Request message includes:
[0072] Destination MAC address: a broadcast MAC address consisting entirely of FFs;
[0073] Source MAC address: any LocalMAC address (can be a virtual MAC address) that is different from the MAC address of the wireless device that generates the ARP Request message and is not multicast.
[0074] Requested IP address: The IP address of any device.
[0075] Message type: ARP, 0x0806.
[0076] Among them, the source MAC address is different from the MAC address of the wireless device (i.e., the wireless device that generates the Layer 2 broadcast message). Only then can the Layer 2 broadcast message be broadcasted in a four-address format, so that the subsequent bridged device can establish a four-address entry of the source MAC address based on the Layer 2 broadcast message. The source MAC address is a Local MAC address, which can avoid MAC address conflicts between the source MAC address and other wireless devices (such as Global MAC devices) in the entire wireless network. Since the multicast MAC address cannot be used as the source MAC address of a legitimate terminal device, and the source MAC address is set to a non-multicast MAC address, it can simulate the MAC address of a legitimate terminal device under the back-end device, thereby improving the accuracy of the Layer 2 broadcast message.
[0077] In one embodiment, if Figure 3 As shown, in step S20, the layer 2 broadcast message is broadcasted in a four-address format, and it is determined whether the layer 2 broadcast message broadcasted by the bridge device is received, which specifically includes the following steps:
[0078] S21: Broadcasting the layer 2 broadcast message in a four-address format for a preset number of times at a preset frequency, and timing after stopping the broadcasting.
[0079] S22: Determine within a preset timing period whether a layer 2 broadcast message broadcast by the bridged device through the basic service set is received.
[0080] After generating a virtual layer 2 broadcast message, the wireless network needs to continuously broadcast the layer 2 broadcast message in a four-address format at a preset frequency for a preset number of times to ensure that the bridged device that supports the four-address format can receive the layer 2 broadcast message in the four-address format, and perform timing after stopping the broadcast transmission. While broadcasting the layer 2 broadcast message in the four-address format, broadcast message monitoring is performed, and it is determined within the preset timing duration whether the layer 2 broadcast message broadcast by the bridged device through the basic service set is received. If the layer 2 broadcast message broadcast by the bridged device through the basic service set is received within the preset timing duration, it is determined that the bridged device supports the four-address format, and the bridging mode with the bridged device is set to the four-address mode. If the layer 2 broadcast message broadcast by the bridged device through the basic service set is not received within the preset timing duration, it is determined that the bridged device supports the three-address format, and the bridging mode with the bridged device is set to the three-address mode.
[0081] For example, the layer 2 broadcast message is an ARP Request message, and the preset timing duration is 30ms. When the wireless device is associated with the bridged device, the wireless device generates an ARP Request message in a four-address format, that is, an ARP Request message including four address information of TA, RA, SA and DA; then, the wireless device continuously broadcasts and sends the ARP Request message in the four-address format at a preset frequency (such as every 1ms) until the number of transmissions reaches a preset number (such as 3 times), and then stops broadcasting it, thereby reducing the possibility of transmission failure due to unreliable wireless network transmission and ensuring successful broadcast transmission. After broadcasting the ARP Request message in the four-address format, the wireless device needs to time and determine within 30ms whether the ARP Request message broadcast by the bridged device through the BBS is received. If the ARP Request message broadcast by the bridged device through the basic service set is received within 30ms, it is determined that the bridged device supports the four-address format, and the bridge mode with the bridged device is set to the four-address mode. Otherwise, it is determined that the bridged device does not support the four-address format, and the bridge mode with the bridged device is set to the three-address mode.
[0082] Among them, the round-trip message interaction time at a rate of 1Mbps in the 2G frequency band is about 7ms. Here, a period greater than 4 times the round-trip message interaction time is taken as the preset timing period to ensure that the wireless device can normally receive the message feedback from the bridged device that supports the four-address format, reduce the message leakage caused by the unreliability of the wireless network, and improve the accuracy of address detection.
[0083] In this embodiment, the preset number of times is 3 times, the preset frequency is 1ms, and the preset timing duration is 30ms. This is only for exemplary description. In other embodiments, the preset number of times, the preset frequency, and the preset timing duration can also be other values, which will not be repeated here.
[0084] In this embodiment, a layer 2 broadcast message is continuously broadcasted and sent for a preset number of times at a preset frequency in a four-address format, and timing is performed after the broadcasting is stopped, and it is determined within the preset timing duration whether the layer 2 broadcast message broadcasted by the bridged device through the basic service set is received, and the steps of broadcasting and receiving the layer 2 broadcast message are refined. A layer 2 broadcast message in a four-address format is continuously broadcasted and sent for a preset number of times at a preset frequency, and it is determined within the preset timing duration whether feedback from the bridged device is received, which reduces the missed reception of messages caused by the unreliability of the wireless network and improves the accuracy of address detection.
[0085] In one embodiment, after the wireless device (backend device) is associated with the bridged device, the bridged wireless device (i.e., the backend device) is not allowed to switch channels within a preset time, nor is the wireless device allowed to scan other channels, that is, the wireless device is prohibited from switching channels and scanning other channels within the preset time, so as to ensure that the wireless device can receive the layer 2 broadcast message broadcasted by the bridged device and will not miss the feedback message of the bridged device due to its own channel switching. The preset time is greater than the preset timing time.
[0086] In one embodiment, if Figure 4 As shown, in step S20, it is determined whether a layer 2 broadcast message broadcast by the bridge device is received, which specifically includes the following steps:
[0087] S201: When a layer 2 broadcast message broadcasted by a bridge device is received, compare the contents of the received layer 2 broadcast message with the contents of the sent layer 2 broadcast message to see whether they are consistent.
[0088] S202: If the content of the received layer 2 broadcast message is consistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridged device is received.
[0089] S203: If the content of the received layer 2 broadcast message is inconsistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridged device is not received.
[0090] After broadcasting the Layer 2 broadcast message in the four-address format, the wireless device determines whether the Layer 2 broadcast message broadcast by the bridged device is received within the preset timing duration. When the Layer 2 broadcast message broadcast by the bridged device is received within the preset timing duration, the received Layer 2 broadcast message is compared with the content of the Layer 2 broadcast message sent by itself to see if it is consistent. Among them, when comparing whether the content of the received Layer 2 broadcast message is consistent with the content of the Layer 2 broadcast message sent by itself, it is necessary to compare the Layer 2 broadcast message sent by itself with the Layer 2 broadcast message from the bridged device byte by byte to ensure that the message content is completely consistent to avoid misjudgment.
[0091] If it is determined that the content of the layer 2 broadcast message from the bridged device is consistent with the content of the layer 2 broadcast message generated and sent by the wireless device, it is determined that the layer 2 broadcast message broadcast by the bridged device is received. If it is determined that the content of the layer 2 broadcast message from the bridged device is inconsistent with the content of the layer 2 broadcast message generated and sent by the wireless device, it is determined that the layer 2 broadcast message broadcast by the bridged device is not received.
[0092] In this embodiment, when a Layer 2 broadcast message broadcast by a bridged device is received within a preset timing period, the contents of the received Layer 2 broadcast message are compared with those of the sent Layer 2 broadcast message to see if they are consistent. If the contents of the received Layer 2 broadcast message are consistent with those of the sent Layer 2 broadcast message, it is determined that the Layer 2 broadcast message broadcast by the bridged device is received. The steps for determining whether a Layer 2 broadcast message broadcast by a bridged device is received are clarified. By comparing the contents of the two Layer 2 broadcast messages, it is determined that the Layer 2 broadcast message broadcast by the bridged device is received only when it is determined that the contents of the two Layer 2 broadcast messages are consistent, thereby reducing the risk of misjudgment and improving the accuracy of address detection.
[0093] In one embodiment, if Figure 5 As shown, before step S10, that is, before broadcasting the layer 2 broadcast message in the four-address format, the method further includes the following steps:
[0094] S01: When it is detected that the bridged device is an encryption device, a key verification is performed on the bridged device;
[0095] S02: After the key verification is passed, the layer 2 broadcast message is broadcasted in a four-address format.
[0096] Before generating and broadcasting a Layer 2 broadcast message, it is necessary to determine whether the bridged device is an encryption device. When it is detected that the bridged device is an encryption device, it is necessary to perform key verification on the bridged device and the connected network. After the key verification passes, the Layer 2 broadcast message is broadcast in a four-address format.
[0097] Among them, if the bridged device is set with a password, that is, the bridged device is an encryption device, the wireless device needs to perform a key verification process according to the encryption method of the bridged device before broadcasting the second-layer broadcast message. After the key verification passes, that is, the shared key is correct, the second-layer broadcast message can be broadcast in a four-address format to ensure communication security.
[0098] The encryption method may be based on Wi-Fi Protected Access (WPA), WPA2 or WPA3. For example, when the encryption method of the bridged device is WPA2-Pre-Shared Key (PSK) encryption, the wireless device and the bridged device need to perform a four-way handshake based on Extensible Authentication Protocol Over LAN (EAPOL) to confirm the correctness of the password of the bridged device.
[0099] In this embodiment, before generating a layer 2 broadcast message, it is necessary to determine whether the bridged device is an encryption device. When it is detected that the bridged device is an encryption device, a key verification is performed on the bridged device. After the key verification passes, the layer 2 broadcast message is broadcast and sent in a four-address format to ensure communication security.
[0100] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0101] In one embodiment, a wireless device is provided, which corresponds one-to-one to the wireless device bridging method in the above embodiment. Figure 6 As shown, the wireless device includes a generating module 601, a sending module 602, a determining module 603 and a setting module 604. The functional modules are described in detail as follows:
[0102] A generating module 601, configured to generate a virtual layer 2 broadcast message when the wireless device is associated with the bridged device;
[0103] The sending module 602 is used to broadcast the layer 2 broadcast message in a four-address format;
[0104] Determining module 603, determining whether a layer 2 broadcast message broadcasted by the bridge device is received;
[0105] The setting module 604 is used to determine whether the bridged device supports the four-address format if a layer 2 broadcast message broadcast by the bridged device is received, and set the bridge mode with the bridged device to the four-address mode.
[0106] Optionally, after determining whether a layer 2 broadcast message broadcast by the bridge device is received, the setting module 604 is further configured to:
[0107] If the layer 2 broadcast message broadcast by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridge mode with the bridged device is set to the three-address mode.
[0108] Optionally, the sending module 602 is specifically configured to:
[0109] The layer 2 broadcast message is continuously broadcasted in a four-address format at a preset frequency for a preset number of times, and timing is performed after the broadcasting is stopped;
[0110] Determine within a preset timing period whether a layer 2 broadcast message broadcast by the bridged device through the basic service set is received.
[0111] Optionally, the determination module 603 is specifically configured to:
[0112] When receiving a layer 2 broadcast message broadcasted by a bridged device, compare the contents of the received layer 2 broadcast message with the contents of the sent layer 2 broadcast message to see if they are consistent;
[0113] If the content of the received layer 2 broadcast message is consistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridged device is received;
[0114] If the content of the received layer 2 broadcast message is inconsistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridge device is not received.
[0115] Optionally, the wireless device further includes a verification module 605, and before broadcasting the layer 2 broadcast message in the four-address format, the verification module 605 is used to:
[0116] When it is detected that the bridged device is an encryption device, a key verification is performed on the bridged device, and after the key verification passes, a layer 2 broadcast message is broadcasted in a four-address format.
[0117] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0118] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0119] The present application also provides a wireless device, such as Figure 7As shown, the wireless device 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, wherein the processor 20 implements the steps in any of the above-mentioned method embodiments when executing the computer program 22, or implements the functions of each module / unit in the above-mentioned device embodiments when executing the computer program 22.
[0120] Exemplarily, the computer program 22 may be divided into one or more modules / units, which are stored in the memory 21 and executed by the processor 20 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 22 in the wireless device 2.
[0121] Those skilled in the art will understand that Figure 7 It is only an example of the wireless device 2 and does not constitute a limitation of the wireless device 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the wireless device may also include input and output devices, network access devices, buses, etc.
[0122] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0123] The memory 21 may be an internal storage unit of the wireless device 2, such as a hard disk or memory of the wireless device 2. The memory 21 may also be an external storage device of the wireless device 2, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the wireless device 2. Further, the memory 21 may also include both an internal storage unit of the wireless device 2 and an external storage device.
[0124] An embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0125] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0127] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0129] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0131] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A wireless device bridging method, characterized in that: include: When a wireless device associates with a bridged device, a virtual layer 2 broadcast message is generated; Broadcasting the layer 2 broadcast message in a four-address format, and determining whether the layer 2 broadcast message broadcast by the bridged device is received; If the layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridging mode with the bridged device is set to the four-address mode.
2. The wireless device bridging method according to claim 1, wherein: After determining whether the layer 2 broadcast message broadcast by the bridged device is received, the method further includes: If the layer 2 broadcast message broadcasted by the bridged device is not received, it is determined that the bridged device does not support the four-address format, and the bridging mode with the bridged device is set to the three-address mode.
3. The wireless device bridging method according to claim 1, wherein: The step of broadcasting the layer 2 broadcast message in a four-address format and determining whether the layer 2 broadcast message broadcast by the bridged device is received includes: Continuously broadcasting the layer 2 broadcast message in the four-address format at a preset frequency for a preset number of times, and timing after stopping the broadcasting and sending; Determine within a preset timing duration whether the layer 2 broadcast message broadcast by the bridged device through the basic service set is received.
4. The wireless device bridging method according to claim 1, wherein: The determining whether the layer 2 broadcast message broadcast by the bridged device is received includes: When receiving the layer 2 broadcast message broadcasted by the bridged device, comparing the received layer 2 broadcast message with the sent layer 2 broadcast message to see whether the content is consistent; If the content of the received layer 2 broadcast message is consistent with the content of the sent layer 2 broadcast message, it is determined that the layer 2 broadcast message broadcast by the bridged device is received; If the content of the received layer-2 broadcast message is inconsistent with the content of the sent layer-2 broadcast message, it is determined that the layer-2 broadcast message broadcast by the bridged device is not received.
5. The wireless device bridging method according to any one of claims 1 to 4, characterized in that: The layer 2 broadcast message is an address resolution protocol request ARP Request message.
6. The wireless device bridging method according to any one of claims 1 to 4, characterized in that: Before broadcasting the layer-2 broadcast message in a four-address format, the method further includes: When it is detected that the bridged device is an encryption device, a key verification is performed on the bridged device, and after the key verification passes, the layer 2 broadcast message is broadcast and sent in the four-address format.
7. A wireless device, characterized in that: include: A generating module, used for generating a virtual layer 2 broadcast message when the wireless device is associated with the bridged device; A sending module, used for broadcasting the layer 2 broadcast message in a four-address format; A determination module, used to determine whether the layer 2 broadcast message broadcast by the bridged device is received; The setting module is used for determining that the bridged device supports the four-address format if the layer-2 broadcast message broadcasted by the bridged device is received, and setting the bridge mode of the bridged device to the four-address mode.
8. A wireless device bridging system, characterized in that: The invention comprises a wireless device and at least one bridged device, wherein the wireless device is used for: When the wireless device is associated with the bridged device, generating a virtual layer 2 broadcast message; Broadcasting the layer 2 broadcast message in a four-address format, and determining whether the layer 2 broadcast message broadcast by the bridged device is received; If the layer 2 broadcast message broadcast by the bridged device is received, it is determined that the bridged device supports the four-address format, and the bridging mode with the bridged device is set to the four-address mode.
9. A wireless device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the wireless device bridging method according to any one of claims 1 to 6 are implemented.
10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the wireless device bridging method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Wireless bridge data packet format adaptive control method, device and system
CN120582749A
