A Discrete-Event Network Simulator
API
tcp-htcp.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 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  * by: Amir Modarresi <amodarresi@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 TCP_HTCP_H
28 #define TCP_HTCP_H
29 
30 #include "ns3/tcp-congestion-ops.h"
31 #include "ns3/tcp-recovery-ops.h"
32 
33 namespace ns3 {
34 
48 class TcpHtcp : public TcpNewReno
49 {
50 public:
55  static TypeId GetTypeId (void);
59  TcpHtcp (void);
64  TcpHtcp (const TcpHtcp& sock);
65  virtual ~TcpHtcp (void);
66  virtual std::string GetName () const;
67  virtual Ptr<TcpCongestionOps> Fork ();
68  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
69  uint32_t bytesInFlight);
70 
71  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
72  const Time &rtt);
73 
74 protected:
75  virtual void CongestionAvoidance (Ptr<TcpSocketState> tcb,
76  uint32_t segmentsAcked);
77 
78 private:
82  void UpdateAlpha (void);
83 
87  void UpdateBeta (void);
88 
89  // h-tcp variables
90  double m_alpha;
91  double m_beta;
95  //last congestion event experienced by a flow
100  uint32_t m_throughput;
101  uint32_t m_lastThroughput;
102  uint32_t m_dataSent;
103 
104 };
105 
106 } // namespace ns3
107 
108 #endif /* TCP_HTCP_H */
Time m_delta
Time in second that has elapsed since the.
Definition: tcp-htcp.h:94
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
Definition: tcp-htcp.cc:111
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
double m_alpha
AIMD additive increase parameter.
Definition: tcp-htcp.h:90
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void UpdateAlpha(void)
Updates the additive increase parameter for H-TCP.
Definition: tcp-htcp.cc:126
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
Definition: tcp-htcp.cc:191
Time m_maxRtt
Maximum RTT in each congestion period.
Definition: tcp-htcp.h:99
The NewReno implementation.
An implementation of the H-TCP variant of TCP.
Definition: tcp-htcp.h:48
void UpdateBeta(void)
Updates the multiplicative decrease factor beta for H-TCP.
Definition: tcp-htcp.cc:151
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-htcp.cc:37
virtual ~TcpHtcp(void)
Definition: tcp-htcp.cc:100
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time m_minRtt
Minimum RTT in each congestion period.
Definition: tcp-htcp.h:98
uint32_t m_lastThroughput
Throughput in last congestion period.
Definition: tcp-htcp.h:101
uint32_t m_throughput
Current throughput since last congestion.
Definition: tcp-htcp.h:100
Time m_deltaL
Threshold for switching between standard and new increase function.
Definition: tcp-htcp.h:96
double m_defaultBackoff
default value when throughput ratio less than default
Definition: tcp-htcp.h:92
double m_throughputRatio
ratio of two consequence throughput
Definition: tcp-htcp.h:93
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
Definition: tcp-htcp.cc:169
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-htcp.cc:62
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Definition: tcp-htcp.cc:105
TcpHtcp(void)
Create an unbound tcp socket.
Definition: tcp-htcp.cc:67
Time m_lastCon
Time of the last congestion for the flow.
Definition: tcp-htcp.h:97
a unique identifier for an interface.
Definition: type-id.h:58
uint32_t m_dataSent
Current amount of data sent since last congestion.
Definition: tcp-htcp.h:102
double m_beta
AIMD multiplicative decrease factor.
Definition: tcp-htcp.h:91