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:
TCP WestwoodNR (TCP Westwood based on TCP NewReno) with installation instructions
(we suggest to use TCP WestwoodNR and compare it to the NewReno protocol)
TCP Westwood (TCP Westwood based on TCP Reno) with installation instructions
Other material:
Instructions to make TCPW modules compatible with future versions of NS-2
Older source code
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
tcp-westwood-nr.cc (for NS-2 version 2.1b8a only; see the COMPATIBILITY NOTES if you use other versions of NS-2)
tcp-westwood-nr.h
Installation Instructions
Get NS-2 version 2.1b8a
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)
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
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
?
Recompile NS-2
COMPATIBILITY NOTES for TCP WestwoodNR modules
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
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
tcp-westwood.cc (for NS-2 version 2.1b8a only; see the COMPATIBILITY NOTES if you use other versions of NS-2)
tcp-westwood.h
Installation Instructions
Get NS-2 version 2.1b8a ?
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)
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
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):
# 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
Recompile NS-2
COMPATIBILITY NOTES for TCP Westwood modules
The tcp-westwood.cc and tcp-westwood.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
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:
Get the new version of NS-2
Delete the old WestwoodTcpAgent::slowdown method that is inside tcp-westwood.cc
Copy the TcpAgent::slowdown(int how) method from the new tcp.cc into the file tcp-westwood.cc renaming the method WestwoodTcpAgent::slowdown(int how)
Put the following code between the conditions:
else if (how & CWND_HALF_WITH_MIN) {...}
and
else if (how & CLOSE_CWND_RESTART)
This is the code you have to insert:
///
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;
}
///
Now you have a new tcp-westwood.cc module that should be compatible with the new version of NS-2
Follow the installation instruction earlier in the page using this new module
Older source code
previous version of modified TCPW (with the "idle_interval bug"): tcp-westwood.cc, tcp-westwood.h
original TCP Westwood files from Casetti (to be used with NS-2 version 2.1b6):
tcp.cc
tcp.h
tcp-westwood.cc
and original Casetti's TCPW page
tcp.cc and tcp.h source files from 2.1b6 NS-2distribution
You can direct any questions to: tcpw-support@cs.ucla.edu - Last updated: 06/03/2002
评论1