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.

21.2 Implement<strong>at</strong>ion of XCP in NSIn <strong>ns</strong>, the XCP implement<strong>at</strong>ion can be found under ~<strong>ns</strong>/xcp directory. <strong>The</strong> protocol needs to be deployed in the TCP endpoints (source <strong>and</strong> receiver) as well within the intermedi<strong>at</strong>e nodes which is mostly the router <strong>and</strong> may sometimes be a linklayerswitch as well. <strong>The</strong> end-point part of XCP code may be found under xcp-end-sys.cc,h <strong>and</strong> the router portion of the codemay be found under xcp.cc,h <strong>and</strong> xcpq.cc,h.21.2.1 Endpoints in XCP<strong>The</strong> end points co<strong>ns</strong>ist of TCP source <strong>and</strong> sink agents using XCP as their congestion control mechanism. <strong>The</strong> intermedi<strong>at</strong>enode or router writes feedback in each packet header as the delta_throughput value, about the d<strong>at</strong>a capacity th<strong>at</strong> may be incrementedif feedback is positive <strong>and</strong> should be decreased if neg<strong>at</strong>ive. When this packet reaches the receiver this delta_throughputvalue is returned to the sender in a reverse_feedback field of a congestion header in the returning packet, which is an ACKpacket in case of TCP.<strong>The</strong> sender upon receiving this reverse_feedback value adjusts its sending r<strong>at</strong>e by increasing or decreasing its congestionwindow size as the case maybe.<strong>The</strong> packet header th<strong>at</strong> is used by XCP is implemented as a structure called hdr_xcp in <strong>ns</strong> <strong>and</strong> is defined as follows:double x_; // idealized inter-packet timedouble rtt_;enum {XCP_DISABLED = 0,XCP_ENABLED,XCP_ACK,} xcp_enabled_; // to indic<strong>at</strong>e th<strong>at</strong> the flow is XCP enabledint xcpId_; // Sender’s ID (debugging only)double cwnd_; // <strong>The</strong> current window (debugging only)double reverse_feedback_;// --- Initialized by source <strong>and</strong> Upd<strong>at</strong>ed by Routerdouble delta_throughput_;u<strong>ns</strong>igned int controlling_hop_;// router ID (debugging only)<strong>The</strong> xcp receiver is respo<strong>ns</strong>ible for copying the delta_throughput value into the reverse_feedback field of the ack packets. I<strong>ns</strong>ome cases where delayed ack is used, the receiver calcul<strong>at</strong>es the sum of the delta_throughput values in arriving packets forcopying into the reverse_feedback field of the outgoing ack packet.<strong>The</strong> controlling_hop_ field th<strong>at</strong> carries the address of the router who has last upd<strong>at</strong>ed the feedback is used for debuggingpurposes only.In case of a packet loss in the network, TCP’s Van Jacobson congestion control should most likely override XCP. Howeverin <strong>ns</strong>this happe<strong>ns</strong> a little differently. With receiving of duplic<strong>at</strong>e acks indic<strong>at</strong>ing packet loss, the cwnd gets halved <strong>and</strong> fastretra<strong>ns</strong>mit <strong>and</strong> fast recovery algorithms come into play. However xcp routers continue to send feedback to the source based onwhich the source tries to open its cwnd. So it seems to be a mish-mash of VJCC <strong>and</strong> XCP algorithms. However for most casesthis issue doesnot arise as XCP router very rarely experiences a pkt drop as the queue is continuously regul<strong>at</strong>ed <strong>and</strong> drainedby XCP. Underst<strong>and</strong>ing the correct behaviour of XCP in face of pkt loss is an area of current study <strong>and</strong> shall be implementedin the future.202

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

Saved successfully!

Ooh no, something went wrong!