12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

set n(1) [$<strong>ns</strong> node]set link(0:1) [$<strong>ns</strong> duplex-link $n(0) $n(1) 1Mbps 50ms RED]for {set i 0} { $i < 4} {incr i} {set ltcp($i) [new Agent/TCP]set ltcpsink($i) [new Agent/TCPSink]$<strong>ns</strong> <strong>at</strong>tach-agent $n(0) $ltcp($i)$<strong>ns</strong> <strong>at</strong>tach-agent $n(1) $ltcpsink($i)$<strong>ns</strong> connect $ltcp($i) $ltcpsink($i)set lftp($i) [new Applic<strong>at</strong>ion/FTP]$lftp($i) <strong>at</strong>tach-agent $ltcp($i)$<strong>ns</strong> <strong>at</strong> 0 "$lftp($i) start"}# Short term flowsaddsrc 1adddst 0set pool [new PagePool/WebTraf]# Set up server <strong>and</strong> client nodes$pool set-num-client [llength [$<strong>ns</strong> set src_]]$pool set-num-server [llength [$<strong>ns</strong> set dst_]]global <strong>ns</strong>et i 0foreach s [$<strong>ns</strong> set src_] {$pool set-client $i $n($s)incr i}set i 0foreach s [$<strong>ns</strong> set dst_] {$pool set-server $i $n($s)incr i}# Number of Pages per Sessio<strong>ns</strong>et numPage 100000$pool set-num-session 1set interPage [new R<strong>and</strong>omVariable/Exponential]$interPage set avg_ 0.5set pageSize [new R<strong>and</strong>omVariable/Co<strong>ns</strong>tant]$pageSize set val_ 1set interObj [new R<strong>and</strong>omVariable/Exponential]$interObj set avg_ 1set objSize [new R<strong>and</strong>omVariable/Co<strong>ns</strong>tant]$objSize set val_ 20380

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!