A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-htcp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 ResiliNets, ITTC, University of Kansas
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * by: Amir Modarresi <amodarresi@ittc.ku.edu>
7 *
8 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
9 * ResiliNets Research Group https://resilinets.org/
10 * Information and Telecommunication Technology Center (ITTC)
11 * and Department of Electrical Engineering and Computer Science
12 * The University of Kansas Lawrence, KS USA.
13 */
14
15#ifndef TCP_HTCP_H
16#define TCP_HTCP_H
17
18#include "tcp-congestion-ops.h"
19
20namespace ns3
21{
22
23class TcpSocketState;
24
25/**
26 * \ingroup congestionOps
27 *
28 * \brief An implementation of the H-TCP variant of TCP.
29 *
30 * This class contains the H-TCP implementation of TCP, according to
31 * Internet-Draft draft-leith-tcp-htcp-03 and its related paper,
32 * "H-TCP: TCP for high-speed and long-distance networks"
33 * H-TCP is a congestion control protocol suitable for high bandwidth-delay
34 * product networks. It is fair to similar flows present in the network and
35 * also friendly with conventional TCP. It also makes use of free
36 * bandwidth when it is available.
37 */
38class TcpHtcp : public TcpNewReno
39{
40 public:
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46 /**
47 * Create an unbound tcp socket.
48 */
49 TcpHtcp();
50 /**
51 * \brief Copy constructor
52 * \param sock the object to copy
53 */
54 TcpHtcp(const TcpHtcp& sock);
55 ~TcpHtcp() override;
56 std::string GetName() const override;
57 Ptr<TcpCongestionOps> Fork() override;
58 uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
59
60 void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
61
62 protected:
63 void CongestionAvoidance(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
64
65 private:
66 /**
67 * \brief Updates the additive increase parameter for H-TCP
68 */
69 void UpdateAlpha();
70
71 /**
72 * \brief Updates the multiplicative decrease factor beta for H-TCP
73 */
74 void UpdateBeta();
75
76 // h-tcp variables
77 double m_alpha; //!< AIMD additive increase parameter
78 double m_beta; //!< AIMD multiplicative decrease factor
79 double m_defaultBackoff; //!< default value when throughput ratio less than default
80 double m_throughputRatio; //!< ratio of two consequence throughput
81 Time m_delta; //!< Time in second that has elapsed since the
82 // last congestion event experienced by a flow
83 Time m_deltaL; //!< Threshold for switching between standard and new increase function
84 Time m_lastCon; //!< Time of the last congestion for the flow
85 Time m_minRtt; //!< Minimum RTT in each congestion period
86 Time m_maxRtt; //!< Maximum RTT in each congestion period
87 uint32_t m_throughput; //!< Current throughput since last congestion
88 uint32_t m_lastThroughput; //!< Throughput in last congestion period
89 uint32_t m_dataSent; //!< Current amount of data sent since last congestion
90};
91
92} // namespace ns3
93
94#endif /* TCP_HTCP_H */
Smart pointer class similar to boost::intrusive_ptr.
An implementation of the H-TCP variant of TCP.
Definition tcp-htcp.h:39
Time m_minRtt
Minimum RTT in each congestion period.
Definition tcp-htcp.h:85
Time m_lastCon
Time of the last congestion for the flow.
Definition tcp-htcp.h:84
void UpdateBeta()
Updates the multiplicative decrease factor beta for H-TCP.
Definition tcp-htcp.cc:145
double m_defaultBackoff
default value when throughput ratio less than default
Definition tcp-htcp.h:79
uint32_t m_dataSent
Current amount of data sent since last congestion.
Definition tcp-htcp.h:89
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
Definition tcp-htcp.cc:164
double m_throughputRatio
ratio of two consequence throughput
Definition tcp-htcp.h:80
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition tcp-htcp.cc:53
Time m_delta
Time in second that has elapsed since the.
Definition tcp-htcp.h:81
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
NewReno congestion avoidance.
Definition tcp-htcp.cc:104
uint32_t m_lastThroughput
Throughput in last congestion period.
Definition tcp-htcp.h:88
double m_alpha
AIMD additive increase parameter.
Definition tcp-htcp.h:77
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
Definition tcp-htcp.cc:186
double m_beta
AIMD multiplicative decrease factor.
Definition tcp-htcp.h:78
Time m_deltaL
Threshold for switching between standard and new increase function.
Definition tcp-htcp.h:83
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition tcp-htcp.cc:97
TcpHtcp()
Create an unbound tcp socket.
Definition tcp-htcp.cc:58
Time m_maxRtt
Maximum RTT in each congestion period.
Definition tcp-htcp.h:86
~TcpHtcp() override
Definition tcp-htcp.cc:91
void UpdateAlpha()
Updates the additive increase parameter for H-TCP.
Definition tcp-htcp.cc:119
static TypeId GetTypeId()
Get the type ID.
Definition tcp-htcp.cc:28
uint32_t m_throughput
Current throughput since last congestion.
Definition tcp-htcp.h:87
The NewReno implementation.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.