hi, ns-users!
the first question:
can anyone tell me how to set the req_trace_ and resp_trace_, I invoke the
function
$pool launch-req {id pid clnt svr ctcp csnk size pobj}
but I dont know the meanning of pid, ctcp, csnk, size and pobj, can anyone
give me some sugestion
the other: how to set the fixed size of page and how to set the page
size as 500Kbit
thanks!
!!
my ns2 scritps is:
#Create a simulator object
set ns [new Simulator]
$ns color 0 blue ;# Set colors to display packets
$ns color 1 red
source /home/ns2/ns-allinone-2.28/ns-2.28/tcl/webcache/webtraf.tcl
#Open the trace file
set p2p_tracefd [open p2p_web1.tr w]
$ns trace-all $p2p_tracefd
#Open the nam trace file
set p2p_namfd [open p2p_web1.nam w]
$ns namtrace-all $p2p_namfd
#
#
||--10m,10ms-Np1
#||
#|
|--10m,10ms-Npn
#N0-10mb,20ms| r |
#|
|--10m,20ms-Nt1
#|
|
#
||--10m,20ms-Ntm
##
##
#set the default parameter
##
set n 5;##set the number n of
short-lived p2p
set m 2;##set the
number m of long-lived web
set u 1Mb; ##set the capacity of
the bottleneck link
set Ltn 10ms; ##set the link RTT of
long-lived tcp
set Ltm 20ms; ##set the link RTT of
short-lived tcp
##
#Create the nodes and links
#
set N0 [$ns node]
set r [$ns node]
$N0 label N0
$r label route
for {set i 1} {$i=$m} {incr i} {
set Nt($i) [$ns node]
$Nt($i) label Nt$i
}
set i 0
for {set i 1} {$i=$n} {incr i} {
set Np($i) [$ns node]
$Np($i) label Np$i
}
#Create a duplex link between the nodes
$ns duplex-link $N0 $r $u 1ms RED
$ns duplex-link-op $N0 $r color pink
set i 0
for {set i 1} {$i=$n} {incr i} {
$ns duplex-link $r $Np($i) $u $Ltn RED
$ns duplex-link-op $r $Np($i) color red
}
set i 0
for {set i 1} {$i=$m} {incr i} {
$ns duplex-link $r $Nt($i) $u $Ltm RED
$ns duplex-link-op $r $Nt($i) color green
}
$ns set src_ [list 0]
$ns set dst_ [list 2]
#
#set the short-lived p2p flow
#
for {set o 1} {$o=$n} {incr o} {
set tcp($o) [new Agent/TCP/Reno]
$ns attach-agent $Np($o) $tcp($o)
set ftp($o) [new Application/FTP]
$ftp($o) set fid_ 1
$ftp($o) attach-agent $tcp($o)
set sink($o) [new Agent/TCPSink]
$ns attach-agent $N0 $sink($o)
$ns connect $tcp($o) $sink($o)
}
##
#set the short-lived web flow
#
#debug 1
set pool [new PagePool/WebTraf]
$pool set debug_ true
# Trace web request and response flows
$pool set req_trace_ 0
$pool set resp_trace_ 0
#$pool launch-req {1 1 $N0 $Nt(2) 1 0 40 23456}
# options to control traffic based on flow size,
# used to evaluate SFD algorithm.
# The threshold to classify short and long flows (in TCP packets, ie 15KB)
$pool set FLOW_SIZE_TH_ 60
# Set up server and client nodes
$pool set-num-client [llength [$ns set src_]]
$pool set-num-server [llength [$ns set dst_]]
#global n
set i 0
foreach s [$ns set src_] {
$pool set-client $i $N0
incr i
}
set i 0
foreach s [$ns set dst_] {
$pool set-server $i $Nt($s)
incr i
}
# Number of Pages per Session
set numPage 1
# Session 0 starts from 2s, session 1 starts from 2.1s
$pool set-num-session 2
# XXX Can't initialize instvars using something like this:
# set interPage [new RandomVariable/Exponential -avg_ 1]
# Must explicitly set variable values
set interPage [new RandomVariable/Exponential]
$interPage set avg_ 1
set pageSize [new RandomVariable/Constant]
$pageSize set val_ 1
set interObj [new RandomVariable/Exponential]
$interObj set avg_ 0.01
set objSize [new RandomVariable/ParetoII]
$objSize set avg_ 10
$objSize set shape_ 1.2
$pool create-session 0 $numPage 2 $interPage $pageSize $interObj $objSize
set interPage [new RandomVariable/Exponential]