Implementation process of simple topology discovery and its application in the Internet of Things

     In fact, I forgot what I said last time, so this time I will say it again. This time the solution is completely feasible because I have already debugged it. However, I feel that the strength of my own testing is not deep enough, so there may be bugs left. I will organize the code and upload it to github, welcome everyone to discuss together. Gossip less.

    There are many kinds of topology, such as chain, star, ring, ring intersecting ring, ring cutting ring. Which rings should be avoided and why?

    1) The data frame is always forwarded in the ring topology, which increases the burden of bandwidth and CPU, and borrows the network term - broadcast storm.

    2) Similar to 1), the data frame will be forwarded repeatedly, the device will execute repeatedly, and the device will enter an abnormal state.

    3) It is easy to cause the ID in the topology table to be constantly changing and unstable.

    So to put it bluntly, it is how to simplify various topologies into a chain.

The Neighbor Agreement

    Each device will collect the devices directly connected to itself to form a neighbor table. The information recorded in the table mainly includes the neighbor device port and ID corresponding to the device port.

2. Topology Protocol

    After the neighbor agreement is completed, the device starts to build a topology table.

    The device will first add the devices in the neighbor table to the topology table according to its neighbor table;

    Then query the corresponding neighbor devices in turn according to the neighbor table, that is, send the query frame;

    After the neighbor device receives the query frame, it will feed back its neighbor table;

    After the device receives the neighbor table, it checks whether there is a new device (that is, the device not added to the topology table) in the received neighbor table. If there is, add it, otherwise ignore it.

    And so on until all devices on the network are added to the topology table; at this point any shape of the network becomes a chain topology. Relatively speaking, this idea is relatively simple, easy to implement, and can be promoted and used.

 

    It should be useful in the Internet of Things. Now smart home has been applied from theory to practice. Looking at the news all over the sky, it is not difficult to imagine that in the future, a light bulb and a switch in your home will be linked to the network, and the function will definitely be There will be great improvements, such as color control of bulbs, brightness control, timing, voice control or light space, etc. The functions of anything in the home have been brought into full play. How to interconnect and control them. In the morning, I mentioned that the neighbor topology discovery protocol is a relatively good choice.

    It is completely possible to map the entire topology of the home to the network. Each family uses the topology table as a model. By extension, there is a topology relationship between families. In the end, the whole world is actually a super topology table. Farther and farther.

  Welcome to discuss [email protected]  

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325945702&siteId=291194637