노드 생성 : 네트워크 계층까지 완료(=토폴로지만 완성), 전송 계층 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]
- create-connection 함수의 의미
- TCP : 송신 에이젼트
- $node1 : 송신 노드 (souce node)
- TCPSink : 수신 에이젼트
- $node2 : 수신 노드
-
42 : flow ID
[방법 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
Trackback address :: http://4ellene.net/tt/trackback/1071
-
Tracked from full tilt poker
2009/03/30 16:04
삭제
party poker
-
Tracked from rape hentai
2009/04/13 04:22
삭제
rape girls
-
Tracked from extreme anal
2009/04/13 14:46
삭제
breast torture extreme
-
Tracked from brutal rape pics
2009/04/14 12:31
삭제
brother sister rape
-
Tracked from bondage clips
2009/04/15 02:19
삭제
bondage blowjob
-
Tracked from bondage rape
2009/04/15 09:00
삭제
bondage pictures
-
Tracked from bdsm free
2009/04/15 10:44
삭제
bdsm fiction
-
Tracked from rape trailers
2009/06/29 07:52
삭제
brutal anal sex
-
Tracked from brutal face fuck
2009/06/29 18:00
삭제
porn rape scene
-
Tracked from rape forced sex
2009/06/29 18:22
삭제
forced sex
-
Tracked from porn hawaiian rape
2009/06/30 01:20
삭제
forced sex trailers
-
Tracked from forced to eat cum
2009/06/30 10:21
삭제
rape incest porn
-
Tracked from rape gallery
2009/06/30 10:31
삭제
porno rape
-
Tracked from rape prevention
2009/06/30 12:37
삭제
toon rape
-
Tracked from rape scene in porn
2009/06/30 20:45
삭제
forced anal
-
Tracked from simulated rape
2009/07/01 03:19
삭제
brutal fisting
-
Tracked from rape clips
2009/07/01 12:52
삭제
young teen rape
-
Tracked from rape club
2009/07/01 14:38
삭제
rape images
-
Tracked from forced incest
2009/07/02 11:58
삭제
forced porn
-
Tracked from hot rape
2009/07/02 22:56
삭제
lesbian rape stories
-
Tracked from father rapes daughter
2009/07/03 11:27
삭제
rape hentai
-
Tracked from marital rape
2009/07/03 17:50
삭제
baby rape
-
Tracked from incest rape
2009/07/05 18:07
삭제
sexy rape
-
Tracked from rape victims
2009/07/06 04:23
삭제
gang rapes
-
Tracked from casino web sites
2009/07/10 03:07
삭제
casino poker game online
-
Tracked from online casinos accepting usa deposits
2009/07/10 22:22
삭제
online casino slot
-
Tracked from casino games http
2009/07/11 12:15
삭제
online gambling casinos
-
Tracked from online casino guide
2009/07/11 18:43
삭제
tops casino
-
Tracked from online casinos with freeroll slot tournaments
2009/07/12 03:25
삭제
casino free online
-
Tracked from online casino games
2009/07/12 14:25
삭제
best online casino
-
Tracked from free online casino games
2009/07/12 19:30
삭제
online casino no depost
-
Tracked from online casino no deposit
2009/07/13 01:59
삭제
free online casino gaming
-
Tracked from free online casino game
2009/07/13 18:04
삭제
casino gamble
-
Tracked from u s online casino
2009/07/13 18:19
삭제
online casino for south dakota
-
Tracked from new online casino
2009/07/14 06:45
삭제
free online casino
-
Tracked from casino poker game online
2009/07/14 07:08
삭제
internet casino
-
Tracked from online usa casinos
2009/07/14 18:29
삭제
u s online casino
-
Tracked from internet casino gambling
2009/07/15 04:22
삭제
usa casino gaming
-
Tracked from online casino gambling
2009/07/15 11:31
삭제
casinos
-
Tracked from 1 hour free us online casinos
2009/07/15 17:31
삭제
us online casino
-
Tracked from online casino poker
2009/07/16 02:17
삭제
online download casino games blackjack
-
Tracked from new online casinos
2009/07/16 03:26
삭제
online casino bonus
-
Tracked from casino on the net
2009/07/16 19:56
삭제
online casino games for mac
-
Tracked from casino directory
2009/07/17 06:04
삭제
online casino bonus
-
Tracked from free online casino chip
2009/07/17 06:24
삭제
online casino gambling
-
Tracked from internet casino gambling online
2009/07/17 17:06
삭제
casino website
-
Tracked from casino websites
2009/07/17 18:55
삭제
1 hour free us online casinos
-
Tracked from play free casino games
2009/07/17 21:07
삭제
topgame online casinos
-
Tracked from casino casinos online
2009/07/18 05:17
삭제
casino supplies
-
Tracked from no deposit online usa casion
2009/07/18 20:31
삭제
online kasino
-
Tracked from online casinos no deposit bonus
2009/07/19 01:59
삭제
online casino guide
-
Tracked from online betting casinos
2009/07/19 03:10
삭제
online casino no deposit bonus
-
Tracked from international online casinos
2009/07/19 21:54
삭제
play casino games online
-
Tracked from transvestite lingerie
2009/07/21 06:40
삭제
beautiful transexuals
-
Tracked from ladyboy movies
2009/07/21 07:54
삭제
ladyboy crush
-
Tracked from shemale bondage
2009/07/21 09:20
삭제
transvestites in bondage
-
Tracked from ladyboys galleries
2009/07/21 15:34
삭제
shemale
-
Tracked from sexy ladyboy
2009/07/22 14:33
삭제
shemale movies
-
Tracked from hung ladyboys
2009/07/22 15:37
삭제
ladyboy stories
-
Tracked from shemale tube
2009/07/22 21:44
삭제
hot transexuals
-
Tracked from black ladyboys
2009/07/22 22:09
삭제
transexual doll
-
Tracked from black transexual
2009/07/23 06:10
삭제
futanari fiction
-
Tracked from shemale cumshots
2009/07/23 21:34
삭제
ladyboy crush
-
Tracked from japan futanari teens
2009/07/24 04:14
삭제
futanari games
-
Tracked from shemale fucks guy
2009/07/24 05:19
삭제
ladyboy nancy
-
Tracked from transvestite gallery
2009/07/24 17:02
삭제
blonde ladyboy
-
Tracked from transexual women
2009/07/25 07:19
삭제
cum eating transvestite sissies
-
Tracked from mother daughter fuck
2009/09/06 01:36
삭제
mom licks daughter
-
Tracked from dad fucking virgin daughter
2009/09/06 03:43
삭제
father fucks daughter
-
Tracked from mom mature son gallery
2009/09/06 10:05
삭제
mom son sex
-
Tracked from family nude
2009/09/06 10:56
삭제
family orgy
-
Tracked from incest cartoons
2009/09/06 11:08
삭제
lesbian incest
-
Tracked from incest stories
2009/09/07 01:54
삭제
incest pics
-
Tracked from lesbian incest
2009/09/07 09:03
삭제
mother daughter incest
-
Tracked from Cartoon Incest
2009/09/08 05:42
삭제
incest stories
-
Tracked from incest art
2009/09/08 11:40
삭제
incest comics
-
Tracked from daughter incest incest
2009/09/08 20:28
삭제
dad fucks daughter
-
Tracked from dad fucking daughter
2009/09/09 01:15
삭제
dad and daughter incest
-
Tracked from mother son sex
2009/09/09 11:31
삭제
my sisters hot friend
-
Tracked from 3d incest
2009/09/09 20:34
삭제
incest hentai
-
Tracked from moms fucking sons
2009/09/09 22:39
삭제
mother daughter incest
-
Tracked from domination porn
2009/09/11 01:39
삭제
drawing torture
-
Tracked from domination stories
2009/09/11 05:48
삭제
drawing torture
-
Tracked from bdsm humiliation
2009/09/11 06:06
삭제
bdsm mpegs
-
Tracked from bondage blowjob
2009/09/12 04:08
삭제
bondage clips
-
Tracked from worst tortures
2009/09/12 10:16
삭제
amateur bdsm
-
Tracked from tickling torture
2009/09/12 12:02
삭제
toilet domination
-
Tracked from bdsm toys
2009/09/12 14:21
삭제
bdsm tube
-
Tracked from anime bdsm
2009/09/13 00:10
삭제
asian bdsm
-
Tracked from bondage
2009/09/14 08:32
삭제
bondage and discipline
-
Tracked from bdsm collars
2009/09/14 11:27
삭제
bdsm couples
-
Tracked from bondage fix
2009/09/15 16:31
삭제
bondage fucking
-
Tracked from cock ball torture
2009/09/15 17:47
삭제
corset torture story
-
Tracked from asian bdsm
2009/09/16 15:36
삭제
ass torture
-
Tracked from mom and son sex
2009/09/28 11:54
삭제
Mom Mature Son Gallery
-
Tracked from comics incest
2009/09/29 12:17
삭제
free cartoon incest
-
Tracked from family sex clips
2009/09/29 13:31
삭제
father daughter sex
-
Tracked from family incest
2009/10/02 15:29
삭제
Free Incest Sex Stories
-
Tracked from young incest
2009/10/02 22:47
삭제
family incest
-
Tracked from mom son sex
2009/10/03 08:07
삭제
moms fucking sons
-
Tracked from dad with sis son sex mom
2009/10/04 07:05
삭제
dad and daughter
-
Tracked from teen incest
2009/10/04 11:05
삭제
twin sisters fucking
-
Tracked from bondage wizard
2009/10/20 03:39
삭제
breast bondage
-
Tracked from bondage slave
2009/10/20 07:55
삭제
bondage stories
-
Tracked from bdsm tube
2009/10/20 09:36
삭제
bdsm video
-
Tracked from hentai bondage
2009/10/21 08:58
삭제
hogtied bondage
-
Tracked from bondage porn
2009/10/21 18:36
삭제
bondage rape
-
Tracked from bondage fairies
2009/10/22 15:13
삭제
bondage fuck
-
Tracked from bdsm cafe
2009/10/23 08:42
삭제
bdsm cartoons
-
Tracked from breast bondage
2009/10/23 11:52
삭제
celebrity bondage
-
Tracked from black bdsm
2009/10/23 18:13
삭제
ebony bdsm
-
Tracked from buying online buy diclofex
2010/11/28 04:22
삭제
diclofenac order cheap mexico
-
Tracked from granny gets raped video
2011/01/06 18:44
삭제
gay anal rape
-
Tracked from white wives forced to fuck black cock
2011/01/07 04:24
삭제
asian girles raped movies
-
Tracked from animal extreme sex
2011/01/07 21:08
삭제
forced to fuck lolita
-
Tracked from teen forced sex
2011/01/08 07:14
삭제
rape anime
-
Tracked from forced throat fuck
2011/01/08 12:56
삭제
young girls forced fucking
-
Tracked from extreme rape fucking
2011/01/10 14:54
삭제
free roped and raped stories
-
Tracked from sex forced
2011/01/12 06:33
삭제
forced sex comics
-
Tracked from hardcore rape videos
2011/01/12 10:13
삭제
brutal forced sex
Comments List
嫄몄
移
잘보고 갑니다. 퍼갈께요 ^^
좋은 하루 되시길..