A Discrete-Event Network Simulator
API
tcp-cubic.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
19#ifndef TCPCUBIC_H
20#define TCPCUBIC_H
21
22#include "ns3/tcp-congestion-ops.h"
23#include "ns3/tcp-socket-base.h"
24
25namespace ns3
26{
27
70{
71 public:
76 static TypeId GetTypeId();
77
78 TcpCubic();
79
84 TcpCubic(const TcpCubic& sock);
85
86 std::string GetName() const override;
87 void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
88 void IncreaseWindow(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
89 uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
91 const TcpSocketState::TcpCongState_t newState) override;
92
93 Ptr<TcpCongestionOps> Fork() override;
94
95 private:
100 {
102 DELAY = 0x2
103 };
104
106 double m_beta;
107
115
117 uint8_t m_cntClamp;
118
119 double m_c;
120
121 // Cubic parameters
125 double m_bicK;
126 // of the current epoch (in s)
129 bool m_found;
136
137 private:
143
149
156
163 void HystartUpdate(Ptr<TcpSocketState> tcb, const Time& delay);
164
175 Time HystartDelayThresh(const Time& t) const;
176};
177
178} // namespace ns3
179
180#endif // TCPCUBIC_H
Congestion control abstract class.
The Cubic Congestion Control Algorithm.
Definition: tcp-cubic.h:70
Time m_currRtt
Current Rtt.
Definition: tcp-cubic.h:134
void HystartReset(Ptr< const TcpSocketState > tcb)
Reset HyStart parameters.
Definition: tcp-cubic.cc:167
Time m_hystartDelayMax
Maximum time for hystart algorithm.
Definition: tcp-cubic.h:113
Time m_cubicDelta
Time to wait after recovery before update.
Definition: tcp-cubic.h:133
uint32_t m_bicOriginPoint
Origin point of bic function.
Definition: tcp-cubic.h:124
uint32_t Update(Ptr< TcpSocketState > tcb)
Cubic window update after a new ack received.
Definition: tcp-cubic.cc:230
uint32_t m_sampleCnt
Count of samples for HyStart.
Definition: tcp-cubic.h:135
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
Definition: tcp-cubic.cc:407
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition: tcp-cubic.cc:161
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-cubic.cc:460
bool m_hystart
Enable or disable HyStart algorithm.
Definition: tcp-cubic.h:108
double m_bicK
Time to origin point from the beginning.
Definition: tcp-cubic.h:125
int m_hystartDetect
Detect way for HyStart algorithm.
Definition: tcp-cubic.h:109
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
Definition: tcp-cubic.cc:315
uint32_t m_cWndCnt
cWnd integer-to-float counter
Definition: tcp-cubic.h:122
Time m_hystartDelayMin
Minimum time for hystart algorithm.
Definition: tcp-cubic.h:112
bool m_found
The exit point is found?
Definition: tcp-cubic.h:129
SequenceNumber32 m_endSeq
End sequence of the round.
Definition: tcp-cubic.h:131
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
Definition: tcp-cubic.cc:178
double m_beta
Beta for cubic multiplicative increase.
Definition: tcp-cubic.h:106
Time m_lastAck
Last time when the ACK spacing is close.
Definition: tcp-cubic.h:132
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Trigger events/calculations specific to a congestion state.
Definition: tcp-cubic.cc:436
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-cubic.cc:36
Time m_hystartAckDelta
Spacing between ack's indicating train.
Definition: tcp-cubic.h:111
bool m_fastConvergence
Enable or disable fast convergence algorithm.
Definition: tcp-cubic.h:105
Time m_delayMin
Min delay.
Definition: tcp-cubic.h:127
Time m_roundStart
Beginning of each round.
Definition: tcp-cubic.h:130
Time m_epochStart
Beginning of an epoch.
Definition: tcp-cubic.h:128
uint8_t m_cntClamp
Modulo of the (avoided) float division for cWnd.
Definition: tcp-cubic.h:117
void HystartUpdate(Ptr< TcpSocketState > tcb, const Time &delay)
Update HyStart parameters.
Definition: tcp-cubic.cc:340
double m_c
Cubic Scaling factor.
Definition: tcp-cubic.h:119
void CubicReset(Ptr< const TcpSocketState > tcb)
Reset Cubic parameters.
Definition: tcp-cubic.cc:448
HybridSSDetectionMode
Values to detect the Slow Start mode of HyStart.
Definition: tcp-cubic.h:100
@ DELAY
Detection by delay value.
Definition: tcp-cubic.h:102
@ PACKET_TRAIN
Detection by trains of packet.
Definition: tcp-cubic.h:101
uint32_t m_lastMaxCwnd
Last maximum cWnd.
Definition: tcp-cubic.h:123
Time HystartDelayThresh(const Time &t) const
Clamp time value in a range.
Definition: tcp-cubic.cc:389
uint32_t m_initialCwnd
Initial cWnd.
Definition: tcp-cubic.h:116
uint8_t m_hystartMinSamples
Number of delay samples for detecting the increase of delay.
Definition: tcp-cubic.h:114
uint32_t m_hystartLowWindow
Lower bound cWnd for hybrid slow start (segments)
Definition: tcp-cubic.h:110
TcpCongState_t
Definition of the Congestion state machine.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.