Recursive Discovery
Recursive discovery is an algorithm for discovery used by WeConfig that is fundementally relatively simple. It's general workings are descriped as follows:
- Given an initial set of devices
D - For each device
dinD- Attempt to acquire the LLDP, ARP and Route table from
dand collect all addresses present into a listN- For each address
ninN- If the address does not belong to a known device, attempt to scan that address to produce a new device
m. Ifmwas successfully created, addmtoDand continue iterating.
- If the address does not belong to a known device, attempt to scan that address to produce a new device
- For each address
- Attempt to acquire the LLDP, ARP and Route table from
This algorithm, though simple, will allow WeConfig to reach out across different subnets and recursively discover the network topology for as long as it can comprehend the devices it encounters, and has permission to access them.
Example:
Consider an ICMP Ping scan with recursive discovery enabled run on 192.168.1.1 which so happens to be a WeOS device in this example.
Upon successfully scanning 192.168.1.1, WeConfig's current picture of the network might look like this:
Step 1
WeConfig will then inspect its LLDP table (which, for this example, will yield the address 192.168.1.2 as connected on the port Eth 2), its ARP table (which will produce 192.168.1.2 and 192.168.1.3) and its route table (which will indicate it has routes going via the gateway 192.168.1.4).
These addresses will then be collected into a distinct list:
192.168.1.2192.168.1.3192.168.1.4With the duplicate entry of192.168.1.2being removed.
WeConfig will then move to each of these devices and scan them, finding all of them to be another WeOS device, updating the network to:
Step 2
Where the rounded boxes indicate devices whose tables have been inspected.
A similar inspection of each of the new devices various tables yields the following addresses:
192.168.1.1192.168.1.3192.168.1.4192.168.1.5(From192.168.1.2)192.168.1.6(From192.168.1.2)192.168.1.7(From192.168.1.3)192.168.1.8(From192.168.1.4)
Since the three first addresses have already been found elsewhere, they will be ignored, the new ones will be scanned, and their tables checked, resulting in the network:
Step 3
This procedure will then repeat until no new devices are found, with the operation hypothetically looking something like this.
Step 4
Step 5
And so on.