基于SNMP和ICMP的网络拓扑发现算法采用主动探测手段,在获取拓扑信息时会注入额外的网络流量,易造成实时性较差、网络性能受影响等问题,因此,提出了一种基于OSPF协议的网络拓扑发现算法。该算法采用被动监测方式,通过Jpcap捕获OSPF协议中的链路状态更新报文,分析其中的RouterLSA和NetworkLSA,获得路由器之间的链路类型等网络拓扑信息,进而在不影响网络性能的前提下发现拓扑结构。实验结果表明,该算法能够快速准确地获得完整的网络拓扑结构。
Aimed at the shortages of existing network topology discovery methods based on SNMP and ICMP which are active detection methods and the extra network traffic will be injected when obtaining the topology information, easily lead to poor real-time and increasing the network load, a discovery algorithm for network topology based on OSPF is proposed. The algorithm applies the way of passive monitoring to obtain the link state update (LSU) packet of OSPF protocol through Jpcap, and analyzes the topology information which can obtain the link type between routers contained in the Router LSA and Network LSA. Experimental result illustrates that the proposed algorithm can quickly and accurately obtain complete network topology.