I want to simulate the above network in NS2 and as you can see nodes 2 and 6 have links with variable delays. These variable delays should be random values between 5ms and 25ms.
This is how I make the links:
#Create six nodes
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n6 [$ns node]
#Create links between the nodes
$ns duplex-link $n1 $n3 100Mb 5ms DropTail
$ns duplex-link $n2 $n3 100Mb ? DropTail
$ns duplex-link $n3 $n4 100Kb 1ms DropTail
$ns duplex-link $n4 $n5 100Mb 5ms DropTail
$ns duplex-link $n4 $n6 100Mb ? DropTail
I don't know what to put instead of those question marks to get what I want.
I found out that this is the way to do it.
#Create six nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set recvr_delay1 [new RandomVariable/Uniform];
$recvr_delay1 set min_ 5ms
$recvr_delay1 set max_ 25ms
set recvr_delay2 [new RandomVariable/Uniform];
$recvr_delay2 set min_ 5ms
$recvr_delay2 set max_ 25ms
# TODO: make these delays random
#Create links between the nodes
$ns duplex-link $n0 $n2 100Mb 5ms DropTail
$ns duplex-link $n1 $n2 100Mb $recvr_delay1 DropTail
$ns duplex-link $n2 $n3 100Kb 1ms DropTail
$ns duplex-link $n3 $n4 100Mb 5ms DropTail
$ns duplex-link $n3 $n5 100Mb $recvr_delay2 DropTail