flavours/TCPNoCongestionControl.cc

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2004 Andras Varga
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #include "TCPNoCongestionControl.h"
00019 #include "TCP.h"
00020 
00021 Register_Class(TCPNoCongestionControl);
00022 
00023 TCPNoCongestionControl::TCPNoCongestionControl() : TCPBaseAlg(),
00024   state((TCPNoCongestionControlStateVariables *&)TCPAlgorithm::state)
00025 {
00026 }
00027 
00028 void TCPNoCongestionControl::initialize()
00029 {
00030     TCPBaseAlg::initialize();
00031 
00032     // set congestion window to a practically infinite value
00033     state->snd_cwnd = 0x7fffffff;
00034 }
00035 
00036 void TCPNoCongestionControl::processRexmitTimer(TCPEventCode& event)
00037 {
00038     TCPBaseAlg::processRexmitTimer(event);
00039     if (event==TCP_E_ABORT)
00040         return;
00041 
00042     // Tahoe-style retransmission: only one segment
00043     conn->retransmitOneSegment(true);
00044 }
00045 
00046 void TCPNoCongestionControl::receivedDataAck(uint32 firstSeqAcked)
00047 {
00048     TCPBaseAlg::receivedDataAck(firstSeqAcked);
00049 
00050     // ack may have freed up some room in the window, try sending
00051     sendData();
00052 }
00053