User Manual, Developers Guide and API Documentation

SlowStart.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef TCP_SLOWSTART_HPP
00029 #define TCP_SLOWSTART_HPP
00030 
00031 
00032 #include <WNS/pyconfig/View.hpp>
00033 #include <WNS/logger/Logger.hpp>
00034 
00035 #include <TCP/CongestionControlStrategy.hpp>
00036 
00037 
00038 namespace tcp {
00039 
00040     class SlowStart :
00041         virtual public SlowStartStrategy
00042     {   
00043 
00044     public:
00045         explicit
00046         SlowStart(const wns::pyconfig::View& _pyco);
00047 
00048         virtual
00049         ~SlowStart();
00050 
00051         virtual void
00052         onSegmentLoss(segmentLoss _sl, unsigned long int _ackNR);
00053 
00054         virtual void
00055         onRTTSample();
00056 
00057         virtual unsigned long int
00058         getWindowSize();
00059 
00060         virtual simTimeType
00061         getRetransmissionTimeout();
00062 
00063         virtual void
00064         onSegmentAcknowledged();
00065 
00066         virtual void
00067         setWindowSize(unsigned long int new_cwnd);
00068 
00069         virtual bool
00070         duplicateACKThresholdReached(unsigned long int _ackNR);
00071 
00075         virtual void
00076         clearDuplicateACKCounter();
00077 
00081         unsigned long int
00082         getSlowStartThreshold();
00083 
00087         void
00088         reCalcThreshold();
00089 
00090     private:
00091         std::string
00092         printReason(segmentLoss reason);
00093 
00094         const wns::pyconfig::View pyco;
00095 
00096         unsigned long int cwnd;
00097 
00101         unsigned long int ssthresh;
00102 
00106         wns::logger::Logger logger;
00107 
00111         simTimeType timeout;
00112 
00116         unsigned long int
00117         max(unsigned long int x, unsigned long int y);
00118     };
00119 } // namespace 
00120 
00121 #endif // NOT defined TCP_SLOWSTART_HPP
00122 

Generated on Fri May 25 03:32:20 2012 for openWNS by  doxygen 1.5.5