A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-hybla.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Natale Patriciello <natale.patriciello@gmail.com>
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 */
18#ifndef TCPHYBLA_H
19#define TCPHYBLA_H
20
21#include "tcp-congestion-ops.h"
22
23#include "ns3/traced-value.h"
24
25namespace ns3
26{
27
28class TcpSocketState;
29
30/**
31 * \ingroup congestionOps
32 *
33 * \brief Implementation of the TCP Hybla algorithm
34 *
35 * The key idea behind TCP Hybla is to obtain for long RTT connections the same
36 * instantaneous transmission rate of a reference TCP connection with lower RTT.
37 * With analytical steps, it is shown that this goal can be achieved by
38 * modifying the time scale, in order for the throughput to be independent from
39 * the RTT. This independence is obtained through the use of a coefficient rho.
40 *
41 * This coefficient is used to calculate both the slow start threshold
42 * and the congestion window when in slow start and in congestion avoidance,
43 * respectively.
44 *
45 * More information: http://dl.acm.org/citation.cfm?id=2756518
46 */
47class TcpHybla : public TcpNewReno
48{
49 public:
50 /**
51 * \brief Get the type ID.
52 * \return the object TypeId
53 */
54 static TypeId GetTypeId();
55
56 /**
57 * Create an unbound tcp socket.
58 */
59 TcpHybla();
60
61 /**
62 * \brief Copy constructor
63 * \param sock the object to copy
64 */
65 TcpHybla(const TcpHybla& sock);
66
67 ~TcpHybla() override;
68
69 // Inherited
70 void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
71 std::string GetName() const override;
72 Ptr<TcpCongestionOps> Fork() override;
73
74 protected:
75 uint32_t SlowStart(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
76 void CongestionAvoidance(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
77
78 private:
79 TracedValue<double> m_rho; //!< Rho parameter
80 Time m_rRtt; //!< Reference RTT
81 double m_cWndCnt; //!< cWnd integer-to-float counter
82
83 private:
84 /**
85 * \brief Recalculate algorithm parameters
86 * \param tcb the socket state.
87 */
88 void RecalcParam(const Ptr<TcpSocketState>& tcb);
89};
90
91} // namespace ns3
92
93#endif // TCPHYBLA_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Implementation of the TCP Hybla algorithm.
Definition: tcp-hybla.h:48
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-hybla.cc:32
Time m_rRtt
Reference RTT.
Definition: tcp-hybla.h:80
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-hybla.cc:166
TcpHybla()
Create an unbound tcp socket.
Definition: tcp-hybla.cc:50
uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Tcp NewReno slow start algorithm.
Definition: tcp-hybla.cc:95
TracedValue< double > m_rho
Rho parameter.
Definition: tcp-hybla.h:79
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition: tcp-hybla.cc:172
void RecalcParam(const Ptr< TcpSocketState > &tcb)
Recalculate algorithm parameters.
Definition: tcp-hybla.cc:72
~TcpHybla() override
Definition: tcp-hybla.cc:66
double m_cWndCnt
cWnd integer-to-float counter
Definition: tcp-hybla.h:81
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
Definition: tcp-hybla.cc:83
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
NewReno congestion avoidance.
Definition: tcp-hybla.cc:125
The NewReno implementation.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Trace classes with value semantics.
Definition: traced-value.h:116
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.