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

error model...



hi,

i hv a simple topology where two nodes r connected via duplex link....i
wanna introduce an error model...i hv observed that the error model is
not producing any errors ..i other words..it is not making any impact on
the transmission of pakets from TCP source to sink..something is wrong
in my error model introduction..my script is shown below...if anyone of
ns users can help me in this regard, i will appreciate..

Regards..
Hamid


set ns [new Simulator]
$ns color 0 Blue

set nf [open out.nam w]
$ns namtrace-all $nf

set f [open out1.tr w]
$ns trace-all $f

proc finish {} {
 global ns nf
 $ns flush-trace
 close $nf
 exec nam out.nam &
 exit 0
}

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms SFQ

set tcp1 [new Agent/TCP/Newreno]
$ns attach-agent $n0 $tcp1
$tcp1 set packetSize_ 1000
$tcp1 set window_ 50

set tcp2 [new Agent/TCPSink]
$ns attach-agent $n1 $tcp2

$ns connect $tcp1 $tcp2

set src1 [new Source/FTP]
$src1 attach $tcp1
$src1 set fid_ 1

set loss_module [new ErrorModel]
$loss_module set rate_ 0.50
$loss_module unit pkt
$loss_module ranvar [new RandomVariable/Pareto]
$loss_module drop-target [new Agent/Null]


$ns at 0.5 "$src1 start"
$ns at 4.5 "$src1 stop"

$ns at 5.0 "finish"

$ns run