|
|
Distance vector message sent by some node N: To Distance ----+---------- A 4 (meaning: distance(N, A) = 4 B * (meaning: distance(N, B) = infinite) .. .. .. .. |
Example:
|
|
Comment:
|
|
From: NNode Distance vector message: Dest | Distance --------+------------- A | dA B | dB ... | ... |
Visual help: distance vector message /* --------------------------------------------- Update distances to "Dest" going "Via NNode" --------------------------------------------- */ for ( each entry (Dest, Dist) in the distance vector message ) do { Distance table: Dest | Via X ... Via NNode ... Via Y -------+------------------------------------ A | ... ... d(Me,NNode) + dA ... ... B | ... ... d(Me,NNode) + dB ... ... ....... Visual help: } /* ----------------------------------------------------- Find updated min. distance to "Dest" after an update ----------------------------------------------------- */ for ( each entry (Dest, Dist) in the distance vector message ) do { d(Me, Dest) = minall NNode x ( Via x | d(myself, Dest) ); Visual help: /* ----------------------------------------------------- Propagate a change to your neighbors ---------------------------------------------------- */ if ( d(Me, Dest) has changed ) { Schedule update message "Me, ToNode, d(myself, Dest)" Visual help: } } |
|