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.

• sequence numbers are in bytes r<strong>at</strong>her than packets<strong>The</strong> gener<strong>at</strong>ion of SYN packets (<strong>and</strong> their ACKs) can be of critical importance in trying to model real-world behavior whenusing many very short d<strong>at</strong>a tra<strong>ns</strong>fers. This version of TCP currently defaults to sending d<strong>at</strong>a on the 3rd segment of an initial 3-way h<strong>and</strong>shake, a behavior somewh<strong>at</strong> different than common real-world TCP implement<strong>at</strong>io<strong>ns</strong>. A “typical” TCP connectionproceeds with an active opener sending a SYN, the passive opener responding with a SYN+ACK, the active opener respondingwith an ACK, <strong>and</strong> then some time l<strong>at</strong>er sending the first segment with d<strong>at</strong>a (corresponding to the first applic<strong>at</strong>ion write). Thus,this version of TCP sends d<strong>at</strong>a <strong>at</strong> a time somewh<strong>at</strong> earlier than typical implement<strong>at</strong>io<strong>ns</strong>. This TCP can also be configured tosend d<strong>at</strong>a on the initial SYN segment. Future changes to FullTCP may include a modific<strong>at</strong>ion to send the first d<strong>at</strong>a segmentl<strong>at</strong>er, <strong>and</strong> possibly to implement T/TCP functionality.Currently FullTCP is only implemented with Reno congestion control, but ultim<strong>at</strong>ely it should be available with the full rangeof congestion control algorithms (e.g., Tahoe, SACK, Vegas, etc.).34.3.1 Simple Configur<strong>at</strong>ionRunning an Full TCP simul<strong>at</strong>ion requires cre<strong>at</strong>ing <strong>and</strong> configuring the agent, <strong>at</strong>taching an applic<strong>at</strong>ion-level d<strong>at</strong>a source (<strong>at</strong>raffic gener<strong>at</strong>or), <strong>and</strong> starting the agent <strong>and</strong> the traffic gener<strong>at</strong>or.Cre<strong>at</strong>ing the Agent# set up connection (do not use "cre<strong>at</strong>e-connection" method because# we need a h<strong>and</strong>le on the sink object)set src [new Agent/TCP/FullTcp]set sink [new Agent/TCP/FullTcp]$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(s1) $src$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(k1) $sink$src set fid_ 0$sink set fid_ 0$<strong>ns</strong>_ connect $src $sink# set up TCP-level connectio<strong>ns</strong>$sink listen$src set window_ 100;;# cre<strong>at</strong>e agent;# cre<strong>at</strong>e agent;# bind src to node;# bind sink to node;# set flow ID field;# set flow ID field;# active connection src to sink;# will figure out who its peer is<strong>The</strong> cre<strong>at</strong>ion of the FullTcp agent is similar to the other agents, but the sink is placed in a listening st<strong>at</strong>e by the listenmethod. Because a h<strong>and</strong>le to the receiving side is required in order to make this call, the cre<strong>at</strong>e-connection call usedabove cannot be used.Configur<strong>at</strong>ion Parameters<strong>The</strong> following configur<strong>at</strong>ion parameters are available through Tcl for the FullTcp agent:Agent/TCP/FullTcp set segsperack_ 1Agent/TCP/FullTcp set segsize_ 536Agent/TCP/FullTcp set tcprexmtthresh_ 3Agent/TCP/FullTcp set iss_ 0Agent/TCP/FullTcp set nodelay_ falseAgent/TCP/FullTcp set d<strong>at</strong>a_on_syn_ false;# segs received before gener<strong>at</strong>ing ACK;# segment size (MSS size for bulk xfers);# dupACKs thresh to trigger fast rexmt;# initial send sequence number;# disable sender-side Nagle algorithm;# send d<strong>at</strong>a on initial SYN?293

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

Saved successfully!

Ooh no, something went wrong!