User Manual, Developers Guide and API Documentation

CongestionControlStrategy.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_CONGESTIONCONTROLSTRATEGY_HPP
00029 #define TCP_CONGESTIONCONTROLSTRATEGY_HPP
00030 
00031 
00032 #include <WNS/StaticFactory.hpp>
00033 #include <WNS/PyConfigViewCreator.hpp>
00034 
00035 namespace tcp { 
00036 
00037     namespace tests {
00038         class CongestionControlTest;
00039         class CumulativeACKTest;
00040     } // namespace tests
00041 
00042     class CongestionControlStrategy
00043     {   
00044         friend class CongestionControl;
00045         friend class tests::CongestionControlTest;
00046         friend class tests::CumulativeACKTest;
00047 
00048     public:
00052         enum segmentLoss {TIMEOUT, DUPLICATE_ACK};
00053 
00054         virtual
00055         ~CongestionControlStrategy() {}
00056 
00057         virtual void
00058         onSegmentLoss(segmentLoss _sl, unsigned long int _ackNR) = 0;
00059 
00060         virtual void
00061         onRTTSample() = 0;
00062 
00063         virtual unsigned long int
00064         getWindowSize() = 0;
00065 
00066         virtual simTimeType
00067         getRetransmissionTimeout() = 0;
00068 
00069         virtual void
00070         onSegmentAcknowledged() = 0;
00071 
00072         virtual bool
00073         duplicateACKThresholdReached(unsigned long int _ackNR) = 0;
00074 
00075         virtual void
00076         clearDuplicateACKCounter() = 0;
00077 
00078     protected:
00079         virtual void
00080         setWindowSize(unsigned long int new_cwnd) = 0;
00081 
00086         enum Mode {SLOWSTART, CONGESTION_AVOIDANCE};
00087     };
00088 
00089     typedef CongestionControlStrategy SlowStartStrategy;
00090     typedef CongestionControlStrategy CongestionAvoidanceStrategy;
00091 
00092     typedef wns::PyConfigViewCreator<SlowStartStrategy> SlowStartCreator;
00093     typedef wns::StaticFactory<SlowStartCreator> SlowStartFactory;
00094 
00095     typedef wns::PyConfigViewCreator<CongestionAvoidanceStrategy> CongestionAvoidanceCreator;
00096     typedef wns::StaticFactory<CongestionAvoidanceCreator> CongestionAvoidanceFactory;
00097 
00098 } // namespace tcp
00099 
00100 #endif // NOT defined TCP_CONGESTIONCONTROLSTRATEGY_HPP

Generated on Tue May 22 03:32:15 2012 for openWNS by  doxygen 1.5.5