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.

Agent/TCP/FullTcp set dupseg_fix_ true;# avoid fast rxt due to dup segs+acksAgent/TCP/FullTcp set dupack_reset_ false ;# reset dupACK ctr on !0 len d<strong>at</strong>a segs containing dup ACKsAgent/TCP/FullTcp set interval_ 0.1;# as in TCP above, (100ms is non-std)34.3.2 BayFullTcpA different implement<strong>at</strong>ion of two-way TCP has been ported into <strong>ns</strong> from K<strong>at</strong>hy Nicholes/Van Jacobson’s group. It is calledBayFullTcp. <strong>The</strong> basic difference between BayFullTcp <strong>and</strong> FullTcp (the two-way tcp version already present in <strong>ns</strong>) are asfollows:• BayTcp supports a client-server applic<strong>at</strong>ion model while FullTcp makes no assumption about its applic<strong>at</strong>ion layer.• <strong>The</strong> tcp-applic<strong>at</strong>ion interface is different for both;• FullTcp supports partial ack (BayTcp doesn’t).• FullTcp supports different flavors of tcp (tahoe, reno etc) which is not the case for baytcp.• Both implement<strong>at</strong>io<strong>ns</strong> have different set of API’s .<strong>The</strong>re might be other finer differences between the two as well. One of our future pla<strong>ns</strong> is to redefine the APIs to allow fulltcpto use baytcp’s client-server model.34.4 Architecture <strong>and</strong> Internals<strong>The</strong> base TCP agent (class Agent/TCP) is co<strong>ns</strong>tructed as a collection of routines for sending packets, processing ACKs,managing the send window, <strong>and</strong> h<strong>and</strong>ling timeouts. Generally, each of these routines may be over-ridden by a function withthe same name in a derived class (this is how many of the TCP sender variants are implemented).<strong>The</strong> TCP header <strong>The</strong> TCP header is defined by the hdr_tcp structure in the file ~<strong>ns</strong>/tcp.h. <strong>The</strong> base agent only makesuse of the following subset of the fields:ts_ /* current time packet was sent from source */ts_echo_ /* for ACKs: timestamp field from packet associ<strong>at</strong>ed with this ACK */seqno_ /* sequence number for this d<strong>at</strong>a segment or ACK (Note: overloading!) */reason_ /* set by sender when (re)tra<strong>ns</strong>mitting to trace reason for send */Functio<strong>ns</strong> for Sending D<strong>at</strong>aNote th<strong>at</strong> generally the sending TCP never actually sends d<strong>at</strong>a (it only sets the packet size).send_much(force, reason, maxburst) - this function <strong>at</strong>tempts to send as many packets as the current sent window allows. Italso keeps track of how many packets it has sent, <strong>and</strong> limits to the total to maxburst.<strong>The</strong> function output(seqno, reason) sends one packet with the given sequence number <strong>and</strong> upd<strong>at</strong>es the maximumsent sequence number variable (maxseq_) to hold the given sequence number if it is the gre<strong>at</strong>est sent so far. This functionalso assig<strong>ns</strong> the various fields in the TCP header (sequence number, timestamp, reason for tra<strong>ns</strong>mission). This function alsosets a retra<strong>ns</strong>mission timer if one is not already pending.294

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

Saved successfully!

Ooh no, something went wrong!