A Discrete-Event Network Simulator
API
tcp-htcp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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  * by: Amir Modarresi <amodarresi@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 TCP_HTCP_H
27 #define TCP_HTCP_H
28 
29 #include "tcp-congestion-ops.h"
30 
31 namespace ns3
32 {
33 
34 class TcpSocketState;
35 
49 class TcpHtcp : public TcpNewReno
50 {
51  public:
56  static TypeId GetTypeId();
60  TcpHtcp();
65  TcpHtcp(const TcpHtcp& sock);
66  ~TcpHtcp() override;
67  std::string GetName() const override;
68  Ptr<TcpCongestionOps> Fork() override;
69  uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
70 
71  void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
72 
73  protected:
74  void CongestionAvoidance(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
75 
76  private:
80  void UpdateAlpha();
81 
85  void UpdateBeta();
86 
87  // h-tcp variables
88  double m_alpha;
89  double m_beta;
93  // last congestion event experienced by a flow
98  uint32_t m_throughput;
99  uint32_t m_lastThroughput;
100  uint32_t m_dataSent;
101 };
102 
103 } // namespace ns3
104 
105 #endif /* TCP_HTCP_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
An implementation of the H-TCP variant of TCP.
Definition: tcp-htcp.h:50
Time m_minRtt
Minimum RTT in each congestion period.
Definition: tcp-htcp.h:96
Time m_lastCon
Time of the last congestion for the flow.
Definition: tcp-htcp.h:95
void UpdateBeta()
Updates the multiplicative decrease factor beta for H-TCP.
Definition: tcp-htcp.cc:156
double m_defaultBackoff
default value when throughput ratio less than default
Definition: tcp-htcp.h:90
uint32_t m_dataSent
Current amount of data sent since last congestion.
Definition: tcp-htcp.h:100
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
Definition: tcp-htcp.cc:175
double m_throughputRatio
ratio of two consequence throughput
Definition: tcp-htcp.h:91
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition: tcp-htcp.cc:64
Time m_delta
Time in second that has elapsed since the.
Definition: tcp-htcp.h:92
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
NewReno congestion avoidance.
Definition: tcp-htcp.cc:115
uint32_t m_lastThroughput
Throughput in last congestion period.
Definition: tcp-htcp.h:99
double m_alpha
AIMD additive increase parameter.
Definition: tcp-htcp.h:88
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
Definition: tcp-htcp.cc:197
double m_beta
AIMD multiplicative decrease factor.
Definition: tcp-htcp.h:89
Time m_deltaL
Threshold for switching between standard and new increase function.
Definition: tcp-htcp.h:94
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-htcp.cc:108
TcpHtcp()
Create an unbound tcp socket.
Definition: tcp-htcp.cc:69
Time m_maxRtt
Maximum RTT in each congestion period.
Definition: tcp-htcp.h:97
~TcpHtcp() override
Definition: tcp-htcp.cc:102
void UpdateAlpha()
Updates the additive increase parameter for H-TCP.
Definition: tcp-htcp.cc:130
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-htcp.cc:39
uint32_t m_throughput
Current throughput since last congestion.
Definition: tcp-htcp.h:98
The NewReno implementation.
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.