OSPF协议中Dijkstra算法的仿真实现  

Simulation Implementation of Dijkstra's Algorithm in OSPF Protocol

在线阅读下载全文

作  者:谢光艺 XIE Guangyi(Intelligent Science and Information Engineering College,Xi'an Peihua University,Xi'an 710125,China)

机构地区:[1]西安培华学院智能科学与信息工程学院,陕西西安710125

出  处:《现代信息科技》2023年第20期96-99,共4页Modern Information Technology

基  金:西安培华学院校改课题重点项目(PHKCSZ202102)。

摘  要:OSPF协议是计算机网络常用的路由协议,它采用了Dijkstra算法。Dijkstra算法在各领域都有广泛的应用,掌握其原理很有必要,因此提出在MATLAB中利用三重循环实现算法的仿真。首先确定代价矩阵,明确起始路由器,并把该路由器放入到S集中。其次采用最外层循环判断是否遍历全部路由器,中间循环遍历S集中的路由器,里层循环遍历U集中的路由器,寻找到每一次外层循环时距起始路由器的代价最小的路由器,并把这个路由器移出U集,并放入到S集中。最后通过回溯方法得到最短路径树。通过仿真实验,不仅能帮助掌握OSPF协议中路由的选择方法,更能加深对Dijkstra算法的理解。OSPF protocol is a commonly used routing protocol in computer network,and it adopts Dijkstra's Algorithm.The Dijkstra's Algorithm has a wide range of applications in variousfields,and it is necessary to master its principle.Therefore,using the triple-loop to realize algorithm simulation is proposed in MATLAB.Firstly,this paper determines the cost matrix,identifies the starting router,and puts the router into the S set.Secondly,the outermost loop is used to determine whether to traverse all the routers,the middle loop traverses the routers in the S set,and the inner loop traverses the routers in the U set tofind the router with the smallest cost from the starting router in each outer loop.It moves this router out of the U set and puts it into the S set.Finally,the shortest path tree can be obtained by the backtracking method.The simulation experiments can not only help master the route selection method in OSPF protocol,but also deepen the understanding of Dijkstra's Algorithm.

关 键 词:OSPF协议 DIJKSTRA算法 三重循环仿真 

分 类 号:TP393.0[自动化与计算机技术—计算机应用技术] TP301[自动化与计算机技术—计算机科学与技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象