#include <TCPTahoe_old.h>
Public Member Functions | |
TCPTahoe () | |
virtual void | receivedDataAck (uint32 firstSeqAcked) |
virtual void | receivedDuplicateAck () |
Protected Member Functions | |
virtual TCPStateVariables * | createStateVariables () |
virtual void | recalculateSlowStartThreshold () |
virtual void | processRexmitTimer (TCPEventCode &event) |
Protected Attributes | |
TCPTahoeStateVariables *& | state |
Implements Tahoe.
Definition at line 35 of file TCPTahoe_old.h.
TCPTahoe::TCPTahoe | ( | ) |
Ctor
Definition at line 27 of file old/flavours/TCPTahoe.cc.
: TCPTahoeRenoFamily(), state((TCPTahoeStateVariables *&)TCPAlgorithm::state) { }
virtual TCPStateVariables* tcp_old::TCPTahoe::createStateVariables | ( | ) | [inline, protected, virtual] |
Create and return a TCPTahoeStateVariables object.
Implements tcp_old::TCPAlgorithm.
Definition at line 42 of file TCPTahoe_old.h.
{ return new TCPTahoeStateVariables(); }
void TCPTahoe::processRexmitTimer | ( | TCPEventCode & | event | ) | [protected, virtual] |
Redefine what should happen on retransmission
Reimplemented from tcp_old::TCPBaseAlg.
Definition at line 41 of file old/flavours/TCPTahoe.cc.
{ TCPTahoeRenoFamily::processRexmitTimer(event); if (event==TCP_E_ABORT) return; // begin Slow Start (RFC 2581) recalculateSlowStartThreshold(); state->snd_cwnd = state->snd_mss; if (cwndVector) cwndVector->record(state->snd_cwnd); tcpEV << "Begin Slow Start: resetting cwnd to " << state->snd_cwnd << ", ssthresh=" << state->ssthresh << "\n"; state->afterRto = true; // Tahoe retransmits only one segment at the front of the queue conn->retransmitOneSegment(true); }
void TCPTahoe::recalculateSlowStartThreshold | ( | ) | [protected, virtual] |
Utility function to recalculate ssthresh
Definition at line 32 of file old/flavours/TCPTahoe.cc.
Referenced by processRexmitTimer(), and receivedDuplicateAck().
{ // set ssthresh to flight size/2, but at least 2 MSS // (the formula below practically amounts to ssthresh=cwnd/2 most of the time) uint flight_size = std::min(state->snd_cwnd, state->snd_wnd); state->ssthresh = std::max(flight_size/2, 2*state->snd_mss); if (ssthreshVector) ssthreshVector->record(state->ssthresh); }
void TCPTahoe::receivedDataAck | ( | uint32 | firstSeqAcked | ) | [virtual] |
Redefine what should happen when data got acked, to add congestion window management
Reimplemented from tcp_old::TCPBaseAlg.
Definition at line 60 of file old/flavours/TCPTahoe.cc.
{ TCPTahoeRenoFamily::receivedDataAck(firstSeqAcked); // // Perform slow start and congestion avoidance. // if (state->snd_cwnd < state->ssthresh) { tcpEV << "cwnd<=ssthresh: Slow Start: increasing cwnd by one segment, to "; // perform Slow Start. rfc 2581: "During slow start, a TCP increments cwnd // by at most SMSS bytes for each ACK received that acknowledges new data." state->snd_cwnd += state->snd_mss; // NOTE: we could increase cwnd based on the number of bytes being // acknowledged by each arriving ACK, rather than by the number of ACKs // that arrive. This is called "Appropriate Byte Counting" (ABC) and is // described in rfc 3465 (experimental). // // int bytesAcked = state->snd_una - firstSeqAcked; // state->snd_cwnd += bytesAcked; if (cwndVector) cwndVector->record(state->snd_cwnd); tcpEV << "cwnd=" << state->snd_cwnd << "\n"; } else { // perform Congestion Avoidance (rfc 2581) int incr = state->snd_mss * state->snd_mss / state->snd_cwnd; if (incr==0) incr = 1; state->snd_cwnd += incr; if (cwndVector) cwndVector->record(state->snd_cwnd); // // NOTE: some implementations use extra additive constant mss/8 here // which is known to be incorrect (rfc 2581 p5) // // NOTE 2: rfc 3465 (experimental) "Appropriate Byte Counting" (ABC) // would require maintaining a bytes_acked variable here which we don't do // tcpEV << "cwnd>ssthresh: Congestion Avoidance: increasing cwnd linearly, to " << state->snd_cwnd << "\n"; } // ack and/or cwnd increase may have freed up some room in the window, try sending sendData(); }
void TCPTahoe::receivedDuplicateAck | ( | ) | [virtual] |
Redefine what should happen when dupAck was received, to add congestion window management
Reimplemented from tcp_old::TCPBaseAlg.
Definition at line 111 of file old/flavours/TCPTahoe.cc.
{ TCPTahoeRenoFamily::receivedDuplicateAck(); if (state->dupacks==3) { tcpEV << "Tahoe on dupAck=3: perform Fast Retransmit, and enter Slow Start:\n"; // enter Slow Start recalculateSlowStartThreshold(); state->snd_cwnd = state->snd_mss; if (cwndVector) cwndVector->record(state->snd_cwnd); tcpEV << "Set cwnd=" << state->snd_cwnd << ", ssthresh=" << state->ssthresh << "\n"; // Fast Retransmission: retransmit missing segment without waiting // for the REXMIT timer to expire conn->retransmitOneSegment(false); // Do not restart REXMIT timer. // Note: Restart of REXMIT timer on retransmission is not part of RFC 2581, however optional in RFC 3517 if sent during recovery. // Resetting the REXMIT timer is discussed in RFC 2582/3782 (NewReno) and RFC 2988. } }
TCPTahoeStateVariables*& tcp_old::TCPTahoe::state [protected] |
Reimplemented from tcp_old::TCPTahoeRenoFamily.
Definition at line 38 of file TCPTahoe_old.h.
Referenced by processRexmitTimer(), recalculateSlowStartThreshold(), receivedDataAck(), and receivedDuplicateAck().