| CPC H04W 40/24 (2013.01) [H04W 24/04 (2013.01); H04W 84/12 (2013.01); H04W 84/18 (2013.01)] | 11 Claims |

|
1. A loop detection method applicable to a mesh network including a plurality of links among a plurality of devices, the loop detection method including:
exchanging a topology maintenance message between the devices;
creating a neighbor graph based on the topology maintenance message, wherein the neighbor graph represents a network structure of the mesh network;
traversing the neighbor graph; and
detecting whether there is a loop existing in the mesh network according to a result from traversing the neighbor graph;
wherein the loop is formed by at least three devices of the plurality of devices, and each two of the at least three devices have a link of the plurality of links;
wherein the traversing the neighbor graph further comprises:
selecting a current device from the plurality of devices; and
for other devices in the plurality of devices, enumerating all reachable paths from the current device to the other devices by a graph path finding algorithm;
wherein the graph path finding algorithm is a graph depth-first search algorithm, which uses a stack structure to record accessed device nodes in the other devices;
wherein the detecting whether there is the loop existing in the mesh network according to the result from traversing the neighbor graph comprises:
if a quantity of the plurality of devices recorded in a stack state of the stack structure is greater than 2 and if a stack top device recorded in the stack structure is a neighbor of a stack bottom device recorded in the stack structure, determining an existence of the loop and determining paths of the loop according to the stack state.
|