I am using the Network Simulator NS2 program (https://www.isi.edu/nsnam/ns/) in order to simulate a simple network topology with 1 UDP agent and 1 CBR Application Traffic sending data from a node over to another node further away. Somewhere in the middle of the topology, there is a choice of network path involved since there are two alternative options (either e.g. 1-2-3 or 1-4-3 where node 1 is sending data and 3 receiving). I am also using the following commands for dynamic routing:

Agent/rtProto/Direct set preference_ 200
$ns rtproto DV

I also use an rtmodel stop/start event in order to simulate the following network topology change: connection of nodes 1 and 2 is "cut off" and then reinstated later. My questions are as follows:

1) How is the time that exists between the path change after the 1-2 connection drop calculated? I can see some 11-byte rtProtoDV packets being transmitted through the network but I don't exactly understand how the time between the connection drop and the packet-delivery network path change is calculated.

2) Which one of all the nodes defines where the packets will be directed? So, does the traffic source define the whole path that one of its sent packets will follow, or do the intermittent nodes decide seperately where to forward the packets ad-hoc?

3) What does the Agent/rtProto/Direct set preference_ 200 command exactly do? I have read on the NS2 manual that the default value is 100, but what does it exactly do differently when it is 100 vs. when it is 200? The NS2 manual isn't clear at all at that point... (https://www.isi.edu/nsnam/ns/doc/node311.html)

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 25, 2018 at 8:09
  • @RonMaupin No proper answer was actually given and still it seems to be the fact that only the developers might know. I have posted it on the mailing list, but nobody answered until now.
    – user30757
    Dec 26, 2018 at 18:39

1 Answer 1


Only a partial answer:

  1. is extremely simulation specific and can probably only answered by one of the developers
  2. As with a real network, each packet is directed to the next hop according to the current hop's routing table. As with all packet-switched networks, each hop is oblivious to the network as a whole, it just works based on its own routing table. The source only defines the destination, not the path.
  3. The preference_ parameter in a routing table entry defines whether the entry is used with multiple entries to the same destination - the one with the best preference_ value is used. (This corresponds to the metric value often used in IP routing.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.