Investigates the NetMagic network experiment platform, and proposes a network topology discovery algorithm based on NetMagic. Describes the principle of network topology discovery algorithm defines the encapsulation format of detection and response packets in an Ethernet frame, and simulates the algorithm in the cases of simple topology and complex topology. The simulated result verifies the logic feasibility and effectiveness of the algorithm.