Redefine what should happen when data got acked, to add congestion window management.
127 const TCPSegmentTransmitInfoList::Item *found =
state->
regions.
get(firstSeqAcked);
129 simtime_t currentTime = simTime();
130 simtime_t tSent = found->getFirstSentTime();
131 int num_transmits = found->getTransmitCount();
134 if (firstSeqAcked ==
state->
iss + 1) {
139 EV_DETAIL <<
"Vegas: initialization" <<
"\n";
151 EV_DETAIL <<
"Vegas: newRTT calculated: " << newRTT <<
"\n";
162 if (rttLen <= state->snd_mss)
166 uint32 actual = rttLen / newRTT;
176 EV_DETAIL <<
"Vegas: expected: " << expected <<
"\n" 177 <<
", actual =" << actual <<
"\n" 178 <<
", diff =" << diff <<
"\n";
183 EV_DETAIL <<
"Vegas: Slow Start: " <<
"\n";
214 EV_DETAIL <<
"Vegas: Congestion avoidance: " <<
"\n";
219 else if (diff < 2 * state->snd_mss) {
234 EV_DETAIL <<
"Vegas: surpass ssthresh during slow-start: no cwnd incr. " <<
"\n";
243 EV_DETAIL <<
"Vegas: incr cwnd linearly, to " <<
state->
snd_cwnd <<
"\n";
252 EV_DETAIL <<
"Vegas: decr cwnd linearly, to " <<
state->
snd_cwnd <<
"\n";
256 if (tSent != 0 && num_transmits == 1) {
257 simtime_t newRTT = currentTime - tSent;
262 if (newRTT < state->v_baseRTT)
281 bool expired = unaFound && ((currentTime - unaFound->getFirstSentTime()) >=
state->
v_rtt_timeout);
287 EV_DETAIL <<
"Vegas: retransmission (v_rtt_timeout) " <<
"\n";
virtual void recalculateSlowStartThreshold()
Utility function to recalculate ssthresh.
Definition: TCPVegas.cc:78
virtual void retransmitOneSegment(bool called_at_rto)
Utility: retransmit one segment from snd_una.
Definition: TCPConnectionUtil.cc:802
simtime_t v_sumRTT
Definition: TCPVegas.h:46
cOutVector * cwndVector
Definition: TCPBaseAlg.h:115
uint32 ssthresh
slow start threshold
Definition: TCPVegas.h:57
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SCTPAssociation.h:270
TCPSegmentTransmitInfoList regions
Definition: TCPVegas.h:55
void clearTo(uint32_t endseg)
Definition: TCPSegmentTransmitInfoList.cc:87
virtual void receivedDataAck(uint32 firstSeqAcked) override
Called after we received an ACK which acked some data (that is, we could advance snd_una).
Definition: TCPBaseAlg.cc:529
TCPVegasStateVariables *& state
Definition: TCPVegas.h:68
uint32 snd_mss
Definition: TCPConnection.h:159
uint32 snd_nxt
Definition: TCPConnection.h:165
bool v_inc_flag
Definition: TCPVegas.h:59
int32 v_incr
Definition: TCPVegas.h:61
uint32 dupacks
Definition: TCPConnection.h:255
uint32 v_begseq
Definition: TCPVegas.h:48
#define DUPTHRESH
Definition: TCPConnection.h:126
simtime_t v_begtime
Definition: TCPVegas.h:49
uint32 snd_una
Definition: TCPConnection.h:164
simtime_t v_sd
Definition: TCPVegas.h:53
uint32_t uint32
Definition: Compat.h:30
bool v_incr_ss
Definition: TCPVegas.h:60
uint32 iss
Definition: TCPConnection.h:171
simtime_t v_sa
Definition: TCPVegas.h:52
bool seqGreater(uint32 a, uint32 b)
Definition: TCPSegment.h:34
const Item * get(uint32_t seq) const
returns pointer to Item, or nullptr if not found
Definition: TCPSegmentTransmitInfoList.cc:76
uint32 v_worried
Definition: TCPVegas.h:62
int v_cntRTT
Definition: TCPVegas.h:47
TCPConnection * conn
Definition: TCPAlgorithm.h:40
simtime_t v_rtt_timeout
Definition: TCPVegas.h:51
uint32 snd_max
Definition: TCPConnection.h:166
simtime_t v_baseRTT
Definition: TCPVegas.h:45
uint32 snd_cwnd
congestion window
Definition: TCPBaseAlg.h:54
virtual bool sendData(bool sendCommandInvoked)
Send data, observing Nagle's algorithm and congestion window.
Definition: TCPBaseAlg.cc:429