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