CHAPTER 3 PROPOSED SCHEME
3.3 Topology-based Automatic Configuration Algorithm
In our algorithm, we need one anchor as a start-point to do the serialization. The anchor refers to the additional device which has prior knowledge of its location. We will introduce the importance of the anchor and how to determine the location of the anchor in Section 3.5. Here we use an example to introduce our algorithm step by step first, and then summary each step of the algorithm in the end.
The algorithm has two steps: 1) serialization of the location set and 2) serialization of the device set. We start from the location set. Figure 11 is the initial step of the serialization. The red circle with number 0 is the location of the anchor, and green circles are the other known locations. We assign the sequence number 0 to the location of the anchor.
Figure 11: Serialization of the location set - Initialization
Next, we want to find the owner of sequence number 1. We choose the location which is closest to the anchor and does not have the sequence number. Here is
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 24
no ambiguity and we assign the sequence number 1 to that location, as shown in Figure 12. The ambiguity refers that there are more than two closest locations with the same distance.
Figure 12: Serialization of the location set - Find sequence number 1
Now we want to find the owner of sequence number 2, but in Figure 13 we can see that there are two closest locations (red circles without numbers). In this situation, the current location will ask the previous location to choose the closest location from it. That is, in Figure 13, the location with sequence number 1 ask the location with sequence number 0 to choose the closest location. The dotted line shows which the location with sequence number 0 chooses. When a location find that there exists ambiguity, we record the sequence number and how many ambiguous locations, as shown on the right-hand side of Figure 13.
We can use the same procedure to find the owner of sequence number 3. The location of sequence number 2 encounter two closest locations, so it asks the previous location (sequence number 1) to determine the next one, as shown in Figure 14.
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 25
Figure 13: Serialization of the location set - Find sequence number 2
Figure 14: Serialization of the location set - Find sequence number 3
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 26
We have already serialized the location set from sequence number 0 to 3, and now we want to find the location of sequence number 4. The current location is the location with sequence number 3, and it finds that here are three ambiguous locations, as shown in Figure 15. We record the ambiguous information on the right-hand side of Figure 15. According to our algorithm, the current location must ask the previous location which has sequence number 2 to determine the location of sequence number 4.
However, the location with sequence number 2 also encounters ambiguous locations, as shown in Figure 16. We also record the ambiguous information and recursively ask the previous location which has sequence number 1. Finally, the location with sequence number 1 can find the next location and the direction of the dotted arrow is the found location.
There are no ambiguities with sequence 5 to 9, and the procedure is almost the same as what we did from sequence number 0 to 1. We just find the closest locations one by one and the serialization of the location set is done, as shown in Figure 17.
Figure 15: Serialization of the location set - Find sequence number 4 (part1)
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 27
Figure 16: Serialization of the location set - Find sequence number 4 (part2)
Figure 17: Serialization of the location set - Find all sequence numbers
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 28
After we serialize the location set, we get the sequence numbers of all locations and an “ambiguity list”. The ambiguity list refers to the list which records how many ambiguity locations when each location wants to determine the owner of the next sequence number. We simplify the ambiguity list as shown in Figure 18. The column of closest numbers means that when we want to find the sequence number n+1 from n, how many closest locations the sequence number n will encounter. The ambiguity list can guide the serialization of devices, and the device with the corresponding sequence number can know what it should do.
Figure 18: Simplified ambiguity list
Now we want to serialize the device set. We also start the serialization from the anchor device. As we mentioned in Section 3.2, RSSI is the only thing we can use to serialize the device set. We “repeat” the same process as what we did with the location set, but here we choose the device with the maximum received RSSI as the owner of the next sequence number. The following is the step-by-step example of serialization of device set.
The red icon with number 0 is the location of the anchor, and green icons are the other known devices. We assign the sequence number 0 to the anchor device for
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 29
initialization, as shown in Figure 19.
Figure 19: Serialization of the device set - Initialization
The next step is to find the owner of sequence number 1. First, we check the ambiguity list and find that we only need to find one “closest” device from sequence number 0 to 1, as shown on the right-hand side of Figure 20. The device with sequence number 0 now receive all packets from the other devices and assign sequence number 1 to the device with the maximum RSSI. In Figure 20, the red arrow refers to the packet with the maximum RSSI.
Now we want to find sequence number 2 from 1. We check the ambiguity list and find that we need to find two closest devices from sequence number 1 to 2, as shown on the right-hand side of Figure 21. Then we “repeat” what we did with the location set: the device with sequence number 1 ask the device with sequence number 0 to decide which one is closer, as shown in Figure 22. Finally the device with sequence number 0 choose the device with the red arrow as the owner of sequence number 2.
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 30
Figure 20: Serialization of the device set - Find sequence number 1
Figure 21: Serialization of the device set - Find sequence number 2 (part1)
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 31
Figure 22: Serialization of the device set - Find sequence number 2 (part2)
We skip the process of finding sequence number 3 from 2 because it is almost the same as finding sequence number 2 from 1. Now we want to find sequence number 4 from 3, and we check the ambiguity list first. We can see that the device with sequence number 3 needs to find 3 closest devices, as shown in the right hand side of Figure 23.
The device with sequence number 3 receive packets from the other devices which do not have sequence numbers, and then ask the previous devices to determine the three devices which have larger RSSIs. Before the previous devices (with sequence number 2) choose closest devices, it should check the ambiguity first. It found that it should choose the closest two of three devices, as shown in Figure 24. Thus, the device with sequence number 2 receive packets of that three devices and choose two devices with larger RSSIs. The device with sequence number 2 still cannot determine the closest device, so it should also ask the previous device. The ambiguity list shows that the previous device only needs to find the device with largest RSSI, so the device with sequence number 1 choose the device with the largest RSSI as the owner of sequence number 4, as shown in Figure 25.
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 32
Figure 23: Serialization of the device set - Find sequence number 4 (part1)
Figure 24: Serialization of the device set - Find sequence number 4 (part2)
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 33
Figure 25: Serialization of the device set - Find sequence number 4 (part3)
Figure 26: Serialization of the device set - Find all sequence numbers
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 34
The way to find the other sequence numbers remained is almost the same as finding sequence number 1 from 0, and the final result is in Figure 26. Until now we have serialized the location set and the device set. The device with the maximum RSSI means the closest device in the physical environment, and this is the same as finding the closest location. We can say that we use the same criteria (find the closest location/device) to serialize the two sets and get two correspondent sequences, as shown in Figure 27. The correspondent sequence number means a mapping, and finally, the location configuration is done.
Figure 27: Two correspondent sets
The previous step-by-step example introduced how the topology-based configura-tion algorithm works. It can be used for not only the grid topology but also all other topologies. We summarize the algorithm in the following and discuss the problems remained in the end.
I. Serialization of the Location Set
Step 1. Assign the sequence number 0 to the location of the anchor. Set the current sequence number as 1.
doi:10.6342/NTU201702027 3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 35
Step 2. Choose the location which does not have a sequence number and is closest to the location with the current sequence number.
Step 3. If there are only one closest location, assign the current sequence num-ber to the location. If all devices have a sequence numnum-ber, the algorithm is done. If at least one location has no sequence number, increase the current sequence number by one and go to Step 2.
Step 4. If there are more than two closest locations with the same distance, record in the ambiguity list.
Step 5. Choose the location which does not have a sequence number and is closest to the location with current sequence number-1. If there is only one closest location, go to Step 3. If there are more than two closest locations, go to Step 4.
After the serialization of the location set is done, we can get all sequence number of locations and an ambiguity list. The ambiguity list refers to the list which records how many ambiguity locations when each location wants to determine the owner of the next sequence number.
II. Serialization of the Device Set
Step 1. Assign the sequence number 0 to the anchor device. Set the current sequence number as 1. Set the current device as the anchor.
Step 2. The current device query the ambiguity list with the current sequence number to know how many other devices it should find. Set N as the number of devices it should find. The current device gets RSSIs from other devices which do not have a sequence number and choose N devices with larger RSSIs.
3.3. TOPOLOGY-BASED AUTOMATIC CONFIGURATION ALGORITHM 36
Step 3. If N is equal to 1, assign the current sequence number to the device found by the current device and set the found device as the current device. If all devices have a sequence number, the algorithm is done.
If not, increment the current sequence number by 1 and go to Step 2.
Step 4. If N is greater than 1, set the previous device as the current device and query the ambiguity list with the current sequence number to know how many devices the current device should find from the N devices. Set M as the new number of devices the current device should find. The current device gets RSSIs from the N devices and chooses M devices with larger RSSIs.
Step 5. If M is equal to 1, set N = M and go to Step 3.
Step 6. If M is greater than 1, set N = M and go to Step 4.
The topology-based configuration algorithm is composed of the two serializations above. The two sequences produced from the algorithm represent the one-to-one mappings and the location configuration is done. Each device is located on the location which has the same sequence number of the device.
However, there still exists some problems. First, it is impossible that devices can find the correct mapping all the time because of the fluctuation of RSSIs. It is possible that the RSSI of a closer device is smaller than other further devices in a certain moment. Second, if the anchor cannot determine two locations when we start to serialize the location set, the algorithm failed. How to decide a good location for the anchor is the other problem remained. We will introduce our solutions to solve the problems mentioned above in the following two sections.
doi:10.6342/NTU201702027