![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_CONGESTIONCONTROL_HPP 00029 #define TCP_CONGESTIONCONTROL_HPP 00030 00031 #include <WNS/pyconfig/View.hpp> 00032 #include <WNS/logger/Logger.hpp> 00033 00034 #include <TCP/CongestionControlStrategy.hpp> 00035 00036 00037 namespace tcp { 00038 00039 class SlowStart; 00040 00041 namespace tests { 00042 class CongestionControlTest; 00043 class CumulativeACKTest; 00044 } // namespace tests 00045 00046 class CongestionControl : 00047 virtual public CongestionControlStrategy 00048 { 00049 friend class tests::CongestionControlTest; 00050 friend class tests::CumulativeACKTest; 00051 00052 public: 00053 explicit 00054 CongestionControl(const wns::pyconfig::View& _pyco); 00055 00056 virtual 00057 ~CongestionControl(); 00058 00063 virtual void 00064 onSegmentLoss(segmentLoss _sl, unsigned long int _ackNR); 00065 00066 virtual void 00067 onRTTSample(); 00068 00069 virtual unsigned long int 00070 getWindowSize(); 00071 00072 virtual simTimeType 00073 getRetransmissionTimeout(); 00074 00075 virtual void 00076 onSegmentAcknowledged(); 00077 00078 virtual bool 00079 duplicateACKThresholdReached(unsigned long int _ackNR); 00080 00081 virtual void 00082 clearDuplicateACKCounter(); 00083 00084 CongestionControlStrategy* 00085 getCongestionControlMode(); 00086 00087 private: 00088 std::string 00089 printMode(Mode _mode); 00090 00091 wns::pyconfig::View pyco; 00092 00096 Mode mode; 00097 00101 SlowStartStrategy* slowStart; 00102 00106 CongestionAvoidanceStrategy* ca; 00107 00111 wns::logger::Logger logger; 00112 00113 virtual void 00114 setWindowSize(unsigned long int new_cwnd); 00115 00120 void 00121 setCongestionControlMode(Mode _mode); 00122 00126 unsigned long int 00127 getSlowStartThreshold(); 00128 }; 00129 } // namespace tcp 00130 00131 #endif // NOT defined TCP_CONGESTIONCONTROL_HPP
1.5.5