Ns2 _Transport & Application

Network/Ns-2 | 2006/12/14 04:43 | adioshun

노드 생성 : 네트워크 계층까지 완료(=토폴로지만 완성), 전송 계층 X, 응용계층 X



[ Transport ]

Ns2 에서는 agent 개념으로 설명

패킷 생성, 전송, 수신 구현


1. TCP

지원 프로토콜 (교재 349P 참고/ 10.3)

1.1 이용 방법

  • 에이전트 생성
    • Set tcp [new Agent/TCP]         # 패킷 송신 에이전트를 변수 tcp로 지정
      _ Agent/TCP - a "tahoe" TCP sender
      _ Agent/TCP/Reno - a "Reno" TCP sender
      _ Agent/TCP/Newreno - Reno with a modification
      _ Agent/TCP/Sack1 - TCP with selective repeat (follows RFC2018)
      _ Agent/TCP/Vegas - TCP Vegas
      _ Agent/TCP/Fack - Reno TCP with "forward acknowledgment"
    • Set tcpsink [new Agent/TCPSink]    # 패킷 수신 에이전트를 변수 tcpsink로 지정
      _ Agent/TCPSink - TCP sink with one ACK per packet
      _ Agent/TCPSink/DelAck - TCP sink with configurable delay per ACK
      _ Agent/TCPSink/Sack1 - selective ACK sink (follows RFC2018)
      _ Agent/TCPSink/Sack1/DelAck - Sack1 with DelAck

  • 에이전트와 노드 결합
    • $ns attach-agent $n0 $tcp         #n0 노드에 tcp에이전트 결합
    • $ns attach-agent $n3 $sink        #n3 노드에 sink에이전트 결합

  • 에이전트끼리 연결
    • $ns connect $tcp $sink            #tcp 에이전트와 sink에이전트 연결

* Agent/TCP 와 Agent/TCPSink 한 쌍으로 설정 해야 함(교재 : 373p)


1.2 설정

[방법 1: simple configuration]

  • 에이전트 설정

set ns [new Simulator]

set node1 [$ns node]

set node2 [$ns node]


set tcp1 [$ns create-connection TCP $node1 TCPSink $node2 42]

$tcp set window_ 50


set ftp1 [new Application/FTP]

$ftp1 attach-agent $tcp1


$ns at 0.0 "$ftp start"

* set tcp1 [$ns create-connection TCP $node1 TCPSink $node2 42]

  1. create-connection 함수의 의미
  • TCP : 송신 에이젼트
  • $node1 : 송신 노드 (souce node)
  • TCPSink : 수신 에이젼트
  • $node2 : 수신 노드
  • 42 : flow ID

  • create-connection함수의 동작 순서
    • 두 에이전트 생성, 에이전트의 flow ID필드 설정
    • 송신 에이전트와 수신 에이전트를 알맞은 노드에 결합 시킨다
    • 에이전트 끼리 연결 한다.(송수신의 각 포트, 주소 설정)
    • create-connection 함수는 최종 결과값을 송신 에이전트가 생성될 때 사용한 이름인 tcp1로 반환 한다.
  • TDP 데이터 소스(Tcp Data Source)

    -데이터 생성모듈 ex) FTP, Telnet


[방법 2: 파라미터 직접 작성]

파라미터 (변수)

클래스 변수 : 전체 에이전트 값 변함 (ex: Agent/TCP set window_ 100)

인스턴스변수 : 해당 에이전트만 변함 (ex : $tcp set window_ 2.0 )

Agent/TCP set window_ 20 ;                # max bound on window size
Agent/TCP set windowInit_ 1 ;            # initial/reset value of cwnd
Agent/TCP set windowOption_ 1 ;            # cong avoid algorithm (1: standard)
Agent/TCP set windowConstant_ 4 ;            # used only when windowOption != 1
Agent/TCP set windowThresh_ 0.002 ;        # used in computing averaged window
Agent/TCP set overhead_ 0 ;            # !=0 adds random time between sends
Agent/TCP set ecn_ 0 ;                # TCP should react to ecn bit
Agent/TCP set packetSize_ 1000 ;            #
packet size used by sender (bytes)
Agent/TCP set bugFix_ true ;            # see explanation
Agent/TCP set slow_start_restart_ true ;    #
see explanation

Agent/TCP set tcpTick_ 0.1 ;        #
timer granulatiry in sec (.1 is NONSTANDARD)
Agent/TCP set maxrto_ 64 ;                # bound on RTO (seconds)
Agent/TCP set dupacks_ 0 ;                # duplicate ACK counter
Agent/TCP set ack_ 0 ;                #
highest ACK received

Agent/TCP set cwnd_ 0 ;                #
congestion window (packets)
Agent/TCP set awnd_ 0 ;                # averaged cwnd (experimental)
Agent/TCP set ssthresh_ 0 ;            # slow-stat threshold (packets)
Agent/TCP set rtt_ 0 ;                # rtt sample
Agent/TCP set srtt_ 0 ;                # smoothed (averaged) rtt
Agent/TCP set rttvar_ 0 ;                #
mean deviation of rtt samples
Agent/TCP set backoff_ 0 ;                # current RTO backoff factor
Agent/TCP set maxseq_ 0 ;                # max (packet) seq number sent


# set up TCP-level connections

$sink listen ;                # will figure out who its peer is

$src set window_ 100;

The creation of the FullTcp agent is similar to the other agents, but the sink is placed in a listening state by the listen method. Because a handle to the receiving side is required in order to make this call, the create-connection call used above cannot be used.


TCP 연결 예제 TCL

set tcp [new Agent/TCP] ;                         # create tcp agent
$ns_ attach-agent $node_(s1) $tcp ;           # bind src to node
$tcp set fid_ 0 ;                                         # set flow ID field
set ftp [new Application/FTP] ;                  # create ftp traffic
$ftp attach-agent $tcp ;                             # bind ftp traffic to tcp agent
set sink [new Agent/TCPSink] ;                # create tcpsink agent
$ns_ attach-agent $node_(k1) $sink ;         # bind sink to node
$sink set fid_ 0 ;                                       # set flow ID field
$ns_ connect $ftp $sink ;                          # active connection src to sink
$ns_ at $start-time "$ftp start" ;                  # start ftp flow

2. UDP

Agent/UDP와 agent/NULL을 한 쌍으로 함


[ Application ]

패킷 보내기

파라미터 정보 ./ns/tcl/lib/ns-default.tcl

CBR의 정보 : 교재 413p
(교재 : 배성수, "네트워크 시뮬레이터", 세화,2005)

1. Exponential

Exponential On/Off An Exponential On/Off object is embodied in the OTcl class Application/Traffic/Exponential. The

member variables that parameterize this object are:


packetSize_         the constant size of the packets generated
burst_time_         the average "on" time for the generator
idle_time_         the average "off" time for the generator
rate_             the sending rate during "on" times

Hence a new Exponential On/Off traffic generator can be created and parameterized as follows:

set e [new Application/Traffic/Exponential]
$e set packetSize_ 210
$e set burst_time_ 500ms
$e set idle_time_ 500ms
$e set rate_ 100k

NOTE: The Exponential On/Off generator can be configured to behave as a Poisson process by setting the variable burst_time_ to 0 and the variable rate_ to a very large value. The C++ code guarantees that even if the burst time is zero, at least one packet is sent. Additionally, the next interarrival time is the sum of the assumed packet transmission time (governed by the variable rate_) and the random variate corresponding to idle_time_. Therefore, to make the first term in the sum very small, make the burst rate very large so that the transmission time is negligible compared to the typical idle times.



2. CBR

A CBR object is embodied in the OTcl class Application/Traffic/CBR. The member variables that parameterize this

object are:

rate_         the sending rate
interval_     (Optional) interval between packets
packetSize_     the constant size of the packets generated
random_     flag indicating whether or not to introduce random "noise" in the scheduled departure times (default is off)
maxpkts_     the maximum number of packets to send (default is (228)

Hence a new CBR traffic generator can be created and parameterized as follows:

set e [new Application/Traffic/CBR]
$e set packetSize_ 48
$e set rate_ 64Kb
$e set random_ 1

The setting of a CBR object's rate_ and interval_ are mutually exclusive (the interval between packets is maintained as an interval variable in C++, and some example ns scripts specify an interval rather than a rate). In a simulation, either a rate or an interval (but not both) should be specified for a CBR object.



-예제 ?

set src [new Agent/UDP]
set sink [new Agent/UDP]
$ns_ attach-agent $node_(s1) $src
$ns_ attach-agent $node_(k1) $sink
$ns_ connect $src $sink

set e [new Application/Traffic/Exponential]
$e attach-agent $src
$e set packetSize_ 210
$e set burst_time_ 500ms
$e set idle_time_ 500ms
$e set rate_ 100k
$ns_ at 0.0 "$e start"



[Tips]


tr파일로 그래프 그리기

  raw2xg ?a xxx.tr > xxx.out

  xgraph xxx.out


nam. Tr. 파일 일괄 삭제 하는 스크립트 : Makefile 로 저장하기

[code type=c]

  default: clean

  clean:

      rm -f *~ *.tr *.nam

[/code]

정리 : 2006.12.11 by 임헌정
http://www.4ellene.net

2006/12/14 04:43 2006/12/14 04:43
TAG
Trackback address :: http://4ellene.net/tt/trackback/1071
  1. poker chips

    Tracked from full tilt poker 2009/03/30 16:04  삭제

    party poker

  2. Tracked from rape hentai 2009/04/13 04:22  삭제

    rape girls

  3. Tracked from extreme anal 2009/04/13 14:46  삭제

    breast torture extreme

  4. brutal rape

    Tracked from brutal rape pics 2009/04/14 12:31  삭제

    brother sister rape

  5. bondage cafe

    Tracked from bondage clips 2009/04/15 02:19  삭제

    bondage blowjob

  6. bondage porn

    Tracked from bondage rape 2009/04/15 09:00  삭제

    bondage pictures

  7. bdsm for all

    Tracked from bdsm free 2009/04/15 10:44  삭제

    bdsm fiction

  8. marital rape case

    Tracked from rape trailers 2009/06/29 07:52  삭제

    brutal anal sex

  9. teen forced sex

    Tracked from brutal face fuck 2009/06/29 18:00  삭제

    porn rape scene

  10. sister rape

    Tracked from rape forced sex 2009/06/29 18:22  삭제

    forced sex

  11. man rape gay porn

    Tracked from porn hawaiian rape 2009/06/30 01:20  삭제

    forced sex trailers

  12. extreme board rape

    Tracked from forced to eat cum 2009/06/30 10:21  삭제

    rape incest porn

  13. sex rape

    Tracked from rape gallery 2009/06/30 10:31  삭제

    porno rape

  14. lesbian forced sex

    Tracked from rape prevention 2009/06/30 12:37  삭제

    toon rape

  15. movie rape scenes

    Tracked from rape scene in porn 2009/06/30 20:45  삭제

    forced anal

  16. college rape

    Tracked from simulated rape 2009/07/01 03:19  삭제

    brutal fisting

  17. how to rape

    Tracked from rape clips 2009/07/01 12:52  삭제

    young teen rape

  18. rape fantasy porn

    Tracked from rape club 2009/07/01 14:38  삭제

    rape images

  19. violent rape stories

    Tracked from forced incest 2009/07/02 11:58  삭제

    forced porn

  20. father rapes daughter

    Tracked from hot rape 2009/07/02 22:56  삭제

    lesbian rape stories

  21. rape cartoons

    Tracked from father rapes daughter 2009/07/03 11:27  삭제

    rape hentai

  22. forced porn

    Tracked from marital rape 2009/07/03 17:50  삭제

    baby rape

  23. rape toons

    Tracked from incest rape 2009/07/05 18:07  삭제

    sexy rape

  24. rape asain

    Tracked from rape victims 2009/07/06 04:23  삭제

    gang rapes

  25. poker games online

    Tracked from casino web sites 2009/07/10 03:07  삭제

    casino poker game online

  26. web casino

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

    online casino slot

  27. live online poker

    Tracked from casino games http 2009/07/11 12:15  삭제

    online gambling casinos

  28. top casino

    Tracked from online casino guide 2009/07/11 18:43  삭제

    tops casino

  29. u s online casino

    Tracked from online casinos with freeroll slot tournaments 2009/07/12 03:25  삭제

    casino free online

  30. casinos online internet

    Tracked from online casino games 2009/07/12 14:25  삭제

    best online casino

  31. play casino games online

    Tracked from free online casino games 2009/07/12 19:30  삭제

    online casino no depost

  32. online casino slot

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

    free online casino gaming

  33. usa casinos

    Tracked from free online casino game 2009/07/13 18:04  삭제

    casino gamble

  34. free online casino cash

    Tracked from u s online casino 2009/07/13 18:19  삭제

    online casino for south dakota

  35. online casino open to usa

    Tracked from new online casino 2009/07/14 06:45  삭제

    free online casino

  36. new online casino

    Tracked from casino poker game online 2009/07/14 07:08  삭제

    internet casino

  37. internet casino gambling

    Tracked from online usa casinos 2009/07/14 18:29  삭제

    u s online casino

  38. casino sites

    Tracked from internet casino gambling 2009/07/15 04:22  삭제

    usa casino gaming

  39. casino on the net

    Tracked from online casino gambling 2009/07/15 11:31  삭제

    casinos

  40. casino poker game online

    Tracked from 1 hour free us online casinos 2009/07/15 17:31  삭제

    us online casino

  41. online casinos accepting us players

    Tracked from online casino poker 2009/07/16 02:17  삭제

    online download casino games blackjack

  42. casino directory

    Tracked from new online casinos 2009/07/16 03:26  삭제

    online casino bonus

  43. casino gaming online

    Tracked from casino on the net 2009/07/16 19:56  삭제

    online casino games for mac

  44. casino web sites

    Tracked from casino directory 2009/07/17 06:04  삭제

    online casino bonus

  45. usa casinos

    Tracked from free online casino chip 2009/07/17 06:24  삭제

    online casino gambling

  46. casino http

    Tracked from internet casino gambling online 2009/07/17 17:06  삭제

    casino website

  47. play casino games online

    Tracked from casino websites 2009/07/17 18:55  삭제

    1 hour free us online casinos

  48. play casino online

    Tracked from play free casino games 2009/07/17 21:07  삭제

    topgame online casinos

  49. online casino us players

    Tracked from casino casinos online 2009/07/18 05:17  삭제

    casino supplies

  50. online casinos win bonus

    Tracked from no deposit online usa casion 2009/07/18 20:31  삭제

    online kasino

  51. virtual casino

    Tracked from online casinos no deposit bonus 2009/07/19 01:59  삭제

    online casino guide

  52. casino supplies

    Tracked from online betting casinos 2009/07/19 03:10  삭제

    online casino no deposit bonus

  53. top casino

    Tracked from international online casinos 2009/07/19 21:54  삭제

    play casino games online

  54. tranny slut

    Tracked from transvestite lingerie 2009/07/21 06:40  삭제

    beautiful transexuals

  55. futanari girl

    Tracked from ladyboy movies 2009/07/21 07:54  삭제

    ladyboy crush

  56. shemale fucking

    Tracked from shemale bondage 2009/07/21 09:20  삭제

    transvestites in bondage

  57. asian ladyboy

    Tracked from ladyboys galleries 2009/07/21 15:34  삭제

    shemale

  58. post op transexual pics

    Tracked from sexy ladyboy 2009/07/22 14:33  삭제

    shemale movies

  59. tranny gallery

    Tracked from hung ladyboys 2009/07/22 15:37  삭제

    ladyboy stories

  60. japanese ladyboy

    Tracked from shemale tube 2009/07/22 21:44  삭제

    hot transexuals

  61. transexual galleries

    Tracked from black ladyboys 2009/07/22 22:09  삭제

    transexual doll

  62. filipino ladyboys

    Tracked from black transexual 2009/07/23 06:10  삭제

    futanari fiction

  63. shemale cocktail

    Tracked from shemale cumshots 2009/07/23 21:34  삭제

    ladyboy crush

  64. ladyboy hardcore

    Tracked from japan futanari teens 2009/07/24 04:14  삭제

    futanari games

  65. brazil free sex transexual

    Tracked from shemale fucks guy 2009/07/24 05:19  삭제

    ladyboy nancy

  66. ladyboy anal sex

    Tracked from transvestite gallery 2009/07/24 17:02  삭제

    blonde ladyboy

  67. shemale vanity

    Tracked from transexual women 2009/07/25 07:19  삭제

    cum eating transvestite sissies

  68. mom and daughter

    Tracked from mother daughter fuck 2009/09/06 01:36  삭제

    mom licks daughter

  69. fathers fucking daughters

    Tracked from dad fucking virgin daughter 2009/09/06 03:43  삭제

    father fucks daughter

  70. mom son fucking

    Tracked from mom mature son gallery 2009/09/06 10:05  삭제

    mom son sex

  71. family nudist galleries

    Tracked from family nude 2009/09/06 10:56  삭제

    family orgy

  72. incest art

    Tracked from incest cartoons 2009/09/06 11:08  삭제

    lesbian incest

  73. incest pictures

    Tracked from incest stories 2009/09/07 01:54  삭제

    incest pics

  74. mother daughter sex

    Tracked from lesbian incest 2009/09/07 09:03  삭제

    mother daughter incest

  75. incest sex

    Tracked from Cartoon Incest 2009/09/08 05:42  삭제

    incest stories

  76. incest cartoon

    Tracked from incest art 2009/09/08 11:40  삭제

    incest comics

  77. dad fucking daughter

    Tracked from daughter incest incest 2009/09/08 20:28  삭제

    dad fucks daughter

  78. dad fucks daughter

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

    dad and daughter incest

  79. mother sucks son

    Tracked from mother son sex 2009/09/09 11:31  삭제

    my sisters hot friend

  80. incest cartoon

    Tracked from 3d incest 2009/09/09 20:34  삭제

    incest hentai

  81. mother daughter fuck

    Tracked from moms fucking sons 2009/09/09 22:39  삭제

    mother daughter incest

  82. domination stories

    Tracked from domination porn 2009/09/11 01:39  삭제

    drawing torture

  83. domination training

    Tracked from domination stories 2009/09/11 05:48  삭제

    drawing torture

  84. bdsm movies

    Tracked from bdsm humiliation 2009/09/11 06:06  삭제

    bdsm mpegs

  85. bondage cafe

    Tracked from bondage blowjob 2009/09/12 04:08  삭제

    bondage clips

  86. xxx bondage

    Tracked from worst tortures 2009/09/12 10:16  삭제

    amateur bdsm

  87. tit bondage

    Tracked from tickling torture 2009/09/12 12:02  삭제

    toilet domination

  88. bdsm training

    Tracked from bdsm toys 2009/09/12 14:21  삭제

    bdsm tube

  89. anime bondage

    Tracked from anime bdsm 2009/09/13 00:10  삭제

    asian bdsm

  90. bondage anal

    Tracked from bondage 2009/09/14 08:32  삭제

    bondage and discipline

  91. bdsm comics

    Tracked from bdsm collars 2009/09/14 11:27  삭제

    bdsm couples

  92. bondage fuck

    Tracked from bondage fix 2009/09/15 16:31  삭제

    bondage fucking

  93. cock bondage

    Tracked from cock ball torture 2009/09/15 17:47  삭제

    corset torture story

  94. asian bondage

    Tracked from asian bdsm 2009/09/16 15:36  삭제

    ass torture

  95. Free Mom And Son Sex

    Tracked from mom and son sex 2009/09/28 11:54  삭제

    Mom Mature Son Gallery

  96. anime incest

    Tracked from comics incest 2009/09/29 12:17  삭제

    free cartoon incest

  97. father daughter incest

    Tracked from family sex clips 2009/09/29 13:31  삭제

    father daughter sex

  98. free incest

    Tracked from family incest 2009/10/02 15:29  삭제

    Free Incest Sex Stories

  99. family sex

    Tracked from young incest 2009/10/02 22:47  삭제

    family incest

  100. mom strips for son

    Tracked from mom son sex 2009/10/03 08:07  삭제

    moms fucking sons

  101. dad fucking virgin daughter

    Tracked from dad with sis son sex mom 2009/10/04 07:05  삭제

    dad and daughter

  102. twin sister sex

    Tracked from teen incest 2009/10/04 11:05  삭제

    twin sisters fucking

  103. bondage watch

    Tracked from bondage wizard 2009/10/20 03:39  삭제

    breast bondage

  104. bondage sex

    Tracked from bondage slave 2009/10/20 07:55  삭제

    bondage stories

  105. bdsm training

    Tracked from bdsm tube 2009/10/20 09:36  삭제

    bdsm video

  106. hardcore bondage

    Tracked from hentai bondage 2009/10/21 08:58  삭제

    hogtied bondage

  107. bondage pictures

    Tracked from bondage porn 2009/10/21 18:36  삭제

    bondage rape

  108. bondage directory

    Tracked from bondage fairies 2009/10/22 15:13  삭제

    bondage fuck

  109. bdsm bound

    Tracked from bdsm cafe 2009/10/23 08:42  삭제

    bdsm cartoons

  110. bondage wizard

    Tracked from breast bondage 2009/10/23 11:52  삭제

    celebrity bondage

  111. bdsm vids

    Tracked from black bdsm 2009/10/23 18:13  삭제

    ebony bdsm

  112. pharmacy diclofex no prescription

    Tracked from buying online buy diclofex 2010/11/28 04:22  삭제

    diclofenac order cheap mexico

  113. illegal rape

    Tracked from granny gets raped video 2011/01/06 18:44  삭제

    gay anal rape

  114. fantasy rape clips

    Tracked from white wives forced to fuck black cock 2011/01/07 04:24  삭제

    asian girles raped movies

  115. outdoor rape

    Tracked from animal extreme sex 2011/01/07 21:08  삭제

    forced to fuck lolita

  116. extreme porn search

    Tracked from teen forced sex 2011/01/08 07:14  삭제

    rape anime

  117. extreme porn tubes

    Tracked from forced throat fuck 2011/01/08 12:56  삭제

    young girls forced fucking

  118. woman being raped

    Tracked from extreme rape fucking 2011/01/10 14:54  삭제

    free roped and raped stories

  119. extreme free porn

    Tracked from sex forced 2011/01/12 06:33  삭제

    forced sex comics

  120. hills have eyes 2 rape scene

    Tracked from hardcore rape videos 2011/01/12 10:13  삭제

    brutal forced sex

Comments List

  1. men wear thong underwear 2008/05/23 05:03

    嫄몄

  2. giantess buttman 2008/05/24 00:13

  3. dvd s m bondage extreme 2008/05/24 00:22

  4. do-hyun lim 2008/11/24 00:30

    잘보고 갑니다. 퍼갈께요 ^^
    좋은 하루 되시길..

Write a comment.

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