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 "ns3/tcp-congestion-ops.h"
32 #include "ns3/tcp-recovery-ops.h"
33 
34 namespace ns3 {
35 
107 class TcpIllinois : public TcpNewReno
108 {
109 public:
114  static TypeId GetTypeId (void);
115 
119  TcpIllinois (void);
120 
125  TcpIllinois (const TcpIllinois& sock);
126  virtual ~TcpIllinois (void);
127 
128  virtual std::string GetName () const;
129 
138  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
139  uint32_t bytesInFlight);
140 
141  virtual Ptr<TcpCongestionOps> Fork ();
142 
149  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
150  const TcpSocketState::TcpCongState_t newState);
151 
158  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
159 
168  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
169  const Time& rtt);
170 
171 protected:
172 private:
178  void RecalcParam (uint32_t cWnd);
179 
190  void CalculateAlpha (double da, double dm);
191 
205  void CalculateBeta (double da, double dm);
206 
212  Time CalculateAvgDelay () const;
213 
219  Time CalculateMaxDelay () const;
220 
226  void Reset (const SequenceNumber32 &nextTxSequence);
227 
228 private:
230  uint32_t m_cntRtt;
234  bool m_rttAbove;
235  uint8_t m_rttLow;
236  double m_alphaMin;
237  double m_alphaMax;
238  double m_alphaBase;
239  double m_alpha;
240  double m_betaMin;
241  double m_betaMax;
242  double m_betaBase;
243  double m_beta;
244  uint32_t m_winThresh;
245  uint32_t m_theta;
246  uint32_t m_ackCnt;
247 
248 };
249 
250 } // namespace ns3
251 
252 #endif // TCPILLINOIS_H
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Time m_baseRtt
Minimum of all RTT measurements.
Definition: tcp-illinois.h:231
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
double m_beta
Multiplicative decrease factor.
Definition: tcp-illinois.h:243
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
double m_betaMax
Maximum beta threshold.
Definition: tcp-illinois.h:241
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold after congestion event.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-illinois.h:246
bool m_rttAbove
True when da > d1.
Definition: tcp-illinois.h:234
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
double m_alpha
Additive increase factor.
Definition: tcp-illinois.h:239
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
The NewReno implementation.
Time m_sumRtt
Sum of all RTT measurements during last RTT.
Definition: tcp-illinois.h:229
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
Definition: tcp-illinois.h:245
double m_alphaBase
Base value of alpha for standard AIMD.
Definition: tcp-illinois.h:238
double m_alphaMin
Minimum alpha threshold.
Definition: tcp-illinois.h:236
double m_alphaMax
Maximum alpha threshold.
Definition: tcp-illinois.h:237
void CalculateBeta(double da, double dm)
Calculate multiplicative decrease factor beta.
Time m_maxRtt
Maximum of all RTT measurements.
Definition: tcp-illinois.h:232
TcpIllinois(void)
Create an unbound tcp socket.
Definition: tcp-illinois.cc:80
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~TcpIllinois(void)
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Reset Illinois parameters to default values upon a loss.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-illinois.h:230
SequenceNumber32 m_endSeq
Right edge of current RTT.
Definition: tcp-illinois.h:233
double m_betaMin
Minimum beta threshold.
Definition: tcp-illinois.h:240
double m_betaBase
Base value of beta for standard AIMD.
Definition: tcp-illinois.h:242
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-illinois.cc:38
uint32_t m_winThresh
Window threshold for adaptive sizing.
Definition: tcp-illinois.h:244
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
An implementation of TCP Illinois algorithm.
Definition: tcp-illinois.h:107
Time CalculateAvgDelay() const
Calculate average queueing delay.
a unique identifier for an interface.
Definition: type-id.h:58
uint8_t m_rttLow
Number of RTTs da has stayed below d1.
Definition: tcp-illinois.h:235