A Discrete-Event Network Simulator
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
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  */
28 #ifndef TCPILLINOIS_H
29 #define TCPILLINOIS_H
31 #include "ns3/tcp-congestion-ops.h"
33 namespace ns3 {
106 class TcpIllinois : public TcpNewReno
107 {
108 public:
113  static TypeId GetTypeId (void);
118  TcpIllinois (void);
124  TcpIllinois (const TcpIllinois& sock);
125  virtual ~TcpIllinois (void);
127  virtual std::string GetName () const;
137  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
138  uint32_t bytesInFlight);
140  virtual Ptr<TcpCongestionOps> Fork ();
148  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
149  const TcpSocketState::TcpCongState_t newState);
157  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
167  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
168  const Time& rtt);
170 protected:
171 private:
177  void RecalcParam (uint32_t cWnd);
189  void CalculateAlpha (double da, double dm);
204  void CalculateBeta (double da, double dm);
211  Time CalculateAvgDelay () const;
218  Time CalculateMaxDelay () const;
225  void Reset (const SequenceNumber32 &nextTxSequence);
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;
247 };
249 } // namespace ns3
251 #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:230
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
double m_beta
Multiplicative decrease factor.
Definition: tcp-illinois.h:242
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:240
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.
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-illinois.h:245
bool m_rttAbove
True when da > d1.
Definition: tcp-illinois.h:233
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
double m_alpha
Additive increase factor.
Definition: tcp-illinois.h:238
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:228
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
Definition: tcp-illinois.h:244
Time CalculateAvgDelay() const
Calculate average queueing delay.
double m_alphaBase
Base value of alpha for standard AIMD.
Definition: tcp-illinois.h:237
double m_alphaMin
Minimum alpha threshold.
Definition: tcp-illinois.h:235
double m_alphaMax
Maximum alpha threshold.
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:231
Create an unbound tcp socket.
Definition: tcp-illinois.cc:81
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:229
SequenceNumber32 m_endSeq
Right edge of current RTT.
Definition: tcp-illinois.h:232
double m_betaMin
Minimum beta threshold.
Definition: tcp-illinois.h:239
double m_betaBase
Base value of beta for standard AIMD.
Definition: tcp-illinois.h:241
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-illinois.cc:39
uint32_t m_winThresh
Window threshold for adaptive sizing.
Definition: tcp-illinois.h:243
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:106
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:234