IPv 6-NDP-based wireless search automatic networking method
Technical Field
The invention relates to the technical field of automatic networking in a wireless communication network system, in particular to an IPv 6-NDP-based wireless search automatic networking method.
Background
Internet Protocol Version 6 (IPv 6) is the next generation IP Protocol designed by the Internet Engineering Task Force (IETF) to replace IPv 4. Since the biggest problem of the IPv4 is that network address resources are limited, the application and development of the internet are severely restricted. The use of the IPv6 not only solves the problem of the number of network address resources, but also solves the obstacle of connecting various access devices to the Internet. The full expansion of the IPv6 is a great trend, the development of the global IPv6 technology is continuously promoted, and as the IPv4 is depleted, many countries have recognized the advantages brought by the IPv6 technology, and china pushes the next generation of the IPv6 to be fully deployed and be commercialized in a large scale through some country-level projects.
The advantages of IPv6 plug and play can be fully exerted by utilizing a Neighbor Discovery Protocol (NDP), and a high-efficiency, quick and strong-universality wireless network node networking search method based on an IPv6 Protocol framework is provided for low-power consumption, low-speed and lossy networks. In wireless communication, nodes on different channels cannot communicate in principle and do not interfere with each other, but in practice, two adjacent channels are often found to be capable of communicating, but the communication has high error rate and instability and needs to be avoided as much as possible, so that a channel switching algorithm is added on networking channel searching at the same time to avoid unstable networking.
The currently common algorithm is that a leaf node sends a DIS message (DODAG Information Solicitation, DIS) to a root node to request network entry. If receiving DIS message, root node sends DAO message (DODAG Information Object, DIO) response to network access; if the root node does not receive the DIS message, the leaf node continues to send the DIS message until the root node receives the DIS message. And when the root leaf node receives the DAO message response, the root leaf node joins the network. In the algorithm, a leaf node sends a network access application without designing an effective channel switching rule, and adjacent channels are continuously searched, so that the channel is excessively occupied, the communication efficiency is influenced, and the stability and the accuracy of the whole network are not high.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: aiming at the technical problems of low efficiency and poor stability of the existing networking method of IPv6, the method provides an IPv 6-NDP-based wireless search automatic networking method.
The technical scheme adopted by the invention for solving the technical problems is as follows: a wireless search automatic networking method based on IPv6-NDP comprises a wireless search network and a channel switching method.
Further, the wireless search network comprises a root node and a plurality of leaf nodes and a network protocol for communication between the root node and the leaf nodes;
further, the network protocol includes IPv6, NDP; the root node can perform network access and network access management on the leaf nodes.
Further, the channel switching method comprises:
s100, a first leaf node sends an RS message in a first channel and searches the root node;
s200, if the first RA message sent by the root node is not searched, switching to a second channel to continue sending the RS message; the root node responds to the first leaf node search through the first RA message;
s300, if the first RA message sent by the root node is searched, waiting for a second RA message in the first channel; the first leaf node determines the existence of the root node through the second RA message;
s400, if the second RA message is not searched, the first leaf node is switched to the second channel to continue sending the RS message;
s500, if the second RA message is searched, the root node adds the first leaf node into the wireless search network.
Further, the first leaf node switches from the first channel to the second channel with a plurality of channels in between.
Preferably, the number of channels spaced between the first channel and the second channel is greater than 2, and is smaller than any prime number greater than 2 of the total number of channels.
Further, the first RA packet and the second RA packet are data files having the same format and size, and are periodically sent by the root node in different time periods.
Preferably, the first leaf node sends the RS packet 3 times in the first channel interval, and switches to the second channel if the first RA packet is not searched for 3 times.
Further, after the first leaf node searches the second RA packet, the root node allocates a network address.
Further, after the second leaf node is powered on and initialized, automatically searching the root node according to the steps S100-S500, and adding the root node into the wireless search network; and the second leaf node is a node which is not accessed to the network or a newly added node.
Further, the wireless search network further comprises a plurality of wireless routes communicatively connecting the root node with the leaf nodes and between the leaf nodes
Further, the network protocol includes IPv6 and NDP, and the root node is capable of performing network entry and network entry management on the leaf node.
The implementation of one of the technical schemes of the invention has the following advantages or beneficial effects:
(1) convenient to use, save the manual work. When a new leaf node is added into a wireless network or a certain leaf node is replaced, the leaf node can automatically search and access the network after being electrified; if the root node is replaced, other leaf nodes can automatically search the network where the new root node is located.
(2) The stability and the accuracy of the whole wireless search network communication are improved. The channel automatic scanning technology is added with a relevant mechanism, so that the whole wireless network can be ensured to use the same channel, and the communication of modules on different channel communication is avoided, thereby effectively improving the stability and the accuracy of the communication.
(3) The technology is carried out under the IPv6 protocol standard framework, can fully utilize the advantages of IPv6, and is easy to accept and popularize.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
fig. 1 is a flow chart of wireless search automatic networking according to an embodiment of the present invention.
Detailed Description
In order that the objects, aspects and advantages of the present invention will become more apparent, various exemplary embodiments will be described below with reference to the accompanying drawings, which form a part hereof, and in which are shown by way of illustration various exemplary embodiments in which the invention may be practiced, and in which like numerals in different drawings represent the same or similar elements, unless otherwise specified. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. It is to be understood that they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims, and that other embodiments may be used, or structural and functional modifications may be made to the embodiments set forth herein, without departing from the scope and spirit of the present disclosure. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the described features. The term "plurality" means two or more unless specifically limited otherwise.
The following embodiment is merely a specific example and does not indicate such an implementation of the present invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
As shown in fig. 1, an IPv 6-NDP-based wireless search automatic networking method includes a wireless search network and a channel switching method. Specifically, the wireless search network comprises a root node and a plurality of leaf nodes, and a network protocol for communication between the root node and the leaf nodes, wherein the network protocol comprises IPv6 and NDP, and the root node can carry out network access and network access management on the leaf nodes.
Further, the channel switching method comprises the following steps:
s100, a first leaf node sends an RS message (RS) on a first channel, and automatically searches a root node through an automatic channel scanning technology;
s200, if the first RA message (Router Advertisement) sent by the root node is not searched, switching to a second channel to continue sending the RS message; the root node responds to the first leaf node search through the first RA message;
s300, if a first RA message sent by a root node is searched, waiting for a second RA message in a first channel; the first leaf node determines the existence of the root node through the second RA message. The waiting time is determined according to the actual condition of the scale of the wireless search network;
s400, if the second RA message is not searched, the first leaf node is switched to a second channel to continue to send the RS message;
s500, if the second RA message is searched, the root node adds the first leaf node into the wireless search network.
In this embodiment, the first leaf node switches from the first channel to the second channel with a plurality of channels in between. Specifically, the number of channels spaced between the first channel and the second channel is preferably greater than 2, and is smaller than any prime number greater than 2 of the total number of channels. Therefore, the leaf node can search efficiently and accurately, continuous searching of adjacent channels is avoided, a plurality of leaf nodes search on one channel at the same time, and each leaf node channel switching interval randomly extracts one of the values. This avoids continuous searching of adjacent channels and ensures that each channel is not overcrowded. Further, the first RA packet and the second RA packet are data files having the same format and size, and are periodically sent by the root node in different time periods.
Preferably, the first leaf node sends the RS message 3 times in the first channel interval, and switches to the second channel if the first RA message is not searched for 3 times. The time interval for sending the RS message is determined according to the scale of the wireless search network and the channel configuration. And when the first leaf node searches the second RA message, the root node allocates a network address. Thus, the first node successfully accesses the network.
It should be further noted that, after the second leaf node is powered on and initialized, the root node is automatically searched according to the above steps S100 to S500, and a wireless search network is added, where the second leaf node is an un-networked node or a newly added node, and the number of the second leaf node is at least one. And sequentially circulating the steps until all leaf nodes complete networking. And after networking is finished. If the root node is changed, each leaf node automatically searches for a new root node, and the updating is completed according to the steps S100-S500 of the channel switching method.
Further, the wireless search network also includes a plurality of wireless routes communicatively connected between the root node and the leaf nodes and between the leaf nodes.
The specific implementation scheme is as follows: the root node and the leaf node in the wireless network need networking and communication on the same channel, but before networking is finished, the leaf node and the root node are usually not on the same channel, at the moment, in order to search the network where the root node is located, the first leaf node sends an RS message on the first channel for searching the central node, if the RS message is sent discontinuously for 3 times in fixed time, and the first RA message responded by the root node is not searched, the node is switched to the second channel for continuous searching. After the RS message is sent on the first channel, the first RA message responded by the root node is searched, the channel switching is stopped, and the second RA message is waited on the first channel, so that the existence of the root node is confirmed. Because the root node periodically sends the RA message, if the leaf node cannot receive the RA message in the appointed time, the leaf node switches to the second channel to continue searching, and if the leaf node searches the RA message again in the appointed time, the root node adds the RA message into the network. The switching interval of the first channel and the second channel is greater than 2 and smaller than prime number between the total number of the channels (for example, 10 channels are total, and the values meeting the conditions are 3, 5 and 7). Except the first leaf node, other leaf nodes which are not accessed to the network execute the same steps as the first leaf node, and the networking is completed.
In conclusion, the channel switching algorithm is added into the wireless search network based on the IPv6 NDP, so that unstable networking is avoided, the stability and the accuracy of the communication of the whole wireless network are improved, and the method is convenient to use and easy to accept and popularize by the market.
After reading the description herein, it will be apparent to one skilled in the art that various features described herein can be implemented by a method, a data processing system, or a computer program product. Accordingly, these features may be embodied in less than hardware, in all software, or in a combination of hardware and software. Furthermore, the above-described features may also be embodied in the form of a computer program product stored on one or more computer-readable storage media having computer-readable program code segments or instructions embodied in the storage medium. The readable storage medium is configured to store various types of data to support operations at the device. The readable storage medium may be implemented by any type of volatile or non-volatile storage device, or combination thereof. Such as a static disk, a random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), an optical storage device, a magnetic storage device, a flash memory, a magnetic or optical disk, and/or combinations thereof.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof without departing from the spirit and scope of the invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from the essential scope thereof. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed, but that the invention will include all embodiments falling within the scope of the appended claims.