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.

34.1 One-Way TCP Senders<strong>The</strong> simul<strong>at</strong>or supports several versio<strong>ns</strong> of an abstracted TCP sender. <strong>The</strong>se objects <strong>at</strong>tempt to capture the essence of the TCPcongestion <strong>and</strong> error control behaviors, but are not intended to be faithful replicas of real-world TCP implement<strong>at</strong>io<strong>ns</strong>. <strong>The</strong>ydo not contain a dynamic window advertisement, they do segment number <strong>and</strong> ACK number comput<strong>at</strong>io<strong>ns</strong> entirely in packetunits, there is no SYN/FIN connection establishment/teardown, <strong>and</strong> no d<strong>at</strong>a is ever tra<strong>ns</strong>ferred (e.g. no checksums or urgentd<strong>at</strong>a).34.1.1 <strong>The</strong> Base TCP Sender (Tahoe TCP)<strong>The</strong> “Tahoe” TCP agent Agent/TCP performs congestion control <strong>and</strong> round-trip-time estim<strong>at</strong>ion in a way similar to theversion of TCP released with the 4.3BSD “Tahoe” UN’X system release from UC Berkeley. <strong>The</strong> congestion window is1increased by one packet per new ACK received during slow-start (when cwnd_ < ssthresh_) <strong>and</strong> is increased bycwnd_ foreach new ACK received during congestion avoidance (when cwnd_ ≥ ssthresh_).Respo<strong>ns</strong>es to Congestion Tahoe TCP assumes a packet has been lost (due to congestion) when it observes NUMDUPACKS(defined in tcp.h, currently 3) duplic<strong>at</strong>e ACKs, or when a retra<strong>ns</strong>mission timer expires. In either case, Tahoe TCP reacts bysetting ssthresh_ to half of the current window size (the minimum of cwnd_ <strong>and</strong> window_) or 2, whichever is larger. Itthen initializes cwnd_ back to the value of windowInit_. This will typically cause the TCP to enter slow-start.Round-Trip Time Estim<strong>at</strong>ion <strong>and</strong> RTO Timeout Selection Four variables are used to estim<strong>at</strong>e the round-trip time<strong>and</strong> set the retra<strong>ns</strong>mission timer: rtt_, srtt_, rttvar_, tcpTick_, <strong>and</strong> backoff_. TCP initializes rttvarto 3/tcpTick_ <strong>and</strong> backoff to 1. When any future retra<strong>ns</strong>mission timer is set, it’s timeout is set to the current time plusmax(bt(a + 4v + 1), 64) seconds, where b is the current backoff value, t is the value of tcpTick, a is the value of srtt, <strong>and</strong> vis the value of rttvar.Round-trip time samples arrive with new ACKs. <strong>The</strong> RTT sample is computed as the difference between the current time <strong>and</strong>a “time echo” field in the ACK packet. When the first sample is taken, its value is used as the initial value for srtt_. Halfthe first sample is used as the initial value for rttvar_. For subsequent samples, the values are upd<strong>at</strong>ed as follows:srtt = 7 8 × srtt + 1 8 × samplerttvar = 3 4 × rttvar + 1 × |sample − srtt|434.1.2 Configur<strong>at</strong>ionRunning an 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 (a trafficgener<strong>at</strong>or), <strong>and</strong> starting the agent <strong>and</strong> the traffic gener<strong>at</strong>or.34.1.3 Simple Configur<strong>at</strong>ionCre<strong>at</strong>ing the Agent289

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

Saved successfully!

Ooh no, something went wrong!