A Discrete-Event Network Simulator
API
tcp-veno.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: Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
18  *
19  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
20  * ResiliNets Research Group https://resilinets.org/
21  * Information and Telecommunication Technology Center (ITTC)
22  * and Department of Electrical Engineering and Computer Science
23  * The University of Kansas Lawrence, KS USA.
24  */
25 
26 #ifndef TCPVENO_H
27 #define TCPVENO_H
28 
29 #include "tcp-congestion-ops.h"
30 
31 namespace ns3
32 {
33 
34 class TcpSocketState;
35 
71 class TcpVeno : public TcpNewReno
72 {
73  public:
78  static TypeId GetTypeId();
79 
83  TcpVeno();
84 
89  TcpVeno(const TcpVeno& sock);
90  ~TcpVeno() override;
91 
92  std::string GetName() const override;
93 
109  void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
110 
120  const TcpSocketState::TcpCongState_t newState) override;
121 
128  void IncreaseWindow(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
129 
138  uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
139 
140  Ptr<TcpCongestionOps> Fork() override;
141 
142  protected:
143  private:
154  void EnableVeno();
155 
159  void DisableVeno();
160 
161  private:
164  uint32_t m_cntRtt;
166  uint32_t m_diff;
167  bool m_inc;
168  uint32_t m_ackCnt;
169  uint32_t m_beta;
170 };
171 
172 } // namespace ns3
173 
174 #endif // TCPVENO_H
The NewReno implementation.
TcpCongState_t
Definition of the Congestion state machine.
An implementation of TCP Veno.
Definition: tcp-veno.h:72
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition: tcp-veno.cc:234
bool m_inc
If true, cwnd needs to be incremented.
Definition: tcp-veno.h:167
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Perform RTT sampling needed to execute Veno algorithm.
Definition: tcp-veno.cc:93
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold during Veno multiplicative-decrease phase.
Definition: tcp-veno.cc:240
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-veno.h:164
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-veno.cc:39
void EnableVeno()
Enable Veno algorithm to start Veno sampling.
Definition: tcp-veno.cc:114
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Adjust cwnd following Veno additive increase algorithm.
Definition: tcp-veno.cc:147
Time m_minRtt
Minimum of RTTs measured within last RTT.
Definition: tcp-veno.h:163
bool m_doingVenoNow
If true, do Veno for this RTT.
Definition: tcp-veno.h:165
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-veno.h:168
uint32_t m_beta
Threshold for congestion detection.
Definition: tcp-veno.h:169
void DisableVeno()
Turn off Veno.
Definition: tcp-veno.cc:123
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Enable/disable Veno depending on the congestion state.
Definition: tcp-veno.cc:131
~TcpVeno() override
Definition: tcp-veno.cc:81
TcpVeno()
Create an unbound tcp socket.
Definition: tcp-veno.cc:53
uint32_t m_diff
Difference between expected and actual throughput.
Definition: tcp-veno.h:166
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-veno.cc:87
Time m_baseRtt
Minimum of all RTT measurements seen during connection.
Definition: tcp-veno.h:162
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.