Method for determining working channel of wireless access equipment
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a method for determining an operating channel of a wireless access device based on actual communication data conditions.
Background
Over the past decade, 802.11 technology has made significant advances-faster, stronger, and more scalable, but one problem has plagued WiFi: and (6) reliability. Unlike licensed radio spectrum, WiFi is a shared medium, between 2.4GHz and 5GHz, without radio frequency authorization.
When an 802.11 device hears another signal before transmitting data, whether or not the signal is a WiFi signal, it will continue to transmit until the signal disappears. Interference in transmission can also cause data packets to be lost, forcing WiFi retransmission. These retransmissions slow the throughput down, causing significant delays for users sharing the same access point.
The conventional interference detection is to determine the interference degree of the device by detecting the energy of the surrounding W L AN devices, and then make reasonable optimization, but this method is only suitable for the environment where the surrounding W L AN devices use few channels, and almost all channels are used as the devices of W L AN are popularized, and at this time, if the interference is detected by the energy interception method, the usage rate of each channel in the wireless environment cannot be accurately determined (because the number of W L AN devices is large, it is possible that the energy interception of all channels is high), so the conventional interference detection method cannot meet our needs.
Based on the above factors, in practical applications, people need a more effective, faster, and more accurate wireless interference monitoring mechanism.
The name in the Wireless network is W L AN (Wireless L AN), AP (Access Point), AC (Access Controller), STA (Station, client), SSID (Service Set Identifier), BSSID (Basic Service Set Identifier, which is generally equal to the MAC address of a Station), RSSI (Received Signal Strength indicator), TX (Transport), RX (Receive).
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for determining the working channel of the wireless access equipment based on the actual communication data condition, which is convenient, quick, effective, applicable and accurate in measurement.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a method for determining an operating channel of a wireless access device based on actual communication data conditions, comprising the steps of:
(S1) designating an AP and configuring it to a listening mode;
(S2) the AP monitors all air interface signals under the current channel and periodically captures data packets;
(S3) analyzing the captured data packet, extracting and analyzing W L AN equipment information contained in the data packet, wherein the W L AN equipment comprises other APs and STAs working in the current channel, and the W L AN equipment information comprises BSSID, channel, downlink STA number, TX data flow, SSID and RSSI;
(S4) configuring a wireless status detection table, recording the W L AN device information obtained in the step (S3) in the wireless status detection table in a classified manner, and storing the information;
(S5) determining whether the current channel is the best channel satisfying the preset conditions through the W L AN device information recorded by the wireless status detection table, if yes, marking the best channel and executing the step (S8), otherwise executing the step (S6);
(S6) switching the listening channels of the APs of the listening mode and repeating the steps (S2) - (S5) until all channels are listened to;
(S7) screening out a channel with the best current state from all the W L AN device information recorded in the wireless state detection table and marking it as the best channel;
(S8) when an operating channel needs to be selected for the wireless access device, switching the operating channel of the wireless access device to the marked best channel.
Further, the content extracted from the parsed data packet in the step (S3) includes an ethernet header, a management frame, and a data frame; BSSID information is extracted from the Ethernet frame header, so that the source of sending the data packet is distinguished, and the information of the number of the downlink STAs is determined.
And SSID information, channel information and RSSI information of the AP for sending the data packet are extracted from the management frame.
And extracting the size of each data packet sent by the W L AN equipment from the data frame so as to calculate the TX data flow in the current channel.
Specifically, the method of configuring the wireless status detection table in the step (S4) is as follows:
opening up a memory space establishment list;
setting a header of the list according to the extracted parameter items of the W L AN equipment information;
the extracted specific parameters of the W L AN device information are correspondingly recorded item by item in the content part of the list, and the content part corresponding to the BSSID in the list marks the STAs independently working in the current channel.
Specifically, the preset condition of the optimal channel in the step (S5) is
Presetting a judgment threshold value for parameter items of W L AN equipment information participating in judgment, and judging that a current channel is AN optimal channel when specific parameters of the parameter items of the W L AN equipment information are not higher than the judgment threshold value;
the parameter items of the W L AN device information participating in the determination are obtained by corresponding content statistics recorded by the wireless state detection table, and include the number of W L AN devices operating in the same channel, the sum of the number of downlink STAs of all APs in the same channel, the sum of TX data traffic, and the highest RSSI in the same channel.
Preferably, the preset condition of the optimal channel is that the current channel is in
The number b of the working W L AN devices is less than or equal to 5,
and the sum a of the numbers of the downlink STAs of all the APs is less than or equal to 10,
and the total flow A of TX data is less than or equal to 10Kbps,
and the value B of the highest RSSI is less than or equal to-75 dBm.
Further, the step (S7) screens out the best current channel from all the W L AN device information recorded in the wireless status detection table by
Newly configuring a screening table, taking the channel number and the parameter items of the W L AN equipment information participating in the judgment as a longitudinal target and a transverse target of the screening table respectively, and recording data counted by the wireless state detection table in a table corresponding to the intersection of the longitudinal target and the transverse target;
presetting the priority of the parameter item of the W L AN equipment information participating in the judgment;
sequentially rejecting channels exceeding a judgment threshold value preset by corresponding parameter items according to the priority level in sequence until the rejection causes a screening table to be empty,
and selecting the channel with the parameter item closest to the corresponding judgment threshold value from the screening table before the elimination as the channel with the best current state.
Preferably, the preset priority of the parameter item of the W L AN device information participating in the determination is, from high to low, sequentially the number of W L AN devices operating in the same channel, the sum of the numbers of downlink STAs of all APs in the same channel, the sum of TX data traffic, and the highest RSSI in the same channel;
removing the channels with the quantity of the W L AN devices working in the same channel exceeding the preset judgment threshold value from the screening table, if the screening table after the removal is empty, selecting the channel with the quantity of the W L AN devices working in the same channel closest to the preset judgment threshold value from the screening table before the removal as the best channel in the current state, otherwise,
removing the channel of which the sum of the number of the downlink STAs of all the APs in the same channel exceeds the preset judgment threshold value from the screening table, if the screening table after the removal is empty, selecting the channel of which the sum of the number of the downlink STAs of all the APs in the same channel is closest to the preset judgment threshold value from the screening table before the removal as the best channel in the current state, otherwise,
removing the channel with TX data flow sum exceeding the preset judgment threshold from the screening table, if the screening table after removal is empty, selecting the channel with TX data flow sum closest to the preset judgment threshold from the screening table before removal as the best channel in the current state, otherwise,
and selecting the channel with the highest RSSI value closest to the preset judgment threshold value in the same channel as the best channel in the current state.
Compared with the prior art, the invention has the following beneficial effects:
(1) the invention enables the equipment to monitor the air interface signal to obtain the actual communication data condition in each channel, and based on the detection of the actual wireless states, reasonably configures and screens conditions to select the optimal channel from the conditions for the wireless access equipment to work, thus more accurately judging the current interference of each channel under the condition of not changing the states of other equipment and the overall state of the network, greatly improving the effectiveness and reliability of the interference detection result, and being particularly suitable for the interference detection and equipment configuration in a noisy network environment.
(2) According to the invention, through analyzing and extracting the air interface signals, a plurality of items of network state information such as BSSID, the number of downlink STAs, TX data flow, RSSI and the like are obtained through calculation and statistics, so that the identification of the actual communication situation is realized in an all-around manner, the judgment accuracy is high, and a good technical basis and a data basis are provided for determining the optimal channel in the subsequent process.
(3) The invention records, analyzes and counts the information obtained through the form of the wireless state detection table, not only makes the subsequent use and judgment of the data more traceable, but also can visually present the data to the user for checking in a display mode, is very convenient for the user to visually know the current network condition in the actual use of the equipment, and is convenient for network management; and the subsequent configuration of the screening table is mainly used for simplifying the implementation difficulty of the screening process.
(4) The invention adopts the mode of independently detecting and judging each channel to determine the optimal channel, can reduce the flow and time of the whole detection judgment on the whole, reduces the detection time to a certain extent, makes certain contribution to reducing the noise degree of a wireless network environment, and only returns to the original condition under the condition that the optimal channel cannot be independently determined so as to select the selection which is closest to the optimal channel from the whole form record secondarily, thereby embodying the flexibility and the comprehensiveness of the design of the invention.
(5) The invention judges based on the priority sequence in the screening process, can screen the result more quickly, and reflects the rapidity of the invention in practical application from the other side.
Drawings
FIG. 1 is a schematic flow chart of the present invention.
Detailed Description
The present invention is further illustrated by the following figures and examples, which include, but are not limited to, the following examples.
Examples
As shown in fig. 1, the method for determining the operating channel of the wireless access device based on the actual communication data situation is mainly applied to a wireless network environment having a plurality of wireless access points AP, which is generally managed by an access controller AC, and other wireless connection devices, such as STAs, may also exist. When the working channel needs to be determined again for some existing AP in the AP or for the newly added AP, the process of the method of the present invention is executed.
The method specifically comprises the following steps:
(S1) designating an AP and configuring it to a listening mode; the AP may be any different AP in the wireless network environment, or may be configured to listen specifically.
(S2) the AP monitors all air interface signals under the current channel and periodically captures data packets; and after the AP is configured to be in a monitoring mode, actively grabbing the data packet.
(S3) the captured data packet is analyzed, W L AN equipment information contained in the data packet is extracted and analyzed, wherein W L AN equipment comprises other APs and STAs working in a current channel, the W L AN equipment information comprises BSSID, channels, the number of next STAs, TX data flow, SSID and RSSI, concretely, the content extracted from the analyzed data packet comprises AN Ethernet frame header, a management frame and a data frame, then the data part of each frame header and the frame content is analyzed correspondingly, BSSID information is extracted from the Ethernet frame header, whether the source of the transmitted data packet is AP or STA is distinguished, the number information of the next STAs serving as the AP is determined according to the MAC information of the STA equipment related to the BSSID of the AP, the SSID information, the channel information and the RSSI information of the AP for transmitting the data packet are extracted from the Ethernet frame, the size of each data packet transmitted by W L AN equipment is extracted from the data frame, the data packet size is calculated by adding the RSSI information of the data packet in unit time (per second), the RSSI information of the data packet is calculated, and the maximum RSSI value of the data packet in the current time unit is calculated, and the maximum RSSI of the wireless data packet carried in the current data packet, and the RSSI data packet carried in the unit of the wireless data in the unit.
(S4) configuring a wireless status detection table, recording the obtained W L AN device information in the wireless status detection table in a classified manner, and storing the information:
(S4.1) opening up a memory space establishment list;
(S4.2) setting the head of the list according to the extracted parameter items of the W L AN equipment information, wherein the parameter items are the single items of the W L AN equipment information, such as BSSID, channel, downlink STA number, TX data flow, SSID, RSSI and the like.
(S4.3) recording the extracted specific parameters of the W L AN equipment information in the content part of the list in a one-by-one correspondence mode, and marking the STA independently working in the current channel by the content part corresponding to the BSSID in the list, wherein the specific parameters are the specific values of the detected parameter items.
(S5) configuring preset conditions through the W L AN equipment information recorded by the wireless state detection table, and firstly determining 4 points of the W L AN equipment information participating in judgment as parameter items, wherein the parameter items are obtained by counting corresponding contents recorded by the wireless state detection table according to the number of the W L AN equipment working in the same channel, the sum of the numbers of the downlink STAs of all APs in the same channel, the sum of TX data flow, the highest RSSI in the same channel and the like, the number of the W L AN equipment working in the same channel can be obtained by counting and counting the W L AN equipment positioned in the same channel in the wireless state detection table, the number of the downlink STAs of all APs in the same channel is summed to obtain the sum of the numbers, the TX data flow in the same channel is summed to obtain the sum of the sums, and the highest RSSI in the same channel is obtained by comparing the all RSSIs in the same channel;
the method comprises the steps that specific judgment threshold values are preset for parameter items of W L AN equipment information participating in judgment, the setting of the judgment threshold values can be determined according to actual conditions, only 4 setting reasons related to the method are simply introduced, the number of W L AN equipment is taken as a main factor of interference, more W L AN equipment can send out more wireless Beacon packets, the transmission frequency of the Beacon packets is fast and occupies air interface resources of a current channel, more connected STAs are used, data messages sent by terminal equipment under the channel can be increased rapidly, the size of TX data flow indicates the utilization rate of the current channel, the larger the value is, the higher the channel utilization rate is, the larger the interference is, the size of AN RSSI value depends on the transmission power of W L AN equipment, the larger the RSSI is, the larger the power of the current channel interference equipment is, and the more serious the interference is;
and finally, comparing the configured preset conditions with the W L AN equipment information of the current channel, if the actual values of the parameter items of the W L AN equipment information participating in the judgment are not higher than the corresponding judgment threshold values, judging that the current channel is the optimal channel, marking the optimal channel and jumping to the step (S8) for execution, otherwise (namely, any item is higher than the judgment threshold value for the judgment), judging that the current channel is not the optimal channel, and jumping to the step (S6) for execution.
Preferably, the embodiment provides a more general preset condition threshold obtained according to practical statistical analysis, namely, the current in-channel condition
The number b of the working W L AN devices is less than or equal to 5,
and the sum a of the numbers of the downlink STAs of all the APs is less than or equal to 10,
and the total flow A of TX data is less than or equal to 10Kbps,
and the value B of the highest RSSI is less than or equal to-75 dBm.
(S6) switching the listening channels of the AP in the listening mode, and repeating the steps (S2) - (S5) until all channels are listened to.
(S7) screening out the channel with the best current state from all the W L AN equipment information recorded by the wireless state detection table and marking the channel with the best current state as the best channel
(S7.1) newly configuring a screening table, taking the channel number and the parameter items of the W L AN equipment information participating in judgment as a vertical target and a horizontal target of the screening table respectively, and recording data counted by the wireless state detection table in a table corresponding to the intersection of the vertical target and the horizontal target;
(S7.2) presetting a priority of a parameter item of the W L AN device information participating in the decision;
(S7.3) sequentially rejecting channels exceeding a judgment threshold value preset by corresponding parameter items according to the priority order until the rejection leads to the empty screening table,
(S7.4) selecting the channel with the parameter item closest to the corresponding judgment threshold value from the screening table before the elimination as the channel with the best current state.
Preferably, the embodiment provides a more universal priority order obtained according to practical statistical analysis, that is, the priority order is the number of W L AN devices operating in the same channel, the sum of the number of downlink STAs of all APs in the same channel, the sum of TX data traffic, and the highest RSSI in the same channel from high to low, and then when re-determination is made, the order is determined
Removing the channels with the quantity of the W L AN devices working in the same channel exceeding the preset judgment threshold value from the screening table, if the screening table after the removal is empty, selecting the channel with the quantity of the W L AN devices working in the same channel closest to the preset judgment threshold value from the screening table before the removal as the best channel in the current state, otherwise,
removing the channel of which the sum of the number of the downlink STAs of all the APs in the same channel exceeds the preset judgment threshold value from the screening table, if the screening table after the removal is empty, selecting the channel of which the sum of the number of the downlink STAs of all the APs in the same channel is closest to the preset judgment threshold value from the screening table before the removal as the best channel in the current state, otherwise,
removing the channel with TX data flow sum exceeding the preset judgment threshold from the screening table, if the screening table after removal is empty, selecting the channel with TX data flow sum closest to the preset judgment threshold from the screening table before removal as the best channel in the current state, otherwise,
and selecting the channel with the highest RSSI value closest to the preset judgment threshold value in the same channel as the best channel in the current state.
(S8) when an operating channel needs to be selected for the wireless access device, switching the operating channel of the wireless access device to the marked best channel.
In addition, the method of the present invention may be configured to manually start/stop operation in practical application, and then the method of the present invention is started to perform detection and determination when the network administrator considers it to be necessary, or may be configured to be an automatic operation mode, and a detection cycle is set for the method, and a network is detected and determined once in each cycle.
Compared with the traditional detection of channel energy only, the invention can make the most reasonable optimization selection from comprehensive and specific data message statistics, and has positive effect on the overall W L AN network performance of the wireless access equipment.
The above-mentioned embodiments are only preferred embodiments of the present invention, and do not limit the scope of the present invention, but all the modifications made by the principles of the present invention and the non-inventive efforts based on the above-mentioned embodiments shall fall within the scope of the present invention.