|
INET Framework for OMNeT++/OMNEST
|
#include <TcpVegas.h>
|
| | TcpVegas () |
| | Ctor. More...
|
| |
| virtual void | receivedDataAck (uint32_t firstSeqAcked) override |
| | Redefine what should happen when data got acked, to add congestion window management. More...
|
| |
| virtual void | receivedDuplicateAck () override |
| | Redefine what should happen when dupAck was received, to add congestion window management. More...
|
| |
| virtual void | dataSent (uint32_t fromseq) override |
| | Called after we send data. More...
|
| |
| virtual void | segmentRetransmitted (uint32_t fromseq, uint32_t toseq) override |
| | Called after we retransmitted segment. More...
|
| |
| | TcpBaseAlg () |
| | Ctor. More...
|
| |
| virtual | ~TcpBaseAlg () |
| | Virtual dtor. More...
|
| |
| virtual void | initialize () override |
| | Create timers, etc. More...
|
| |
| virtual void | established (bool active) override |
| | Called when the connection is going to ESTABLISHED from SYN_SENT or SYN_RCVD. More...
|
| |
| virtual void | connectionClosed () override |
| | Called when the connection closes, it should cancel all running timers. More...
|
| |
| virtual void | processTimer (cMessage *timer, TcpEventCode &event) override |
| | Process REXMIT, PERSIST, DELAYED-ACK and KEEP-ALIVE timers. More...
|
| |
| virtual void | sendCommandInvoked () override |
| | Called after user sent TCP_C_SEND command to us. More...
|
| |
| virtual void | receivedOutOfOrderSegment () override |
| | Called after receiving data which are in the window, but not at its left edge (seq != rcv_nxt). More...
|
| |
| virtual void | receiveSeqChanged () override |
| | Called after rcv_nxt got advanced, either because we received in-sequence data ("text" in RFC 793 lingo) or a FIN. More...
|
| |
| virtual void | receivedAckForDataNotYetSent (uint32_t seq) override |
| | Called after we received an ACK for data not yet sent. More...
|
| |
| virtual void | ackSent () override |
| | Called after we sent an ACK. More...
|
| |
| virtual void | restartRexmitTimer () override |
| | Restart REXMIT timer. More...
|
| |
| virtual bool | shouldMarkAck () override |
| | Called before sending ACK. More...
|
| |
| virtual void | processEcnInEstablished () override |
| | Called before processing segment in established state. More...
|
| |
| | TcpAlgorithm () |
| | Ctor. More...
|
| |
| virtual | ~TcpAlgorithm () |
| | Virtual dtor. More...
|
| |
| void | setConnection (TcpConnection *_conn) |
| | Assign this object to a TcpConnection. More...
|
| |
| TcpStateVariables * | getStateVariables () |
| | Creates and returns the TCP state variables. More...
|
| |
|
| static simsignal_t | cwndSignal = cComponent::registerSignal("cwnd") |
| |
| static simsignal_t | ssthreshSignal = cComponent::registerSignal("ssthresh") |
| |
| static simsignal_t | rttSignal = cComponent::registerSignal("rtt") |
| |
| static simsignal_t | srttSignal = cComponent::registerSignal("srtt") |
| |
| static simsignal_t | rttvarSignal = cComponent::registerSignal("rttvar") |
| |
| static simsignal_t | rtoSignal = cComponent::registerSignal("rto") |
| |
| static simsignal_t | numRtosSignal = cComponent::registerSignal("numRtos") |
| |
◆ TcpVegas()
| inet::tcp::TcpVegas::TcpVegas |
( |
| ) |
|
◆ createStateVariables()
|
|
inlineoverrideprotectedvirtual |
Create and return a TCPvegasStateVariables object.
Implements inet::tcp::TcpAlgorithm.
58 return new TcpVegasStateVariables();
◆ dataSent()
| void inet::tcp::TcpVegas::dataSent |
( |
uint32_t |
fromseq | ) |
|
|
overridevirtual |
◆ processRexmitTimer()
| void inet::tcp::TcpVegas::processRexmitTimer |
( |
TcpEventCode & |
event | ) |
|
|
overrideprotectedvirtual |
Redefine what should happen on retransmission.
Reimplemented from inet::tcp::TcpBaseAlg.
100 EV_DETAIL <<
"RXT Timeout in Vegas: resetting cwnd to " <<
state->
snd_cwnd <<
"\n"
◆ recalculateSlowStartThreshold()
| void inet::tcp::TcpVegas::recalculateSlowStartThreshold |
( |
| ) |
|
|
protectedvirtual |
◆ receivedDataAck()
| void inet::tcp::TcpVegas::receivedDataAck |
( |
uint32_t |
firstSeqAcked | ) |
|
|
overridevirtual |
Redefine what should happen when data got acked, to add congestion window management.
Reimplemented from inet::tcp::TcpBaseAlg.
114 const TcpSegmentTransmitInfoList::Item *found =
state->
regions.
get(firstSeqAcked);
116 simtime_t currentTime = simTime();
117 simtime_t tSent = found->getFirstSentTime();
118 int num_transmits = found->getTransmitCount();
121 if (firstSeqAcked ==
state->
iss + 1) {
126 EV_DETAIL <<
"Vegas: initialization" <<
"\n";
138 EV_DETAIL <<
"Vegas: newRTT calculated: " << newRTT <<
"\n";
149 if (rttLen <= state->snd_mss)
153 uint32_t actual = rttLen / newRTT;
161 uint32_t diff = (uint32_t)((expected - actual) * SIMTIME_DBL(
state->
v_baseRTT) + 0.5);
163 EV_DETAIL <<
"Vegas: expected: " << expected <<
"\n"
164 <<
", actual =" << actual <<
"\n"
165 <<
", diff =" << diff <<
"\n";
170 EV_DETAIL <<
"Vegas: Slow Start: " <<
"\n";
200 EV_DETAIL <<
"Vegas: Congestion avoidance: " <<
"\n";
205 else if (diff < 2 * state->snd_mss) {
220 EV_DETAIL <<
"Vegas: surpass ssthresh during slow-start: no cwnd incr. " <<
"\n";
228 EV_DETAIL <<
"Vegas: incr cwnd linearly, to " <<
state->
snd_cwnd <<
"\n";
236 EV_DETAIL <<
"Vegas: decr cwnd linearly, to " <<
state->
snd_cwnd <<
"\n";
240 if (tSent != 0 && num_transmits == 1) {
241 simtime_t newRTT = currentTime - tSent;
246 if (newRTT < state->v_baseRTT)
265 bool expired = unaFound && ((currentTime - unaFound->getFirstSentTime()) >=
state->
v_rtt_timeout);
271 EV_DETAIL <<
"Vegas: retransmission (v_rtt_timeout) " <<
"\n";
◆ receivedDuplicateAck()
| void inet::tcp::TcpVegas::receivedDuplicateAck |
( |
| ) |
|
|
overridevirtual |
Redefine what should happen when dupAck was received, to add congestion window management.
Reimplemented from inet::tcp::TcpBaseAlg.
289 simtime_t currentTime = simTime();
291 int num_transmits = 0;
295 num_transmits = found->getTransmitCount();
308 if (num_transmits > 1)
318 else if (num_transmits > 1)
336 if (found && num_transmits == 1)
◆ segmentRetransmitted()
| void inet::tcp::TcpVegas::segmentRetransmitted |
( |
uint32_t |
fromseq, |
|
|
uint32_t |
toseq |
|
) |
| |
|
overridevirtual |
Called after we retransmitted segment.
The argument fromseq is the seqno of the first byte sent. The argument toseq is the seqno of the last byte sent+1.
Reimplemented from inet::tcp::TcpBaseAlg.
◆ state
The documentation for this class was generated from the following files:
static simsignal_t cwndSignal
Definition: TcpBaseAlg.h:101
TcpBaseAlg()
Ctor.
Definition: TcpBaseAlg.cc:95
virtual void processRexmitTimer(TcpEventCode &event)
Definition: TcpBaseAlg.cc:208
uint32_t v_begseq
Definition: TcpVegas.h:33
bool v_incr_ss
Definition: TcpVegas.h:45
simtime_t v_sa
Definition: TcpVegas.h:37
uint32_t snd_cwnd
congestion window
Definition: TcpBaseAlg.h:40
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SctpAssociation.h:261
uint32_t dupacks
Definition: TcpConnection.h:236
virtual void segmentRetransmitted(uint32_t fromseq, uint32_t toseq) override
Called after we retransmitted segment.
Definition: TcpBaseAlg.cc:624
simtime_t v_cwnd_changed
Definition: TcpVegas.h:28
TcpVegasStateVariables *& state
Definition: TcpVegas.h:53
uint32_t ssthresh
slow start threshold
Definition: TcpVegas.h:42
uint32_t dupthresh
Definition: TcpConnection.h:261
void clearTo(uint32_t endseg)
Definition: TcpSegmentTransmitInfoList.cc:75
uint32_t snd_wnd
Definition: TcpConnection.h:150
virtual void receivedDuplicateAck() override
Called after we received a duplicate ACK (that is: ackNo == snd_una, no data in segment,...
Definition: TcpBaseAlg.cc:565
const Item * get(uint32_t seq) const
returns pointer to Item, or nullptr if not found
Definition: TcpSegmentTransmitInfoList.cc:64
TcpConnection * conn
Definition: TcpAlgorithm.h:26
virtual void receivedDataAck(uint32_t firstSeqAcked) override
Called after we received an ACK which acked some data (that is, we could advance snd_una).
Definition: TcpBaseAlg.cc:483
bool afterRto
Definition: TcpConnection.h:194
uint32_t snd_nxt
Definition: TcpConnection.h:148
simtime_t v_begtime
Definition: TcpVegas.h:34
simtime_t getFirstSentTime() const
Definition: TcpSegmentTransmitInfoList.h:32
double max(const double a, const double b)
Returns the maximum of a and b.
Definition: SctpAssociation.h:266
bool v_inc_flag
Definition: TcpVegas.h:44
uint32_t snd_mss
Definition: TcpConnection.h:142
uint32_t v_worried
Definition: TcpVegas.h:47
virtual void dataSent(uint32_t fromseq) override
Called after we sent data.
Definition: TcpBaseAlg.cc:603
void set(uint32_t beg, uint32_t end, simtime_t sentTime)
Definition: TcpSegmentTransmitInfoList.cc:16
simtime_t v_rtt_timeout
Definition: TcpVegas.h:36
@ TCP_E_ABORT
Definition: TcpConnection.h:75
simtime_t v_sd
Definition: TcpVegas.h:38
virtual void restartRexmitTimer() override
Restart REXMIT timer.
Definition: TcpBaseAlg.cc:628
virtual bool sendData(bool sendCommandInvoked)
Send data, observing Nagle's algorithm and congestion window.
Definition: TcpBaseAlg.cc:398
TcpSegmentTransmitInfoList regions
Definition: TcpVegas.h:40
virtual void retransmitOneSegment(bool called_at_rto)
Utility: retransmit one segment from snd_una.
Definition: TcpConnectionUtil.cc:960
int32_t v_incr
Definition: TcpVegas.h:46
uint32_t snd_una
Definition: TcpConnection.h:147
TcpStateVariables * state
Definition: TcpAlgorithm.h:27
static simsignal_t ssthreshSignal
Definition: TcpBaseAlg.h:102
virtual void recalculateSlowStartThreshold()
Utility function to recalculate ssthresh.
Definition: TcpVegas.cc:67
simtime_t v_sumRTT
Definition: TcpVegas.h:31
bool seqGreater(uint32_t a, uint32_t b)
Definition: TcpHeader.h:23
simtime_t v_baseRTT
Definition: TcpVegas.h:30
uint32_t iss
Definition: TcpConnection.h:154
int v_cntRTT
Definition: TcpVegas.h:32
uint32_t snd_max
Definition: TcpConnection.h:149