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

same program, different results on 2 PCs



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
**************************************************************************