计算机网络原理实验八、Link-States-Algorithm的实现.docx
上传者:文档百货
2022-06-13 12:11:02上传
DOCX文件
17 KB
计算机网络原理实验八、Link-States-Algorithm的实现
实验八、Link States Algorithm的实现
序号:姓名:学号:成绩
1.实验目的:
通过编程模拟实现LSA.
2.实验环境:
https://www.sodocs.net/doc/7d1282505.html 软件开发平台,可以使用任何编程语言。
3.实验要求
(1)求网络中任何两个结点之间的最短路径(网络中至少有4个节点)。
(2)得到任何一个节点上的转发表。
4.实验内容、拓扑结构
通过链路状态算法计算A点到其它各点的cost,最终输出A的路由表。
算法提示:
Initialization:
2 N' = {u} /*u is source node*/
3 for all nodes j /* j is dest node*/
4 if j adjacent to u
5 then D(j) = c(u,j)
6 else D(j) = ∞
7
8 Loop
9 find i not in N' such that D(i) is a minimum
10 add i to N'
11 update D(j) for all j adjacent to i and not in N' :
12 D(j) = min( D(j), D(i) + c(i,j) )
13 /* new cost to j is either old cost to j or known
14 shortest path cost to i plus cost from i to j */
15 until all nodes in N'
4.实验分析,回答下列问题
(1)给出LSA算法的主要思想。
答: LSA算法的主要思想为:该算法用迭代算法,其性质是经算法的第K次迭代后,可知道K个目的节点的最低费用路径。
实验八、Link States Algorithm的实现
序号:姓名:学号:成绩
1.实验目的:
通过编程模拟实现LSA.
2.实验环境:
https://www.sodocs.net/doc/7d1282505.html 软件开发平台,可以使用任何编程语言。
3.实验要求
(1)求网络中任何两个结点之间的最短路径(网络中至少有4个节点)。
(2)得到任何一个节点上的转发表。
4.实验内容、拓扑结构
实验八、Link States Algorithm的实现
序号:姓名:学号:成绩
1.实验目的:
通过编程模拟实现LSA.
2.实验环境:
https://www.sodocs.net/doc/7d1282505.html 软件开发平台,可以使用任何编程语言。
3.实验要求
(1)求网络中任何两个结点之间的最短路径(网络中至少有4个节点)。
(2)得到任何一个节点上的转发表。
4.实验内容、拓扑结构
通过链路状态算法计算A点到其它各点的cost,最终输出A的路由表。
算法提示:
Initialization:
2 N' = {u} /*u is source node*/
3 for all nodes j /* j is dest node*/
4 if j adjacent to u
5 then D(j) = c(u,j)
6 else D(j) = ∞
7
8 Loop
9 find i not in N' such that D(i) is a minimum
10 add i to N'
11 update D(j) for all j adjacent to i and not in N' :
12 D(j) = min( D(j), D(i) + c(i,j) )
13 /* new cost to j is either old cost to j or known
14 shortest path cost to i plus cost from i to j */
15 until all nodes in N'
4.实验分析,回答下列问题
(1)给出LSA算法的主要思想。
答: LSA算法的主要思想为:该算法用迭代算法,其性质是经算法的第K次迭代后,可知道K个目的节点的最低费用路径。
实验八、Link States Algorithm的实现
序号:姓名:学号:成绩
1.实验目的:
通过编程模拟实现LSA.
2.实验环境:
https://www.sodocs.net/doc/7d1282505.html 软件开发平台,可以使用任何编程语言。
3.实验要求
(1)求网络中任何两个结点之间的最短路径(网络中至少有4个节点)。
(2)得到任何一个节点上的转发表。
4.实验内容、拓扑结构
计算机网络原理实验八、Link-States-Algorithm的实现