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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Apoorva Bharagava <apoorvabhargava13@gmail.com>
7
* Mohit P. Tahiliani <tahiliani@nitk.edu.in>
8
*
9
*/
10
11
#ifndef TCPLINUXRENO_H
12
#define TCPLINUXRENO_H
13
14
#include "
tcp-congestion-ops.h
"
15
#include "
tcp-socket-state.h
"
16
17
namespace
ns3
18
{
19
20
/**
21
* \ingroup congestionOps
22
*
23
* \brief Reno congestion control algorithm
24
*
25
* This class implement the Reno congestion control type
26
* and it mimics the one implemented in the Linux kernel.
27
*/
28
class
TcpLinuxReno
:
public
TcpCongestionOps
29
{
30
public
:
31
/**
32
* \brief Get the type ID.
33
* \return the object TypeId
34
*/
35
static
TypeId
GetTypeId
();
36
37
TcpLinuxReno
();
38
39
/**
40
* \brief Copy constructor.
41
* \param sock object to copy.
42
*/
43
TcpLinuxReno
(
const
TcpLinuxReno
& sock);
44
45
~TcpLinuxReno
()
override
;
46
47
std::string
GetName
()
const override
;
48
49
void
IncreaseWindow
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked)
override
;
50
uint32_t
GetSsThresh
(
Ptr<const TcpSocketState>
tcb,
uint32_t
bytesInFlight)
override
;
51
Ptr<TcpCongestionOps>
Fork
()
override
;
52
53
protected
:
54
/**
55
* Slow start phase handler
56
* \param tcb Transmission Control Block of the connection
57
* \param segmentsAcked count of segments acked
58
* \return Number of segments acked minus the difference between the receiver and sender Cwnd
59
*/
60
virtual
uint32_t
SlowStart
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked);
61
/**
62
* Congestion avoidance phase handler
63
* \param tcb Transmission Control Block of the connection
64
* \param segmentsAcked count of segments acked
65
*/
66
virtual
void
CongestionAvoidance
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked);
67
68
/**
69
* TcpSocketBase follows the Linux way of setting a flag 'isCwndLimited'
70
* when BytesInFlight() >= cwnd. This flag, if true, will suppress
71
* additive increase window updates for this class. However, some
72
* derived classes using the IncreaseWindow() method may not want this
73
* behavior, so this method exists to allow subclasses to set it to false.
74
*
75
* \param value Value to set whether the isCwndLimited condition
76
* suppresses window updates
77
*/
78
void
SetSuppressIncreaseIfCwndLimited
(
bool
value);
79
80
private
:
81
uint32_t
m_cWndCnt
{0};
//!< Linear increase counter
82
// The below flag exists for classes derived from TcpLinuxReno (such as
83
// TcpDctcp) that may not want to suppress cwnd increase, unlike Linux's
84
// tcp_reno_cong_avoid()
85
bool
m_suppressIncreaseIfCwndLimited
{
86
true
};
//!< Suppress window increase if TCP is not cwnd limited
87
};
88
89
}
// namespace ns3
90
91
#endif
// TCPLINUXRENO_H
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TcpCongestionOps
Congestion control abstract class.
Definition
tcp-congestion-ops.h:41
ns3::TcpLinuxReno
Reno congestion control algorithm.
Definition
tcp-linux-reno.h:29
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:135
ns3::TcpLinuxReno::m_suppressIncreaseIfCwndLimited
bool m_suppressIncreaseIfCwndLimited
Suppress window increase if TCP is not cwnd limited.
Definition
tcp-linux-reno.h:85
ns3::TcpLinuxReno::GetName
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition
tcp-linux-reno.cc:129
ns3::TcpLinuxReno::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
tcp-linux-reno.cc:23
ns3::TcpLinuxReno::~TcpLinuxReno
~TcpLinuxReno() override
Definition
tcp-linux-reno.cc:44
ns3::TcpLinuxReno::TcpLinuxReno
TcpLinuxReno()
Definition
tcp-linux-reno.cc:32
ns3::TcpLinuxReno::SlowStart
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Slow start phase handler.
Definition
tcp-linux-reno.cc:49
ns3::TcpLinuxReno::IncreaseWindow
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
Definition
tcp-linux-reno.cc:110
ns3::TcpLinuxReno::CongestionAvoidance
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance phase handler.
Definition
tcp-linux-reno.cc:67
ns3::TcpLinuxReno::m_cWndCnt
uint32_t m_cWndCnt
Linear increase counter.
Definition
tcp-linux-reno.h:81
ns3::TcpLinuxReno::Fork
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition
tcp-linux-reno.cc:144
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:150
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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 Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0