Patent attributes
One embodiment of the present invention provides a system that identifies network switches along a path. During operation, the system receives an address of a source node and an address of a destination node. The system maintains a set of topology information for a network. The system further simulates a data packet originated at the source node and destined for the destination node. During the simulation, the system determines whether a current-hop node performs layer-3, layer-2, or sub-layer-2 switching. The system sends a query to the current-hop node over a separate control channel to determine the status of the current-hop node and discover a next-hop node. The system then receives a reply. The system determines the next-hop node based on the reply and sets the next-hop node as the current-hop node.