A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
tcp-linux-reno.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 NITK Surathkal
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
* Author: Apoorva Bharagava <apoorvabhargava13@gmail.com>
18
* Mohit P. Tahiliani <tahiliani@nitk.edu.in>
19
*
20
*/
21
22
#ifndef TCPLINUXRENO_H
23
#define TCPLINUXRENO_H
24
25
#include "
tcp-congestion-ops.h
"
26
#include "
tcp-socket-state.h
"
27
28
namespace
ns3
29
{
30
31
/**
32
* \ingroup congestionOps
33
*
34
* \brief Reno congestion control algorithm
35
*
36
* This class implement the Reno congestion control type
37
* and it mimics the one implemented in the Linux kernel.
38
*/
39
class
TcpLinuxReno
:
public
TcpCongestionOps
40
{
41
public
:
42
/**
43
* \brief Get the type ID.
44
* \return the object TypeId
45
*/
46
static
TypeId
GetTypeId
();
47
48
TcpLinuxReno
();
49
50
/**
51
* \brief Copy constructor.
52
* \param sock object to copy.
53
*/
54
TcpLinuxReno
(
const
TcpLinuxReno
& sock);
55
56
~TcpLinuxReno
()
override
;
57
58
std::string
GetName
()
const override
;
59
60
void
IncreaseWindow
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked)
override
;
61
uint32_t
GetSsThresh
(
Ptr<const TcpSocketState>
tcb,
uint32_t
bytesInFlight)
override
;
62
Ptr<TcpCongestionOps>
Fork
()
override
;
63
64
protected
:
65
/**
66
* Slow start phase handler
67
* \param tcb Transmission Control Block of the connection
68
* \param segmentsAcked count of segments acked
69
* \return Number of segments acked minus the difference between the receiver and sender Cwnd
70
*/
71
virtual
uint32_t
SlowStart
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked);
72
/**
73
* Congestion avoidance phase handler
74
* \param tcb Transmission Control Block of the connection
75
* \param segmentsAcked count of segments acked
76
*/
77
virtual
void
CongestionAvoidance
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked);
78
79
/**
80
* TcpSocketBase follows the Linux way of setting a flag 'isCwndLimited'
81
* when BytesInFlight() >= cwnd. This flag, if true, will suppress
82
* additive increase window updates for this class. However, some
83
* derived classes using the IncreaseWindow() method may not want this
84
* behavior, so this method exists to allow subclasses to set it to false.
85
*
86
* \param value Value to set whether the isCwndLimited condition
87
* suppresses window updates
88
*/
89
void
SetSuppressIncreaseIfCwndLimited
(
bool
value);
90
91
private
:
92
uint32_t
m_cWndCnt
{0};
//!< Linear increase counter
93
// The below flag exists for classes derived from TcpLinuxReno (such as
94
// TcpDctcp) that may not want to suppress cwnd increase, unlike Linux's
95
// tcp_reno_cong_avoid()
96
bool
m_suppressIncreaseIfCwndLimited
{
97
true
};
//!< Suppress window increase if TCP is not cwnd limited
98
};
99
100
}
// namespace ns3
101
102
#endif
// TCPLINUXRENO_H
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TcpCongestionOps
Congestion control abstract class.
Definition:
tcp-congestion-ops.h:52
ns3::TcpLinuxReno
Reno congestion control algorithm.
Definition:
tcp-linux-reno.h:40
ns3::TcpLinuxReno::GetSsThresh
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
Definition:
tcp-linux-reno.cc:146
ns3::TcpLinuxReno::m_suppressIncreaseIfCwndLimited
bool m_suppressIncreaseIfCwndLimited
Suppress window increase if TCP is not cwnd limited.
Definition:
tcp-linux-reno.h:96
ns3::TcpLinuxReno::GetName
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition:
tcp-linux-reno.cc:140
ns3::TcpLinuxReno::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
tcp-linux-reno.cc:34
ns3::TcpLinuxReno::~TcpLinuxReno
~TcpLinuxReno() override
Definition:
tcp-linux-reno.cc:55
ns3::TcpLinuxReno::TcpLinuxReno
TcpLinuxReno()
Definition:
tcp-linux-reno.cc:43
ns3::TcpLinuxReno::SlowStart
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Slow start phase handler.
Definition:
tcp-linux-reno.cc:60
ns3::TcpLinuxReno::IncreaseWindow
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
Definition:
tcp-linux-reno.cc:121
ns3::TcpLinuxReno::CongestionAvoidance
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance phase handler.
Definition:
tcp-linux-reno.cc:78
ns3::TcpLinuxReno::m_cWndCnt
uint32_t m_cWndCnt
Linear increase counter.
Definition:
tcp-linux-reno.h:92
ns3::TcpLinuxReno::Fork
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition:
tcp-linux-reno.cc:155
ns3::TcpLinuxReno::SetSuppressIncreaseIfCwndLimited
void SetSuppressIncreaseIfCwndLimited(bool value)
TcpSocketBase follows the Linux way of setting a flag 'isCwndLimited' when BytesInFlight() >= cwnd.
Definition:
tcp-linux-reno.cc:161
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
tcp-congestion-ops.h
tcp-socket-state.h
src
internet
model
tcp-linux-reno.h
Generated on Tue May 28 2024 23:36:13 for ns-3 by
1.9.6