A Discrete-Event Network Simulator
API
tcp-illinois.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 ResiliNets, ITTC, University of Kansas
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Keerthi Ganta <keerthiganta@ku.edu>
18  * Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
19  *
20  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21  * ResiliNets Research Group https://resilinets.org/
22  * Information and Telecommunication Technology Center (ITTC)
23  * and Department of Electrical Engineering and Computer Science
24  * The University of Kansas Lawrence, KS USA.
25  */
26 
27 #ifndef TCPILLINOIS_H
28 #define TCPILLINOIS_H
29 
30 #include "tcp-congestion-ops.h"
31 
32 namespace ns3
33 {
34 
35 class TcpSocketState;
36 
108 class TcpIllinois : public TcpNewReno
109 {
110  public:
115  static TypeId GetTypeId();
116 
120  TcpIllinois();
121 
126  TcpIllinois(const TcpIllinois& sock);
127  ~TcpIllinois() override;
128 
129  std::string GetName() const override;
130 
139  uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
140 
141  Ptr<TcpCongestionOps> Fork() override;
142 
150  const TcpSocketState::TcpCongState_t newState) override;
151 
158  void IncreaseWindow(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
159 
168  void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
169 
170  protected:
171  private:
177  void RecalcParam(uint32_t cWnd);
178 
189  void CalculateAlpha(double da, double dm);
190 
204  void CalculateBeta(double da, double dm);
205 
211  Time CalculateAvgDelay() const;
212 
218  Time CalculateMaxDelay() const;
219 
225  void Reset(const SequenceNumber32& nextTxSequence);
226 
227  private:
229  uint32_t m_cntRtt;
233  bool m_rttAbove;
234  uint8_t m_rttLow;
235  double m_alphaMin;
236  double m_alphaMax;
237  double m_alphaBase;
238  double m_alpha;
239  double m_betaMin;
240  double m_betaMax;
241  double m_betaBase;
242  double m_beta;
243  uint32_t m_winThresh;
244  uint32_t m_theta;
245  uint32_t m_ackCnt;
246 };
247 
248 } // namespace ns3
249 
250 #endif // TCPILLINOIS_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
An implementation of TCP Illinois algorithm.
Definition: tcp-illinois.h:109
double m_alphaBase
Base value of alpha for standard AIMD.
Definition: tcp-illinois.h:237
double m_beta
Multiplicative decrease factor.
Definition: tcp-illinois.h:242
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-illinois.h:245
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold after congestion event.
bool m_rttAbove
True when da > d1.
Definition: tcp-illinois.h:233
std::string GetName() const override
Get the name of the congestion control algorithm.
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-illinois.cc:40
double m_betaMin
Minimum beta threshold.
Definition: tcp-illinois.h:239
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Reset Illinois parameters to default values upon a loss.
Time m_baseRtt
Minimum of all RTT measurements.
Definition: tcp-illinois.h:230
double m_alphaMin
Minimum alpha threshold.
Definition: tcp-illinois.h:235
uint32_t m_winThresh
Window threshold for adaptive sizing.
Definition: tcp-illinois.h:243
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-illinois.h:229
TcpIllinois()
Create an unbound tcp socket.
Definition: tcp-illinois.cc:89
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Adjust cwnd following Illinois congestion avoidance algorithm.
uint8_t m_rttLow
Number of RTTs da has stayed below d1.
Definition: tcp-illinois.h:234
void CalculateBeta(double da, double dm)
Calculate multiplicative decrease factor beta.
Time m_maxRtt
Maximum of all RTT measurements.
Definition: tcp-illinois.h:231
double m_alpha
Additive increase factor.
Definition: tcp-illinois.h:238
double m_betaMax
Maximum beta threshold.
Definition: tcp-illinois.h:240
double m_betaBase
Base value of beta for standard AIMD.
Definition: tcp-illinois.h:241
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
Definition: tcp-illinois.h:244
~TcpIllinois() override
Time m_sumRtt
Sum of all RTT measurements during last RTT.
Definition: tcp-illinois.h:228
double m_alphaMax
Maximum alpha threshold.
Definition: tcp-illinois.h:236
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Measure RTT for each ACK Keep track of min and max RTT.
Time CalculateAvgDelay() const
Calculate average queueing delay.
SequenceNumber32 m_endSeq
Right edge of current RTT.
Definition: tcp-illinois.h:232
The NewReno implementation.
TcpCongState_t
Definition of the Congestion state machine.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.