[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Strange FullTcp behaviour with large file transfer with HTTP
Hi everyone,
As a part of my master's thesis project, I'm using ns to look at TCP over
links with long delay. The code at the end of this mail simulates a
satellite connection.
The code shows an errormodel implemented on the link with long delay, with
a byte error rate of 8e-5.
By using the logfile generated, I look at the time it takes from sending a
GET until the corresponding RCV (i.e. the whole webpage is downloaded). I
create a cumulative distribution plot of this.
The strange behaviour arises when I remove the errormodel (in principle
working on a link with no error). This gives a cumulative distribution
function that lies below the CDF of the model containing the errormodel.
Thinking about that, it implies that having a link with bit errors is
better than having a totally errorfree link. When I use smaller page sizes
in pagepool, it gives more reasonable results.
Am I missing something? Or is it a bug? I incline to the first option, but
can't see what I'm doing wrong!
Best regards,
Henrik Norh�j Nielsen
Forskningscenter COM
DTU, Denmark
--------------------------------------------------------
Code:
############################################################
# TCL Script file for simulation
# Link between Corporate HQ and remote site via VSAT HUB
# 1 HTTP Server (HQ) and 1 HTTP Client (Remote Site)
# Compound page model
# Age of main page 1000secs (constant)
# Age of each object 1000secs (constant)
# Client interval generator: exponential (average 150 secs)
############################################################
# Number of clients
set opt(cli) 30
set opt(srv) 30
# Set the values for pagepool
set pgp_main(0) 1000
set pgp_main(1) 3499
set pgp_main(2) 15356
set pgp_main(3) 9714
set pgp_main(4) 11122
set pgp_main(5) 5160
set pgp_main(6) 1893
set pgp_main(7) 13898
set pgp_main(8) 13906
set pgp_main(9) 18759
set pgp_main(10) 8286
set pgp_main(11) 10868
set pgp_main(12) 16788
set pgp_main(13) 1656
set pgp_main(14) 2015
set pgp_main(15) 11064
set pgp_main(16) 13751
set pgp_main(17) 1146
set pgp_main(18) 8284
set pgp_main(19) 2270
set pgp_main(20) 8932
set pgp_main(21) 14048
set pgp_main(22) 12190
set pgp_main(23) 18678
set pgp_main(24) 17077
set pgp_main(25) 1101
set pgp_main(26) 2747
set pgp_main(27) 13424
set pgp_main(28) 8903
set pgp_main(29) 14322
set pgp_objs(0) 0
set pgp_objs(1) 1
set pgp_objs(2) 7
set pgp_objs(3) 4
set pgp_objs(4) 5
set pgp_objs(5) 2
set pgp_objs(6) 0
set pgp_objs(7) 6
set pgp_objs(8) 6
set pgp_objs(9) 9
set pgp_objs(10) 3
set pgp_objs(11) 5
set pgp_objs(12) 8
set pgp_objs(13) 0
set pgp_objs(14) 0
set pgp_objs(15) 5
set pgp_objs(16) 6
set pgp_objs(17) 0
set pgp_objs(18) 3
set pgp_objs(19) 0
set pgp_objs(20) 4
set pgp_objs(21) 6
set pgp_objs(22) 5
set pgp_objs(23) 9
set pgp_objs(24) 8
set pgp_objs(25) 5
set pgp_objs(26) 0
set pgp_objs(27) 6
set pgp_objs(28) 4
set pgp_objs(29) 7
set pgp_osize(0) 10
set pgp_osize(1) 6585
set pgp_osize(2) 37782
set pgp_osize(3) 22937
set pgp_osize(4) 26643
set pgp_osize(5) 10955
set pgp_osize(6) 2361
set pgp_osize(7) 33946
set pgp_osize(8) 33968
set pgp_osize(9) 46735
set pgp_osize(10) 19181
set pgp_osize(11) 25975
set pgp_osize(12) 41549
set pgp_osize(13) 1738
set pgp_osize(14) 2682
set pgp_osize(15) 26489
set pgp_osize(16) 33560
set pgp_osize(17) 394
set pgp_osize(18) 19176
set pgp_osize(19) 3351
set pgp_osize(20) 20880
set pgp_osize(21) 34341
set pgp_osize(22) 29452
set pgp_osize(23) 46522
set pgp_osize(24) 42309
set pgp_osize(25) 26351
set pgp_osize(26) 4607
set pgp_osize(27) 32699
set pgp_osize(28) 20805
set pgp_osize(29) 35062
#Total simulation time
set simtime 700000
set ns [new Simulator]
Http set TRANSPORT_ FullTcp
set log [open "http_1e-5.log" w]
set em_sat [$ns node]
set mu_sat [$ns node]
set fm_router [$ns node]
for {set i 0} {$i < $opt(cli)} {incr i} {
set em_httpcli($i) [$ns node]
}
for {set i 0} {$i < $opt(srv)} {incr i} {
set fm_httpsrv($i) [$ns node]
}
# Set up basic links
$ns duplex-link $em_sat $mu_sat 64kb 280ms DropTail
$ns duplex-link $mu_sat $fm_router 2Mb 60ms DropTail
# Connect remote site clients to VSAT gateway
for {set i 0} {$i < $opt(cli)} {incr i} {
$ns duplex-link $em_httpcli($i) $em_sat 10Mb 2ms DropTail
}
# Connect corporate headquarters to HQ Router
for {set i 0} {$i < $opt(srv)} {incr i} {
$ns duplex-link $fm_router $fm_httpsrv($i) 100Mb 2ms DropTail
}
# Create and configure the pagepool mathematical model
for {set i 0} {$i < $opt(srv)} {incr i} {
set pgp($i) [new PagePool/CompMath/noc]
$pgp($i) set main_size_ $pgp_main($i)
$pgp($i) set comp_size_ $pgp_osize($i)
$pgp($i) set num_pages_ $pgp_objs($i)
set tmp [new RandomVariable/Constant]
$tmp set val_ 1000
$pgp($i) ranvar-main-age $tmp
set tmp [new RandomVariable/Constant]
$tmp set val_ 1000
$pgp($i) ranvar-obj-age $tmp
}
# Associate the pagepools with the servers
for {set i 0} {$i < $opt(srv)} {incr i} {
set server($i) [new Http/Server/Compound $ns $fm_httpsrv($i)]
$server($i) set-page-generator $pgp($i)
$server($i) log $log
}
# Associate the pagepools with the clients, and
# Configure the client request rate
for {set i 0} {$i < $opt(cli)} {incr i} {
set client($i) [new Http/Client/Compound $ns $em_httpcli($i)]
set tmp [new RandomVariable/Exponential]
$tmp set avg_ 150
$client($i) set-interval-generator $tmp
$client($i) log $log
$client($i) set-page-generator $pgp($i)
}
# Insert Error Model
set em1 [new ErrorModel]
$em1 unit byte
$em1 set rate_ 8e-5
$em1 ranvar [new RandomVariable/Uniform]
$em1 drop-target [new Agent/Null]
$ns link-lossmodel $em1 $mu_sat $em_sat
# Timing setup
$ns at 1 "start"
$ns at $simtime "finish"
proc start {} {
global ns server client opt
# Connect Servers to Clients
for {set i 0} {$i < $opt(cli)} {incr i} {
$client($i) connect $server($i)
$client($i) start-session $server($i) $server($i)
# Write connection info to stdout
set now [$ns now]
puts "$now\t+connect cli$i-srv$i"
}
}
proc finish {} {
global ns server client opt
# Disconnect servers and clients
for {set i 0} {$i < $opt(cli)} {incr i} {
$client($i) stop-session $server($i)
$client($i) disconnect $server($i)
set now [$ns now]
puts "$now\t-disconn cli$i-srv$i"
}
closefiles
exit 0
}
# Clean up
proc closefiles {} {
global log
flush $log
close $log
}
$ns run
# TCL Script end
############################################################