// Initialization:
// NodeArray[N], except node x;
for (int i = 0; i < N; ++i)
{
y = NodeArray[i];
if (/*y is a neighbor of x*/)
{
Dx(y) = c(x, y);
}
else
{
Dx(y) = 1000000;
}
// for each neighbor w
// 1. Dw(y) = 1000000;
// 2. send distance vector Dx = [Dx(y): y in N] to w;
}
while (1)
{
wait(// 1.until I see a link cost change to some neighbor w or
// 2.until I recevie a distance vector form some neighbor w
);
// for each y in N
Dx(y) = min v(c(x, v) + Dv(y));
// if Dx(y) changed for any destination y
//send distance vector Dx to all neighbors
}
网络DV算法概述
最新推荐文章于 2021-07-27 14:57:01 发布