[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about DV routing and link cost?



Hello,

    I would like to see DV routing dynamically alters routes between 
deferent pairs of nodes. In my case, I would not like to 
disable any links. I hope DV rouing can re-compute the routes between 
each pair of nodes after I change the costs of links. It seems there is 
no expected effect appearing. The original routes have been kept.
    I have not understood well the DV routing implementation in ns-2.
What I confused are the instproc "Agent/rtProto/DV instproc compute 
routes" and rtPeer, especially the latter one.
    From the code, it seems, in each node, the number of rtPeers is 
equal to the number of its neighbor nodes and, in each rtPeers, it 
includes an array in which the route information to all the other nodes 
from this neighbor nodes have been recorded. I really hope somebody can 
explain a bit more about rtPeer. In addition, I am also puzzling some 
variables such as $nextHopPeer. I do know what kind of information it 
stores.

    From the "Agent/rtProto/DV recv-update", it seems DV routing should 
automatically compute new routes if the link cost is changed, because 

...
	    set metricsChanged 0
	    foreach dest [array names metrics] {
                set metric [expr $metrics($dest) + [$ifs_($nbr) cost?]]
		if {$metric > $INFINITY} {
		    set metric $INFINITY
		}
		if {$metric != [$peer metric? $dest]} {
		    $peer metric $dest $metric
		    incr metricsChanged
		}
	    }
	    if $metricsChanged {
		$self compute-routes
		incr rtsChanged_ $metricsChanged
		$rtObject_ compute-routes
...

   I really do not undstand the DV compute-routes well and hope 
somebody can tell more about the programming idea of DV routing in ns 
-2.

    Thanks in advance!

    Sun Kai