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

Re: Error model



I think you can define your own routines for SimplexLink so that you can
insert loss model using a single command. E.g.: 

SimplexLink instproc create-myloss {rate ranvar} {
	set lm [new ErrorModel]
	..... ;# Config stuff
	$self errormodule $lm
}

$ns duplex-link-op $n1 $n2 create-myloss $rate $ranvar

See tcl/lib/ns-link.tcl for SimpleLink::errormodule and its related
functions. 

- Haobo

On Tue, 8 Jun 1999, Kamil Sarac wrote:

> Hello All,
> 
> I want to add error to a link in both direction. Can I add the same
> errormodel object to both simplex links (making up duplex link) i.e.
> is this an obvious way to do it or I should create two different
> errormodels and assign them one to each simplex link? 
> 
>     set loss_module($i) [new ErrorModel]
>     $loss_module($i) set rate_ [lindex $errorrates [expr $i-1]] 
>     $loss_module($i) unit pkt
>     $loss_module($i) ranvar [new RandomVariable/Uniform]   
>     $loss_module($i) drop-target [new Agent/Null]
> 
>     $ns at 0.0001 "$ns lossmodel $loss_module($i) $node([lindex $t 0])
> $node([lindex $t 1])"                             ^^^^^^^^^^^^^^^^^^^^              
> ^^^^^^^^^^^^^^^^^^^^^
>     $ns at 0.0001 "$ns lossmodel $loss_module($i) $node([lindex $t 1])
> $node([lindex $t 0])"                              ^^^^^^^^^^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^
> 
> Thanks,
> Kamil
> 
>