A Discrete-Event Network Simulator
API
tcp-yeah.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: Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
19  *
20  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21  * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
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 TCPYEAH_H
28 #define TCPYEAH_H
29 
30 #include "ns3/tcp-scalable.h"
31 
32 namespace ns3 {
33 
71 class TcpYeah : public TcpNewReno
72 {
73 public:
78  static TypeId GetTypeId (void);
79 
83  TcpYeah (void);
84 
89  TcpYeah (const TcpYeah& sock);
90  virtual ~TcpYeah (void);
91 
92  virtual std::string GetName () const;
93 
109  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
110  const Time& rtt);
111 
120  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
121  const TcpSocketState::TcpCongState_t newState);
122 
129  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
130 
139  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
140  uint32_t bytesInFlight);
141 
142  virtual Ptr<TcpCongestionOps> Fork ();
143 
144 protected:
145 private:
157  void EnableYeah (const SequenceNumber32 &nextTxSequence);
158 
162  void DisableYeah ();
163 
164 private:
165  uint32_t m_alpha;
166  uint32_t m_gamma;
167  uint32_t m_delta;
168  uint32_t m_epsilon;
169  uint32_t m_phy;
170  uint32_t m_rho;
171  uint32_t m_zeta;
172 
173  uint32_t m_stcpAiFactor;
177  uint32_t m_cntRtt;
180  uint32_t m_lastQ;
181  uint32_t m_doingRenoNow;
182  uint32_t m_renoCount;
183  uint32_t m_fastCount;
184 };
185 
186 } // namespace ns3
187 
188 #endif // TCPYEAH_H
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
uint32_t m_stcpAiFactor
STCP additive increase parameter.
Definition: tcp-yeah.h:173
TcpYeah(void)
Create an unbound tcp socket.
Definition: tcp-yeah.cc:79
uint32_t m_fastCount
Number of RTTs in "Fast" mode.
Definition: tcp-yeah.h:183
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable YeAH algorithm depending on the congestion state.
Definition: tcp-yeah.cc:182
uint32_t m_epsilon
Log maximum fraction to be removed on early decongestion.
Definition: tcp-yeah.h:168
void DisableYeah()
Stop taking YeAH samples.
Definition: tcp-yeah.cc:174
uint32_t m_delta
Log minimum fraction of cwnd to be removed on loss.
Definition: tcp-yeah.h:167
The NewReno implementation.
uint32_t m_gamma
Fraction of queue to be removed per RTT when precautionary decongestion executed. ...
Definition: tcp-yeah.h:166
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Compute RTTs needed to execute YeAH algorithm.
Definition: tcp-yeah.cc:141
Time m_minRtt
Minimum of all RTTs measured within last RTT.
Definition: tcp-yeah.h:176
An implementation of TCP YeAH.
Definition: tcp-yeah.h:71
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-yeah.h:177
uint32_t m_phy
Maximum delta from base.
Definition: tcp-yeah.h:169
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-yeah.cc:310
uint32_t m_renoCount
Estimated cwnd of competing Reno flow.
Definition: tcp-yeah.h:182
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void EnableYeah(const SequenceNumber32 &nextTxSequence)
Enable YeAH algorithm to start taking YeAH samples.
Definition: tcp-yeah.cc:163
uint32_t m_lastQ
Last number of packets in the bottleneck queue.
Definition: tcp-yeah.h:180
Time m_baseRtt
Minimum of all YeAH RTT measurements seen during connection.
Definition: tcp-yeah.h:175
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Definition: tcp-yeah.cc:135
uint32_t m_rho
Minimum number of consecutive RTT to consider competition with Reno flows on loss.
Definition: tcp-yeah.h:170
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following YeAH dual-mode algorithm.
Definition: tcp-yeah.cc:198
bool m_doingYeahNow
If true, do YeAH for this RTT.
Definition: tcp-yeah.h:178
uint32_t m_zeta
Minimum number of state switches to reset m_renoCount.
Definition: tcp-yeah.h:171
Ptr< TcpScalable > m_stcp
TcpScalable object.
Definition: tcp-yeah.h:174
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-yeah.cc:37
SequenceNumber32 m_begSndNxt
Right edge during last RTT.
Definition: tcp-yeah.h:179
a unique identifier for an interface.
Definition: type-id.h:58
uint32_t m_alpha
Maximum backlog allowed at the bottleneck queue; Q_max in the paper.
Definition: tcp-yeah.h:165
uint32_t m_doingRenoNow
Number of RTTs in "Slow" mode.
Definition: tcp-yeah.h:181
virtual ~TcpYeah(void)
Definition: tcp-yeah.cc:129
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold upon the receipt of 3 dupACKs.
Definition: tcp-yeah.cc:316