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

    2007/04/25 11:43 2007/04/25 11:43
    TAG
    Trackback address :: http://4ellene.net/tt/trackback/1150
    1. Online phentermine.

      Tracked from Cheapest phentermine online. 2008/07/11 17:08  삭제

      Phentermine prescription online.

    2. casino free slots

      Tracked from online casinos 2009/03/30 21:30  삭제

      casino tour

    3. Tracked from girls rape 2009/04/13 06:40  삭제

      girl rape

    4. Tracked from xxx forced sex 2009/04/13 19:43  삭제

      teen forced sex

    5. brutal blow jobs

      Tracked from brutal blowjob 2009/04/14 13:57  삭제

      brutal anal sex

    6. brutal throat fuck

      Tracked from brutal torture sex 2009/04/14 16:00  삭제

      brutal sex

    7. the bondage paper

      Tracked from tit bondage 2009/04/15 01:58  삭제

      teen bondage

    8. pictures forced feminization

      Tracked from cop rape 2009/06/29 03:53  삭제

      schoolgirl rape

    9. extreme rape

      Tracked from rape torture 2009/06/29 19:18  삭제

      rape trailers

    10. dad rapes daughter

      Tracked from forced sex reporter 2009/06/29 22:16  삭제

      rape hentai

    11. daddy rape

      Tracked from extreme sex videos 2009/06/30 02:20  삭제

      rape in movies

    12. extreme hard sex

      Tracked from youth rape 2009/06/30 08:58  삭제

      woman rape

    13. rape photos

      Tracked from rape stories 2009/06/30 20:31  삭제

      forced oral sex

    14. gay forced sex

      Tracked from cruel rape 2009/06/30 20:47  삭제

      rape scenes in movies

    15. rape clips

      Tracked from brutal face fuck 2009/07/01 03:05  삭제

      extreme anal insertion

    16. rape gang young

      Tracked from rape in the movies 2009/07/01 03:08  삭제

      rape in movies

    17. rape vids

      Tracked from mature rape 2009/07/01 07:16  삭제

      rape erotica

    18. porn rape scene

      Tracked from fake rape 2009/07/01 15:32  삭제

      extreme insertion anal

    19. rape sister

      Tracked from brutal sex 2009/07/01 16:47  삭제

      pedo rape stories

    20. extreme board rape

      Tracked from rape my wife 2009/07/01 21:59  삭제

      extreme sex

    21. rape porn pictures

      Tracked from father daughter rape 2009/07/02 13:13  삭제

      lesbian rape sex

    22. blonde rape

      Tracked from real rape pics 2009/07/02 20:59  삭제

      forced teen sex

    23. rape sex videos

      Tracked from rape sex porn 2009/07/03 02:21  삭제

      rape scenes

    24. rape insest porn top

      Tracked from prowler forced sex 2009/07/03 03:26  삭제

      extreme pussy torture

    25. rape and forced sex movies

      Tracked from hot rape 2009/07/03 15:19  삭제

      rape in high school

    26. marital rape case

      Tracked from femdom rape 2009/07/03 15:27  삭제

      brutal anal sex

    27. forced white wife

      Tracked from rape of nanking 2009/07/04 03:03  삭제

      drug rape girl porn

    28. extreme fucking

      Tracked from gang rape videos 2009/07/04 04:50  삭제

      pussy rape

    29. brutal hentai

      Tracked from rape scenes 2009/07/06 04:26  삭제

      forced sex video

    30. rape flicks

      Tracked from forced dog sex videos 2009/07/06 19:40  삭제

      rape porn fantasy

    31. online casino slots

      Tracked from free online casino games 2009/07/10 04:11  삭제

      online casinos accepting all usa players

    32. golden casino http

      Tracked from casino directory 2009/07/10 05:00  삭제

      american online casinos

    33. online internet casino

      Tracked from online casino guide 2009/07/10 16:51  삭제

      casino directory

    34. casino websites

      Tracked from online casinos accepting usa deposits 2009/07/10 22:12  삭제

      usa internet casino

    35. free online casino games

      Tracked from casinos online internet 2009/07/11 01:44  삭제

      vip online casino

    36. online free casino games

      Tracked from online casinos for american players 2009/07/11 05:53  삭제

      no deposit online casino

    37. play casino online

      Tracked from play free casino games 2009/07/11 11:52  삭제

      topgame online casinos

    38. online casino game

      Tracked from online casino no deposit 2009/07/13 01:25  삭제

      play casino games online

    39. u s online casino

      Tracked from casino http 2009/07/13 01:37  삭제

      online casino usa

    40. casino game online

      Tracked from casino poker game online 2009/07/13 18:51  삭제

      casino http

    41. free online casinos

      Tracked from online betting casinos 2009/07/14 03:30  삭제

      no deposit online casino listings usa

    42. online internet casino

      Tracked from online casino poker 2009/07/14 12:09  삭제

      casinos online

    43. list of online casinos

      Tracked from online casino games 2009/07/15 00:52  삭제

      online casinos accepting all usa players

    44. casinos http

      Tracked from online casino games 2009/07/15 01:10  삭제

      virtual casino

    45. online casino games

      Tracked from no deposit online casino 2009/07/15 01:48  삭제

      vip casin

    46. us friendly casinos

      Tracked from play casino games online 2009/07/15 03:32  삭제

      casino directory

    47. online no deposit casino

      Tracked from online casinos in the united states 2009/07/15 07:51  삭제

      free online casino games

    48. casino usa slot

      Tracked from australian online casino 2009/07/15 18:36  삭제

      casinos online

    49. free casino games online

      Tracked from grand online casino 2009/07/16 18:10  삭제

      online casinos no deposit bonus

    50. new online casino

      Tracked from online casino http 2009/07/16 19:30  삭제

      online casino usa

    51. online casino $10 minimum deposit

      Tracked from topgame online casinos 2009/07/18 22:36  삭제

      no download online casinos

    52. casino web sites

      Tracked from vip online casino 2009/07/20 01:06  삭제

      casino bonus

    53. american online casinos

      Tracked from casino http 2009/07/20 01:58  삭제

      tops casino

    54. futanari comics

      Tracked from transvestite fuck 2009/07/20 05:34  삭제

      futanari galleries

    55. transexual galleries

      Tracked from futanari cum 2009/07/20 11:00  삭제

      lesbian shemales

    56. tranny bondage

      Tracked from transvestite cock 2009/07/21 04:04  삭제

      transvestite fucking

    57. transvestite fucking

      Tracked from extreme ladyboy 2009/07/21 05:47  삭제

      shemale fucking

    58. shemale masturbating

      Tracked from shemale fucks girl 2009/07/21 08:37  삭제

      hot shemales

    59. tranny fucks guy

      Tracked from ladyboy tube 2009/07/21 09:01  삭제

      shemale

    60. asian transexuals

      Tracked from tranny lesbian 2009/07/22 02:42  삭제

      futanari videos

    61. sexy shemale

      Tracked from transvestite sucking 2009/07/22 05:49  삭제

      transvestite cock

    62. nancy ladyboy

      Tracked from ladyboy riding 2009/07/22 07:47  삭제

      las vegas transvestite

    63. lesbian shemales

      Tracked from pretty tranny 2009/07/22 19:42  삭제

      transvestite spanking

    64. transexual fuck

      Tracked from shemale gallery 2009/07/23 02:12  삭제

      brazil free sex transexual

    65. tranny girls

      Tracked from shemale cumming 2009/07/23 22:24  삭제

      transexual movies on demand

    66. transsexual list

      Tracked from transvestite movies 2009/07/23 23:14  삭제

      hot tranny

    67. futanari games

      Tracked from shemales cumming 2009/07/23 23:51  삭제

      tranny porn

    68. shemale fucking girl

      Tracked from ladyboy forum 2009/07/24 21:38  삭제

      japanese ladyboys

    69. transexual gallery

      Tracked from shemale porn 2009/07/25 04:49  삭제

      futanari links

    70. father fucks daughter

      Tracked from father daughter sex 2009/09/06 04:20  삭제

      father son sex

    71. brother on sister porn

      Tracked from brother and sister sex stories 2009/09/06 12:28  삭제

      brother sister incest

    72. family naturist

      Tracked from Family Sex Stories 2009/09/06 23:25  삭제

      family rape

    73. mother daughter nude

      Tracked from mother daughter lesbian sex 2009/09/08 14:07  삭제

      mother daughter sex

    74. incest art

      Tracked from fucked her son 2009/09/09 03:26  삭제

      incest cartoon

    75. taboo sex stories

      Tracked from taboo sex 2009/09/09 08:03  삭제

      teen incest

    76. dad and daughter sex

      Tracked from dad daughter 2009/09/09 09:15  삭제

      dad daughter nude sex

    77. mother daughter lesbian sex

      Tracked from lesbian mother daughters 2009/09/09 09:37  삭제

      incest mother and daughter

    78. incest lesbian stories

      Tracked from mom and daughter sex 2009/09/09 23:09  삭제

      Fucked Her Son

    79. nude sister

      Tracked from nude family 2009/09/09 23:15  삭제

      simpsons family sex

    80. bdsm teen

      Tracked from bdsm story 2009/09/11 01:49  삭제

      bdsm tgp

    81. bondage art

      Tracked from bondage anime 2009/09/11 03:21  삭제

      bondage blog

    82. torture devices

      Tracked from torture 2009/09/11 06:06  삭제

      torture navel needle

    83. nipple torture

      Tracked from needle torture 2009/09/12 01:30  삭제

      orgasm torture

    84. outdoor bdsm

      Tracked from orgasm torture 2009/09/12 06:00  삭제

      outdoor bondage

    85. anal bondage

      Tracked from anal bdsm 2009/09/12 09:59  삭제

      anal torture

    86. nipple torture

      Tracked from needle torture 2009/09/12 10:40  삭제

      orgasm torture

    87. cock torture

      Tracked from cock bondage 2009/09/12 12:56  삭제

      cunt torture

    88. light bondage

      Tracked from lesbian torture 2009/09/13 00:30  삭제

      male bdsm

    89. lesbian domination

      Tracked from lesbian bondage 2009/09/13 02:51  삭제

      lesbian domination videos

    90. bondage sex

      Tracked from bondage rape 2009/09/13 21:49  삭제

      bondage stories

    91. bdsm picture thumbnails

      Tracked from bdsm pics 2009/09/14 01:55  삭제

      bdsm pictures

    92. gay domination

      Tracked from gay bondage 2009/09/14 02:12  삭제

      gay male bondage

    93. bdsm tube

      Tracked from bdsm training 2009/09/15 16:19  삭제

      bdsm video

    94. bdsm humiliation

      Tracked from bdsm gallery 2009/09/15 19:55  삭제

      bdsm mpegs

    95. torture videos

      Tracked from torture video 2009/09/16 03:37  삭제

      torture whip

    96. sex bondage

      Tracked from self bondage stories 2009/09/17 15:49  삭제

      sex punishment

    97. mom son sex

      Tracked from mother son incest 2009/09/27 11:22  삭제

      mom and son sex

    98. lesbian twin sisters

      Tracked from lesbian twin sister 2009/09/27 11:56  삭제

      little sister

    99. porn incest

      Tracked from daughter fucking incest porn 2009/09/28 17:53  삭제

      young incest porn

    100. moms fucking sons

      Tracked from mom son sex 2009/09/28 18:06  삭제

      mom strips for son

    101. incest porn

      Tracked from father daughter porn 2009/09/28 19:55  삭제

      amateur incest family porn

    102. father fucks daughter

      Tracked from dad fucking virgin daughter 2009/09/29 10:12  삭제

      fathers fucking daughters

    103. dad fucks daughter

      Tracked from dad fucking son 2009/09/29 13:19  삭제

      daddies and sons gay

    104. incest stories

      Tracked from incest sex 2009/10/01 15:11  삭제

      incest pictures

    105. incest pictures

      Tracked from incest sex 2009/10/01 19:23  삭제

      incest stories

    106. comics incest

      Tracked from incest hentai 2009/10/03 05:39  삭제

      anime incest

    107. incest mother and daughter

      Tracked from mother daughter lesbian sex 2009/10/03 09:11  삭제

      incest stories

    108. family fucking incest family fucking

      Tracked from family fucking 2009/10/04 09:42  삭제

      family incest

    109. bdsm fiction

      Tracked from bdsm for all 2009/10/20 09:08  삭제

      bdsm free

    110. sexy bondage

      Tracked from shemale bondage 2009/10/20 10:23  삭제

      suspension bondage

    111. bondage pictures

      Tracked from bondage porn 2009/10/21 15:57  삭제

      bondage rape

    112. public bondage

      Tracked from rope bondage 2009/10/21 16:35  삭제

      rubber bondage

    113. bdsm galleries

      Tracked from bdsm humiliation 2009/10/22 10:35  삭제

      bdsm library

    114. anime bdsm

      Tracked from asian bdsm 2009/10/22 10:55  삭제

      bdsm 666

    115. bondage rape

      Tracked from bondage sex 2009/10/22 15:16  삭제

      bondage slave

    116. women in bondage

      Tracked from amateur bdsm 2009/10/23 13:32  삭제

      anal bdsm

    117. bdsm comics

      Tracked from bdsm comix 2009/10/23 18:16  삭제

      bdsm drawings

    Comments List

    1. xxx home video movie 2008/05/24 00:33

    Write a comment.

    [로그인][오픈아이디란?]