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

Re: Print out the propagation delay parameter



Hi Fusun,

I believe there is some easier way to do that but that's I could do.
Here is a procedure you're going to add to your script :

Simulator instproc return_delay { n1 n2 } {
    $self instvar link_
    set sid [$n1 id]
    set did [$n2 id]
    if [info exists link_($sid:$did)] {
	set d [$link_($sid:$did) link]
	return [$d set delay_]
    }
    return -1
}

Then to have the delay between n1 and n2 you use the following :
$ns return_delay $n1 $n2
for your script you can write :
puts $average "$i    $avg($i)        [$ns return_delay $r0 $n($i)]"

If the is no links between n1 and n2 it return -1.

Hope it helps,
Abdelhamid JOUMDANE

>From: Fusun Inanc <[email protected]>
>Reply-To: Fusun Inanc <[email protected]>
>To: [email protected]
>Subject: Print out the propagation delay parameter
>Date: Thu, 22 Jul 1999 14:56:17 -0400 (EDT)
>
>
>
>Hello everyone,
>
>I have a question. I have a simulation which has 10 TCP nodes and every 
>link for
>these nodes have different prop. delay value.
>
>I want to write those values in a file with other parameters.
>
>for example:
>
>$ns duplex-link $n(0) $r0 10Mb 10ms DropTail
>$ns duplex-link $n(1) $r0 10Mb 20ms DropTail
>$ns duplex-link $n(2) $r0 10Mb 50ms DropTail
>:
>:
>
>puts $average "$i    $avg($i)        delay"
>
>delay is to be the prop. delay parameter... But I don't know how to write 
>it.
>
>Could anyone help me for this?
>Thanks in advance.
>
>Fusun Inanc
>


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com