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

Re: same program, different results on 2 PCs



I found out that the reason for the different results is not that the
program was run on different PCs. It is that when I comment out the two
lines:
set h [open tahoe.tr w]
$ns trace-all $h

is that it gives me the different set of results. DO you think this
happens because I set the simulation time to 50 sec. Would it help if I
fix the size of the ftped data instead. e.g. I use $ftp produce 100. But
how can I know when it is done so that I can exit ns? 

-Hala

**************************************************************************
Hala A. ElAarag
Ph.D. Student
School of Computer Science 
University of Central Florida
Orlando, FL 32816
**************************************************************************

On Sat, 5 Sep 1998, Hala ElAarag wrote:

> Hi,
> I installed ns-2.1b2 on two PCs. I used the zipped windows version from
> catarina.usc.edu under /pub/usr/ahelmy.I executed the following program on
> two PCs:
> 
> set ns [new Simulator]
> 
> # Create three nodes
> set fixed [$ns node]
> set base [$ns node]
> set mobile [$ns node]
> 
> #Create a trace file
> set h [open tahoe.tr w]
> $ns trace-all $h
> 
> #Create nam trace file
> set nf [open tahoe.nam w]
> $ns namtrace-all $nf
> 
> #Connect the three nodes 
> $ns duplex-link $fixed $base 1.5Mb 10ms DropTail
> $ns duplex-link $base $mobile 0.8Mb 100ms DropTail
> 
> #Set up BSD Tahoe TCP connections from fixed host to mobile
> set tcp_src1 [new Agent/TCP]
> set tcp_snk1 [new Agent/TCPSink]
> $ns attach-agent $fixed $tcp_src1
> $ns attach-agent $mobile $tcp_snk1
> $ns connect $tcp_src1 $tcp_snk1
> 
> #define TCP parameters
> $tcp_src1 set window_ 100   
> $tcp_src1 set packetSize_ 1024
> $tcp_src1 set tcpTick_ 0.1
> $tcp_src1 set ssthresh_ 64
> 
> #Create ftp sources at each node
> set ftp1 [$tcp_src1 attach-source FTP]
> 
> #define the error model on the wireless link
> # deterministic with up-interval = 4s and down-interval = 0.4s
> $ns rtmodel Deterministic {0.0 4.0  0.4} $base $mobile
> 
> #start up ftp at time 0 
> 
> $ns at 0.0 "$ftp1 start"
> proc printtcp { tcp time } {
>     puts ""
>     puts "tcp: time: $time"
>     puts "total_data_packets_sent: [$tcp set ndatapack_] "
>     puts "packets_resent: [$tcp set nrexmitpack_] "
>     puts "ack_packets_received: [$tcp set nackpack_]"
>    puts "retransmit_timeouts: [$tcp set nrexmit_]"
>     puts "srtt(in ticks): [$tcp set srtt_]/8 RTTvar(in ticks): [$tcp set
> rttvar_]/4 backoff: [$tcp set backoff_]" 
>     exit 0
> }
>                                                                                
> 
> #run the simulation for 50 simulated seconds
> $ns at 50.0 "printtcp $tcp_src1 50.0"
> $ns run
> 
> For one PC I had:
> total_data_packets_sent= 2107
> packets_resent = 185
> ack_packets_received = 1875
> 
> On the other PC I had:
> total_data_packets_sent= 339
> packets_resent = 68
> ack_packets_received = 292  
> 
> There is a great different between both results.
> Anybody have an idea of what is going on?
> Thanks.
> 
> -Hala
> 
> **************************************************************************
> Hala A. ElAarag
> Ph.D. Student
> School of Computer Science 
> University of Central Florida
> Orlando, FL 32816
> **************************************************************************
> 
>