INET Framework for OMNeT++/OMNEST
old/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_old.h"
00019 #include "TCP_old.h"
00020 
00021 using namespace tcp_old;
00022 
00023 Register_Class(TCPNoCongestionControl);
00024 
00025 TCPNoCongestionControl::TCPNoCongestionControl() : TCPBaseAlg(),
00026   state((TCPNoCongestionControlStateVariables *&)TCPAlgorithm::state)
00027 {
00028 }
00029 
00030 void TCPNoCongestionControl::initialize()
00031 {
00032     TCPBaseAlg::initialize();
00033 
00034     // set congestion window to a practically infinite value
00035     state->snd_cwnd = 0x7fffffff;
00036 }
00037 
00038 void TCPNoCongestionControl::processRexmitTimer(TCPEventCode& event)
00039 {
00040     TCPBaseAlg::processRexmitTimer(event);
00041     if (event==TCP_E_ABORT)
00042         return;
00043 
00044     // Tahoe-style retransmission: only one segment
00045     conn->retransmitOneSegment(true);
00046 }
00047 
00048 void TCPNoCongestionControl::receivedDataAck(uint32 firstSeqAcked)
00049 {
00050     TCPBaseAlg::receivedDataAck(firstSeqAcked);
00051 
00052     // ack may have freed up some room in the window, try sending
00053     sendData();
00054 }
00055