Public Member Functions | Protected Member Functions | Protected Attributes

tcp_old::TCPAlgorithm Class Reference

#include <TCPAlgorithm_old.h>

Inheritance diagram for tcp_old::TCPAlgorithm:
tcp_old::DumbTCP tcp_old::TCPBaseAlg tcp_old::TCPNoCongestionControl tcp_old::TCPTahoeRenoFamily tcp_old::TCPReno tcp_old::TCPTahoe

List of all members.

Public Member Functions

 TCPAlgorithm ()
virtual ~TCPAlgorithm ()
void setConnection (TCPConnection *_conn)
TCPStateVariablesgetStateVariables ()
virtual void initialize ()
virtual void established (bool active)=0
virtual void connectionClosed ()=0
virtual void processTimer (cMessage *timer, TCPEventCode &event)=0
virtual void sendCommandInvoked ()=0
virtual void receivedOutOfOrderSegment ()=0
virtual void receiveSeqChanged ()=0
virtual void receivedDataAck (uint32 firstSeqAcked)=0
virtual void receivedDuplicateAck ()=0
virtual void receivedAckForDataNotYetSent (uint32 seq)=0
virtual void ackSent ()=0
virtual void dataSent (uint32 fromseq)=0
virtual void restartRexmitTimer ()=0

Protected Member Functions

virtual TCPStateVariablescreateStateVariables ()=0

Protected Attributes

TCPConnectionconn
TCPStateVariablesstate

Detailed Description

Abstract base class for TCP algorithms which encapsulate all behaviour during data transfer state: flavour of congestion control, fast retransmit/recovery, selective acknowledgement etc. Subclasses may implement various sets and flavours of the above algorithms.

Definition at line 33 of file TCPAlgorithm_old.h.


Constructor & Destructor Documentation

tcp_old::TCPAlgorithm::TCPAlgorithm (  )  [inline]

Ctor.

Definition at line 51 of file TCPAlgorithm_old.h.

{state = NULL; conn = NULL;}

virtual tcp_old::TCPAlgorithm::~TCPAlgorithm (  )  [inline, virtual]

Virtual dtor.

Definition at line 56 of file TCPAlgorithm_old.h.

{}


Member Function Documentation

virtual void tcp_old::TCPAlgorithm::ackSent (  )  [pure virtual]
virtual void tcp_old::TCPAlgorithm::connectionClosed (  )  [pure virtual]

Called when the connection closes, it should cancel all running timers.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::stateEntered().

virtual TCPStateVariables* tcp_old::TCPAlgorithm::createStateVariables (  )  [protected, pure virtual]

Create state block (TCB) used by this TCP variant. It is expected that every TCPAlgorithm subclass will have its own state block, subclassed from TCPStateVariables. This factory method should create and return a "blank" state block of the appropriate type.

Implemented in tcp_old::DumbTCP, tcp_old::TCPNoCongestionControl, tcp_old::TCPReno, and tcp_old::TCPTahoe.

virtual void tcp_old::TCPAlgorithm::dataSent ( uint32  fromseq  )  [pure virtual]

Called after we sent data. This hook can be used to schedule the retransmission timer, to start round-trip time measurement, etc. The argument is the seqno of the first byte sent.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::sendData(), and tcp_old::TCPConnection::sendProbe().

virtual void tcp_old::TCPAlgorithm::established ( bool  active  )  [pure virtual]

Called when the connection is going to ESTABLISHED from SYN_SENT or SYN_RCVD. This is a place to initialize some variables (e.g. set cwnd to the MSS learned during connection setup). If we are on the active side, here we also have to finish the 3-way connection setup procedure by sending an ACK, possibly piggybacked on data.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::processSegment1stThru8th(), and tcp_old::TCPConnection::processSegmentInSynSent().

TCPStateVariables* tcp_old::TCPAlgorithm::getStateVariables (  )  [inline]

Creates and returns the TCP state variables.

Definition at line 67 of file TCPAlgorithm_old.h.

Referenced by tcp_old::TCPConnection::cloneListeningConnection(), and tcp_old::TCPConnection::initConnection().

                                           {
        if (!state) state = createStateVariables();
        return state;
    }

virtual void tcp_old::TCPAlgorithm::initialize (  )  [inline, virtual]

Should be redefined to initialize the object: create timers, etc. This method is necessary because the TCPConnection ptr is not available in the constructor yet.

Reimplemented in tcp_old::DumbTCP, tcp_old::TCPBaseAlg, and tcp_old::TCPNoCongestionControl.

Definition at line 77 of file TCPAlgorithm_old.h.

Referenced by tcp_old::TCPConnection::cloneListeningConnection(), and tcp_old::TCPConnection::initConnection().

{}

virtual void tcp_old::TCPAlgorithm::processTimer ( cMessage *  timer,
TCPEventCode event 
) [pure virtual]

Place to process timers specific to this TCPAlgorithm class. TCPConnection will invoke this method on any timer (self-message) it doesn't recognize (that is, any timer other than the 2MSL, CONN-ESTAB and FIN-WAIT-2 timers).

Method may also change the event code (by default set to TCP_E_IGNORE) to cause the state transition of TCP FSM.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::processTimer().

virtual void tcp_old::TCPAlgorithm::receivedAckForDataNotYetSent ( uint32  seq  )  [pure virtual]

Called after we received an ACK for data not yet sent. According to RFC 793 this function should send an ACK.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::processAckInEstabEtc().

virtual void tcp_old::TCPAlgorithm::receivedDataAck ( uint32  firstSeqAcked  )  [pure virtual]

Called after we received an ACK which acked some data (that is, we could advance snd_una). At this point the state variables (snd_una, snd_wnd) have already been updated. The argument firstSeqAcked is the previous snd_una value, that is, the number of bytes acked is (snd_una-firstSeqAcked). The dupack counter still reflects the old value (needed for Reno and NewReno); it'll be reset to 0 after this call returns.

Implemented in tcp_old::DumbTCP, tcp_old::TCPBaseAlg, tcp_old::TCPNoCongestionControl, tcp_old::TCPReno, and tcp_old::TCPTahoe.

Referenced by tcp_old::TCPConnection::processAckInEstabEtc(), and tcp_old::TCPConnection::processSegment1stThru8th().

virtual void tcp_old::TCPAlgorithm::receivedDuplicateAck (  )  [pure virtual]

Called after we received a duplicate ACK (that is: ackNo==snd_una, no data in segment, segment doesn't carry window update, and also, we have unacked data). The dupack counter got already updated when calling this method (i.e. dupack==1 on first duplicate ACK.)

Implemented in tcp_old::DumbTCP, tcp_old::TCPBaseAlg, tcp_old::TCPReno, and tcp_old::TCPTahoe.

Referenced by tcp_old::TCPConnection::processAckInEstabEtc().

virtual void tcp_old::TCPAlgorithm::receivedOutOfOrderSegment (  )  [pure virtual]

Called after receiving data which are in the window, but not at its left edge (seq!=rcv_nxt). This indicates that either segments got re-ordered in the way, or one segment was lost. RFC1122 and RFC2001 recommend sending an immediate ACK here (Fast Retransmit relies on that).

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::processSegment1stThru8th().

virtual void tcp_old::TCPAlgorithm::receiveSeqChanged (  )  [pure virtual]

Called after rcv_nxt got advanced, either because we received in-sequence data ("text" in RFC 793 lingo) or a FIN. At this point, rcv_nxt has already been updated. This method should take care to send or schedule an ACK some time.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::processSegment1stThru8th().

virtual void tcp_old::TCPAlgorithm::restartRexmitTimer (  )  [pure virtual]

Restart REXMIT timer.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::process_CLOSE().

virtual void tcp_old::TCPAlgorithm::sendCommandInvoked (  )  [pure virtual]

Called after user sent TCP_C_SEND command to us.

Implemented in tcp_old::DumbTCP, and tcp_old::TCPBaseAlg.

Referenced by tcp_old::TCPConnection::process_SEND().

void tcp_old::TCPAlgorithm::setConnection ( TCPConnection _conn  )  [inline]

Assign this object to a TCPConnection. Its sendQueue and receiveQueue must be set already at this time, because we cache their pointers here.

Definition at line 62 of file TCPAlgorithm_old.h.

Referenced by tcp_old::TCPConnection::cloneListeningConnection(), and tcp_old::TCPConnection::initConnection().

{conn = _conn;}


Member Data Documentation


The documentation for this class was generated from the following file: