It is equivalently important to understand the ns-2 output trace format
and have some knowledge on how to extract relevant information. This
exercise is dedicated to familiarize you with ns-2's output format, in
particular by trace-all, and techniques to do trace post-processing.
Topology:
Use the simple.tcl example discussed in class, but first swap the
source/destination of udp1 i.e. make its source be n1 and destination
n3.
As a result of running ns on the modified simple.tcl, we
obtain an output file "simple.tr". It contains information of all
packets enqueued (+), dequeued (-), received (r) and dropped (d).
a. Modify the simple.tcl (name this, say, simple1.tcl) so that
there is only one UDP/CBR flow (i.e. do not start the second UDP/CBR flow)
start the two flows (1 TCP and 1 UDP) at the same time 0.1 s
run the script for 6s.
Extract
information from the "simple.tr" file and compute the total bytes of
TCP (tcp) and UDP (cbr) traffic over link 2-3 for the duration of the
simulation. Then, compute total TCP and UDP/CBR traffic in bytes and
ratios of TCP and UDP/CBR to the total. Finally, comment on the
bandwidth share of TCP vs. UDP/CBR.
b. Modify the simple1.tcl file (name this simple2.tcl) so that
there are two UDP/CBR flows
start the TCP and the 2 UDP flows at the same time 0.1 s
run the script for 6s.
Extract the information from the new simple.tr file and recompute the parameters above. What do you notice?
Note:
Fill in the blanks according to your understanding of trace format in
the following awk command for computing the total bytes of TCP or UDP
traffic
awk '$1=="r" && ??==2 && ??==3 && $5=="??" {a += ??} END {print a}' simple1.tr
simple.tcl script
#create scheduler
set ns [new Simulator]
#choose colors
$ns color 0 blue
$ns color 1 red
$ns color 2 green
#turn tracing on
set f [open simple.tr w]
$ns trace-all $f
set nf [open simple.nam w]
$ns namtrace-all $nf
#create topology
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
$ns duplex-link $n0 $n2 5Mb 2ms DropTail
$ns duplex-link $n1 $n2 5Mb 2ms DropTail
$ns duplex-link $n2 $n3 1.5Mb 10ms DropTail
#limit queue size (otherwise unlimited)
#$ns queue-limit $n2 $n3 5
#adjust nam orientation
$ns duplex-link-op $n0 $n2 orient right-up
$ns duplex-link-op $n1 $n2 orient right-down
$ns duplex-link-op $n2 $n3 orient right
#turn nam visualization for n2-n3 queue
$ns duplex-link-op $n2 $n3 queuePos 0.5
#create udp agent
set udp0 [new Agent/UDP]
#attach agent to node
$ns attach-agent $n0 $udp0
#select packet color for nam
$udp0 set class_ 0
#create a cbr application
set cbr0 [new Application/Traffic/CBR]
#attach application to agent
$cbr0 attach-agent $udp0
#create another udp/cbr agent/application
set udp1 [new Agent/UDP]
$ns attach-agent $n3 $udp1
$udp1 set class_ 1
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
#create and attach null agents
set null0 [new Agent/Null]
$ns attach-agent $n3 $null0
set null1 [new Agent/Null]
$ns attach-agent $n1 $null1
$ns connect $udp0 $null0
$ns connect $udp1 $null1
#schedule the start of cbr traffic
$ns at 1.0 "$cbr0 start"
$ns at 1.1 "$cbr1 start"
#create and attach a TCP agent source/sink
set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n0 $tcp
$ns attach-agent $n3 $sink
$ns connect $tcp $sink
#attach an ftp application to the TCP agent
set ftp [new Application/FTP]
$ftp attach-agent $tcp
#schedule start of ftp application
$ns at 1.2 "$ftp start"
#schedule end of ftp application
$ns at 5.0 "$ftp stop"
#$ns at 5.0 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"
#print the (default) cbr values
puts [$cbr0 set packetSize_]
puts [$cbr0 set interval_]
$ns at 6.0 "finish"
proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf
#puts "running nam..."
#exec nam simple.nam &
exit 0
}
$ns run
출처 : http://ns-2.blogspot.com/2006/01/exercise-3-analyze-bandwidth-share-of.html
Trackback address :: http://4ellene.net/tt/trackback/1150
-
Tracked from Cheapest phentermine online.
2008/07/11 17:08
삭제
Phentermine prescription online.
-
Tracked from online casinos
2009/03/30 21:30
삭제
casino tour
-
Tracked from girls rape
2009/04/13 06:40
삭제
girl rape
-
Tracked from xxx forced sex
2009/04/13 19:43
삭제
teen forced sex
-
Tracked from brutal blowjob
2009/04/14 13:57
삭제
brutal anal sex
-
Tracked from brutal torture sex
2009/04/14 16:00
삭제
brutal sex
-
Tracked from tit bondage
2009/04/15 01:58
삭제
teen bondage
-
Tracked from cop rape
2009/06/29 03:53
삭제
schoolgirl rape
-
Tracked from rape torture
2009/06/29 19:18
삭제
rape trailers
-
Tracked from forced sex reporter
2009/06/29 22:16
삭제
rape hentai
-
Tracked from extreme sex videos
2009/06/30 02:20
삭제
rape in movies
-
Tracked from youth rape
2009/06/30 08:58
삭제
woman rape
-
Tracked from rape stories
2009/06/30 20:31
삭제
forced oral sex
-
Tracked from cruel rape
2009/06/30 20:47
삭제
rape scenes in movies
-
Tracked from brutal face fuck
2009/07/01 03:05
삭제
extreme anal insertion
-
Tracked from rape in the movies
2009/07/01 03:08
삭제
rape in movies
-
Tracked from mature rape
2009/07/01 07:16
삭제
rape erotica
-
Tracked from fake rape
2009/07/01 15:32
삭제
extreme insertion anal
-
Tracked from brutal sex
2009/07/01 16:47
삭제
pedo rape stories
-
Tracked from rape my wife
2009/07/01 21:59
삭제
extreme sex
-
Tracked from father daughter rape
2009/07/02 13:13
삭제
lesbian rape sex
-
Tracked from real rape pics
2009/07/02 20:59
삭제
forced teen sex
-
Tracked from rape sex porn
2009/07/03 02:21
삭제
rape scenes
-
Tracked from prowler forced sex
2009/07/03 03:26
삭제
extreme pussy torture
-
Tracked from hot rape
2009/07/03 15:19
삭제
rape in high school
-
Tracked from femdom rape
2009/07/03 15:27
삭제
brutal anal sex
-
Tracked from rape of nanking
2009/07/04 03:03
삭제
drug rape girl porn
-
Tracked from gang rape videos
2009/07/04 04:50
삭제
pussy rape
-
Tracked from rape scenes
2009/07/06 04:26
삭제
forced sex video
-
Tracked from forced dog sex videos
2009/07/06 19:40
삭제
rape porn fantasy
-
Tracked from free online casino games
2009/07/10 04:11
삭제
online casinos accepting all usa players
-
Tracked from casino directory
2009/07/10 05:00
삭제
american online casinos
-
Tracked from online casino guide
2009/07/10 16:51
삭제
casino directory
-
Tracked from online casinos accepting usa deposits
2009/07/10 22:12
삭제
usa internet casino
-
Tracked from casinos online internet
2009/07/11 01:44
삭제
vip online casino
-
Tracked from online casinos for american players
2009/07/11 05:53
삭제
no deposit online casino
-
Tracked from play free casino games
2009/07/11 11:52
삭제
topgame online casinos
-
Tracked from online casino no deposit
2009/07/13 01:25
삭제
play casino games online
-
Tracked from casino http
2009/07/13 01:37
삭제
online casino usa
-
Tracked from casino poker game online
2009/07/13 18:51
삭제
casino http
-
Tracked from online betting casinos
2009/07/14 03:30
삭제
no deposit online casino listings usa
-
Tracked from online casino poker
2009/07/14 12:09
삭제
casinos online
-
Tracked from online casino games
2009/07/15 00:52
삭제
online casinos accepting all usa players
-
Tracked from online casino games
2009/07/15 01:10
삭제
virtual casino
-
Tracked from no deposit online casino
2009/07/15 01:48
삭제
vip casin
-
Tracked from play casino games online
2009/07/15 03:32
삭제
casino directory
-
Tracked from online casinos in the united states
2009/07/15 07:51
삭제
free online casino games
-
Tracked from australian online casino
2009/07/15 18:36
삭제
casinos online
-
Tracked from grand online casino
2009/07/16 18:10
삭제
online casinos no deposit bonus
-
Tracked from online casino http
2009/07/16 19:30
삭제
online casino usa
-
Tracked from topgame online casinos
2009/07/18 22:36
삭제
no download online casinos
-
Tracked from vip online casino
2009/07/20 01:06
삭제
casino bonus
-
Tracked from casino http
2009/07/20 01:58
삭제
tops casino
-
Tracked from transvestite fuck
2009/07/20 05:34
삭제
futanari galleries
-
Tracked from futanari cum
2009/07/20 11:00
삭제
lesbian shemales
-
Tracked from transvestite cock
2009/07/21 04:04
삭제
transvestite fucking
-
Tracked from extreme ladyboy
2009/07/21 05:47
삭제
shemale fucking
-
Tracked from shemale fucks girl
2009/07/21 08:37
삭제
hot shemales
-
Tracked from ladyboy tube
2009/07/21 09:01
삭제
shemale
-
Tracked from tranny lesbian
2009/07/22 02:42
삭제
futanari videos
-
Tracked from transvestite sucking
2009/07/22 05:49
삭제
transvestite cock
-
Tracked from ladyboy riding
2009/07/22 07:47
삭제
las vegas transvestite
-
Tracked from pretty tranny
2009/07/22 19:42
삭제
transvestite spanking
-
Tracked from shemale gallery
2009/07/23 02:12
삭제
brazil free sex transexual
-
Tracked from shemale cumming
2009/07/23 22:24
삭제
transexual movies on demand
-
Tracked from transvestite movies
2009/07/23 23:14
삭제
hot tranny
-
Tracked from shemales cumming
2009/07/23 23:51
삭제
tranny porn
-
Tracked from ladyboy forum
2009/07/24 21:38
삭제
japanese ladyboys
-
Tracked from shemale porn
2009/07/25 04:49
삭제
futanari links
-
Tracked from father daughter sex
2009/09/06 04:20
삭제
father son sex
-
Tracked from brother and sister sex stories
2009/09/06 12:28
삭제
brother sister incest
-
Tracked from Family Sex Stories
2009/09/06 23:25
삭제
family rape
-
Tracked from mother daughter lesbian sex
2009/09/08 14:07
삭제
mother daughter sex
-
Tracked from fucked her son
2009/09/09 03:26
삭제
incest cartoon
-
Tracked from taboo sex
2009/09/09 08:03
삭제
teen incest
-
Tracked from dad daughter
2009/09/09 09:15
삭제
dad daughter nude sex
-
Tracked from lesbian mother daughters
2009/09/09 09:37
삭제
incest mother and daughter
-
Tracked from mom and daughter sex
2009/09/09 23:09
삭제
Fucked Her Son
-
Tracked from nude family
2009/09/09 23:15
삭제
simpsons family sex
-
Tracked from bdsm story
2009/09/11 01:49
삭제
bdsm tgp
-
Tracked from bondage anime
2009/09/11 03:21
삭제
bondage blog
-
Tracked from torture
2009/09/11 06:06
삭제
torture navel needle
-
Tracked from needle torture
2009/09/12 01:30
삭제
orgasm torture
-
Tracked from orgasm torture
2009/09/12 06:00
삭제
outdoor bondage
-
Tracked from anal bdsm
2009/09/12 09:59
삭제
anal torture
-
Tracked from needle torture
2009/09/12 10:40
삭제
orgasm torture
-
Tracked from cock bondage
2009/09/12 12:56
삭제
cunt torture
-
Tracked from lesbian torture
2009/09/13 00:30
삭제
male bdsm
-
Tracked from lesbian bondage
2009/09/13 02:51
삭제
lesbian domination videos
-
Tracked from bondage rape
2009/09/13 21:49
삭제
bondage stories
-
Tracked from bdsm pics
2009/09/14 01:55
삭제
bdsm pictures
-
Tracked from gay bondage
2009/09/14 02:12
삭제
gay male bondage
-
Tracked from bdsm training
2009/09/15 16:19
삭제
bdsm video
-
Tracked from bdsm gallery
2009/09/15 19:55
삭제
bdsm mpegs
-
Tracked from torture video
2009/09/16 03:37
삭제
torture whip
-
Tracked from self bondage stories
2009/09/17 15:49
삭제
sex punishment
-
Tracked from mother son incest
2009/09/27 11:22
삭제
mom and son sex
-
Tracked from lesbian twin sister
2009/09/27 11:56
삭제
little sister
-
Tracked from daughter fucking incest porn
2009/09/28 17:53
삭제
young incest porn
-
Tracked from mom son sex
2009/09/28 18:06
삭제
mom strips for son
-
Tracked from father daughter porn
2009/09/28 19:55
삭제
amateur incest family porn
-
Tracked from dad fucking virgin daughter
2009/09/29 10:12
삭제
fathers fucking daughters
-
Tracked from dad fucking son
2009/09/29 13:19
삭제
daddies and sons gay
-
Tracked from incest sex
2009/10/01 15:11
삭제
incest pictures
-
Tracked from incest sex
2009/10/01 19:23
삭제
incest stories
-
Tracked from incest hentai
2009/10/03 05:39
삭제
anime incest
-
Tracked from mother daughter lesbian sex
2009/10/03 09:11
삭제
incest stories
-
Tracked from family fucking
2009/10/04 09:42
삭제
family incest
-
Tracked from bdsm for all
2009/10/20 09:08
삭제
bdsm free
-
Tracked from shemale bondage
2009/10/20 10:23
삭제
suspension bondage
-
Tracked from bondage porn
2009/10/21 15:57
삭제
bondage rape
-
Tracked from rope bondage
2009/10/21 16:35
삭제
rubber bondage
-
Tracked from bdsm humiliation
2009/10/22 10:35
삭제
bdsm library
-
Tracked from asian bdsm
2009/10/22 10:55
삭제
bdsm 666
-
Tracked from bondage sex
2009/10/22 15:16
삭제
bondage slave
-
Tracked from amateur bdsm
2009/10/23 13:32
삭제
anal bdsm
-
Tracked from bdsm comix
2009/10/23 18:16
삭제
bdsm drawings
Comments List