Start with distance-vector:
0 for self,
D for neighbor at distance D.
Every 30 seconds,
For each neighbor,
Send the current distance vector, with entries that pass trough
that neighbor set to 16.
When receiving a distance-vector from a neighbor,
Save the received distance vector.
If any estimated distance, trough this neighbor, has changed,
Update the current vector, but cap at 16.
When 180 seconds has passed since the last message from some neighbor,
Set it's distance to 16.
Send the updated distance vector as above.
Run Code Online (Sandbox Code Playgroud)
180 秒是标准超时值。16 的距离被认为是无穷大。
由于该节点并不立即知道网络中的每个其他节点,因此它无法立即添加所有列。最简单的方法是使用表格:
(Neighbor, Destination, Distance)
Run Code Online (Sandbox Code Playgroud)
当前向量将是每个目的地的最小距离加一。
上面的伪代码实现了Split Horizon和Poisoned Reverse,但没有实现Triggered Updates
阅读更多: