# Polly Huang 8-7-98 # Initial setup source ~huang/research/vint/ns-2/tcl/https/https-mod.tcl source dumbbell.tcl global num_node n set ns [new Simulator] # set up colors for nam for {set i 1} {$i <= 30} {incr i} { set color [expr $i % 6] if {$color == 0} { $ns color $i blue } elseif {$color == 1} { $ns color $i red } elseif {$color == 2} { $ns color $i green } elseif {$color == 3} { $ns color $i yellow } elseif {$color == 4} { $ns color $i brown } elseif {$color == 5} { $ns color $i black } } # Create nam trace and generic packet trace $ns namtrace-all [open validate.nam w] # trace-all is the generic trace we've been using $ns trace-all [open validate.out w] create_topology ########################### Modify From Here ##################### ## Number of Pages per Session set numPage 10 set httpsSession1 [new httpsSession $ns $numPage [$ns picksrc]] set httpsSession2 [new httpsSession $ns $numPage [$ns picksrc]] ## Inter-Page Interval ## Number of Objects per Page ## Inter-Object Interval ## Number of Packets per Object ## have to set page specific attributes before createPage ## have to set object specific attributes after createPage $httpsSession1 setDistribution interPage_ Exponential 1 ;#in sec $httpsSession1 setDistribution pageSize_ Constant 1 ;# number of objects/page $httpsSession1 createPage $httpsSession1 setDistribution interObject_ Exponential 0.01 ;# in sec $httpsSession1 setDistribution objectSize_ ParetoII 10 1.2 ;# number of packets # uses default $httpsSession2 createPage $ns at 0.1 "$httpsSession1 start" ;# in sec as well $ns at 0.2 "$httpsSession2 start" $ns at 30.0 "finish" proc finish {} { global ns $ns flush-trace puts "running nam..." # exec to run unix command exec nam validate.nam & exit 0 } # Start the simualtion $ns run