UCLA Computer Science Department
High Performance Internet Lab

[ NRL > HPI Lab > TCPW > NS-2]

TCP WESTWOOD - Modules for NS-2

In this page you can find the TCP Westwood Modules for the NS-2 network simulator.

TCP Westwood modules for NS-2 come in two flavors:

Other material:

Support:

For any question about the NS-2 code, please contact: tcpw-support@cabernet.cs.ucla.edu?


TCP WestwoodNR (TCP Westwood with NewReno features)

NS-2 Modules

Installation Instructions

  1. Get NS-2 version 2.1b8a
  2. Add the modules tcp-westwood-nr.cc and tcp-westwood-nr.h to the main NS-2 directory (which is something like: ../ns-allinone-2.1b8a/ns-2.1b8a)

  3. Modify the Makefile so that it compiles and links the new module (i.e. add tcp-westwood-nr.o anywhere in the OBJ_CC? variable, for example near the other TCP related modules like tcp-newreno.o or tcp-vegas.o).?You can find the Makefile under the main NS-2 directory

  4. Add the following lines to ns-default.tcl (it can be found in the tcl/lib directory of the main NS-2 directory):


    # Added for TCP WestwoodNR
    Agent/TCP/WestwoodNR set current_bwe_ 0
    Agent/TCP/WestwoodNR set last_bwe_sample_ 0
    Agent/TCP/WestwoodNR set unaccounted_ 0
    Agent/TCP/WestwoodNR set fr_a_ 1
    Agent/TCP/WestwoodNR set min_rtt_estimate 10000
    Agent/TCP/WestwoodNR set myseqno_ 1

    Agent/TCP/WestwoodNR set lastackno_ 0
    Agent/TCP/WestwoodNR set lastackrx_ 0
    Agent/TCP/WestwoodNR set fr_alpha_ 0.9
    Agent/TCP/WestwoodNR set filter_type_ 3
    Agent/TCP/WestwoodNR set tau_ 1.0

    # setting this to 1 implements some changes to reno?
    # proposed by Janey Hoe (other than fixing reno's
    # unnecessary retransmit timeouts)
    Agent/TCP/WestwoodNR set newreno_changes_ 0
    # setting this to 1 allows the retransmit timer to expire for
    # a window with many packet drops
    Agent/TCP/WestwoodNR set newreno_changes1_ 0
    Agent/TCP/WestwoodNR set partial_window_deflation_ 0
    Agent/TCP/WestwoodNR set exit_recovery_fix_ 0

    ?
  5. Recompile NS-2

COMPATIBILITY NOTES for TCP WestwoodNR modules

  1. The tcp-westwood-nr.cc and tcp-westwood-nr.h files provided here have been tested with NS-2 version 2.1b8a only. We have not tested the implementation with other versions. Please report any incompatibility to tcpw-support@cabernet.cs.ucla.edu
  2. If you are using NS-2 version 2.1b6 then you MUST use this file: tcp-westwood-nr.cc.V21b6 instead (put it the main NS-2 directory and rename it to tcp-westwood-nr.cc, then recompile NS-2)

TCP Westwood

NS-2 Modules

Installation Instructions

  1. Get NS-2 version 2.1b8a ?
  2. Add the modules tcp-westwood.cc and tcp-westwood.h to the main NS-2 directory (which is something like: ../ns-allinone-2.1b8a/ns-2.1b8a)
  3. Modify the Makefile so that it compiles and links the new module (i.e. add tcp-westwood.o anywhere in the OBJ_CC? variable, for example near the other TCP related modules like tcp-newreno.o or? tcp-vegas.o).?You can find the Makefile under the main NS-2 directory
  4. Add the following lines at the end of ns-default.tcl (it can be found in the tcl/lib directory under the main NS-2 directory):

  5. # Added for TCP Westwood
    Agent/TCP/Westwood set current_bwe_ 0
    Agent/TCP/Westwood set last_bwe_sample_ 0
    Agent/TCP/Westwood set unaccounted_ 0
    Agent/TCP/Westwood set fr_a_ 1
    Agent/TCP/Westwood set min_rtt_estimate 10000
    Agent/TCP/Westwood set myseqno_ 1

    Agent/TCP/Westwood set lastackno_ 0
    Agent/TCP/Westwood set lastackrx_ 0
    Agent/TCP/Westwood set fr_alpha_ 0.9
    Agent/TCP/Westwood set filter_type_ 3
    Agent/TCP/Westwood set tau_ 1.0

  6. Recompile NS-2

COMPATIBILITY NOTES for TCP Westwood modules


Instructions to make TCPW modules compatible with future versions of NS-2

To make the TCPW modules compatible with future versions of NS-2 just do the following:

///
else if (how & CLOSE_FASTER) {
// TCP Westwood
// this might be critical what with the coarseness of the timer;
// keep in mind that TCP computes the timeout as
// (#of ticks) * (tick_duration)
// We need to do away with the coarseness...

double rtt_estimate = t_rtt_ * tcp_tick_;

if ((rtt_estimate < min_rtt_estimate)&&(rtt_estimate > 0)) {
min_rtt_estimate = rtt_estimate;
}
/* New adaptive BWE/a strategy */
if (ssthresh_ > cwnd_) {
/* loss has occurred while I was in slowstart */
fr_a_++;
if (fr_a_ > 4)
fr_a_=4;
} else {
/* loss has occurred while I was in congestion avoidance */
fr_a_ = 1;
}
ssthresh_ = (int)( ((current_bwe_/size_/8) * min_rtt_estimate)/fr_a_ );
cwnd_ = 1;
}
///


Older source code


You can direct any questions to: tcpw-support@cs.ucla.edu - Last updated: 06/03/2002