Through the analysis of network topology discovery algorithm used ICMP protocol and FDB address, a novel layer topology discovery and link layer topology discovery algorithm which is suitable for campus network environment is proposed based on SNMP protocol. This algorithm can rapidly and accurately calculate the second and third floors topology of the whole pipe network.