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-lp.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 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
* Authors: Charitha Sangaraju <charitha29193@gmail.com>
18
* Nandita G <gm.nandita@gmail.com>
19
* Mohit P. Tahiliani <tahiliani@nitk.edu.in>
20
*
21
*/
22
23
#ifndef TCPLP_H
24
#define TCPLP_H
25
26
#include "
tcp-congestion-ops.h
"
27
28
#include "ns3/traced-value.h"
29
30
namespace
ns3
31
{
32
33
class
TcpSocketState;
34
35
/**
36
* \ingroup congestionOps
37
*
38
* \brief TCP-LP (Low Priority) congestion control algorithm
39
*/
40
class
TcpLp
:
public
TcpNewReno
41
{
42
public
:
43
/**
44
* \brief Get the type ID.
45
*
46
* \return the object TypeId
47
*/
48
static
TypeId
GetTypeId
();
49
50
/**
51
* \brief Creates an unbound tcp socket.
52
*
53
*/
54
TcpLp
();
55
56
/**
57
* \brief Copy constructor
58
*
59
* \param sock the object to copy
60
*/
61
TcpLp
(
const
TcpLp
& sock);
62
63
~TcpLp
()
override
;
64
65
/**
66
* \brief Timing information on received ACK
67
*
68
* The function is called every time an ACK is received.
69
* It determines the state of TcpLp and adjusts the congestion window accordingly.
70
*
71
* \param tcb internal congestion state
72
* \param segmentsAcked count of segments acked
73
* \param rtt last rtt
74
*/
75
void
PktsAcked
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked,
const
Time
& rtt)
override
;
76
77
std::string
GetName
()
const override
;
78
79
Ptr<TcpCongestionOps>
Fork
()
override
;
80
81
protected
:
82
/**
83
* \brief Invokes Congestion Avoidance of TcpNewReno if TcpLp is not within inference.
84
*
85
* \param tcb internal congestion state
86
* \param segmentsAcked count of segments acked
87
*/
88
void
CongestionAvoidance
(
Ptr<TcpSocketState>
tcb,
uint32_t
segmentsAcked)
override
;
89
90
private
:
91
/**
92
* \brief Describes the state of TcpLp.
93
*
94
*/
95
enum
State
96
{
97
LP_VALID_OWD
= (1 << 1),
/**< Calculated One-Way Delay is valid */
98
LP_WITHIN_THR
= (1 << 3),
/**< TcpLp is within Threshold */
99
LP_WITHIN_INF
= (1 << 4),
/**< TcpLp is within Inference */
100
};
101
102
uint32_t
m_flag
;
//!< TcpLp state flag
103
uint32_t
m_sOwd
;
//!< Smoothed One-Way Delay
104
uint32_t
m_owdMin
;
//!< Minimum One-Way Delay
105
uint32_t
m_owdMax
;
//!< Maximum One-Way Delay
106
uint32_t
m_owdMaxRsv
;
//!< Reserved Maximum One-Way Delay
107
Time
m_lastDrop
;
//!< Last time when cwnd was reduced
108
Time
m_inference
;
//!< Current inference period
109
110
private
:
111
/**
112
* \brief Calculates One-Way Delay using Sender and Receiver timestamps.
113
*
114
* \param tcb internal congestion state
115
* \return One-Way Delay
116
*/
117
uint32_t
OwdCalculator
(
Ptr<TcpSocketState>
tcb);
118
119
/**
120
* \brief Estimates minimum and maximum One-Way Delays and calculates the smoothed One-Way
121
* Delay.
122
*
123
* \param tcb internal congestion state
124
*/
125
void
RttSample
(
Ptr<TcpSocketState>
tcb);
126
};
127
128
}
// namespace ns3
129
130
#endif
// TCPLP_H
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TcpLp
TCP-LP (Low Priority) congestion control algorithm.
Definition:
tcp-lp.h:41
ns3::TcpLp::GetName
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition:
tcp-lp.cc:231
ns3::TcpLp::m_inference
Time m_inference
Current inference period.
Definition:
tcp-lp.h:108
ns3::TcpLp::m_flag
uint32_t m_flag
TcpLp state flag.
Definition:
tcp-lp.h:102
ns3::TcpLp::~TcpLp
~TcpLp() override
Definition:
tcp-lp.cc:70
ns3::TcpLp::PktsAcked
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
Definition:
tcp-lp.cc:167
ns3::TcpLp::m_owdMax
uint32_t m_owdMax
Maximum One-Way Delay.
Definition:
tcp-lp.h:105
ns3::TcpLp::RttSample
void RttSample(Ptr< TcpSocketState > tcb)
Estimates minimum and maximum One-Way Delays and calculates the smoothed One-Way Delay.
Definition:
tcp-lp.cc:117
ns3::TcpLp::Fork
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition:
tcp-lp.cc:76
ns3::TcpLp::m_owdMaxRsv
uint32_t m_owdMaxRsv
Reserved Maximum One-Way Delay.
Definition:
tcp-lp.h:106
ns3::TcpLp::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
tcp-lp.cc:35
ns3::TcpLp::CongestionAvoidance
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Invokes Congestion Avoidance of TcpNewReno if TcpLp is not within inference.
Definition:
tcp-lp.cc:82
ns3::TcpLp::m_owdMin
uint32_t m_owdMin
Minimum One-Way Delay.
Definition:
tcp-lp.h:104
ns3::TcpLp::TcpLp
TcpLp()
Creates an unbound tcp socket.
Definition:
tcp-lp.cc:44
ns3::TcpLp::State
State
Describes the state of TcpLp.
Definition:
tcp-lp.h:96
ns3::TcpLp::LP_WITHIN_INF
@ LP_WITHIN_INF
TcpLp is within Inference.
Definition:
tcp-lp.h:99
ns3::TcpLp::LP_VALID_OWD
@ LP_VALID_OWD
Calculated One-Way Delay is valid.
Definition:
tcp-lp.h:97
ns3::TcpLp::LP_WITHIN_THR
@ LP_WITHIN_THR
TcpLp is within Threshold.
Definition:
tcp-lp.h:98
ns3::TcpLp::OwdCalculator
uint32_t OwdCalculator(Ptr< TcpSocketState > tcb)
Calculates One-Way Delay using Sender and Receiver timestamps.
Definition:
tcp-lp.cc:93
ns3::TcpLp::m_lastDrop
Time m_lastDrop
Last time when cwnd was reduced.
Definition:
tcp-lp.h:107
ns3::TcpLp::m_sOwd
uint32_t m_sOwd
Smoothed One-Way Delay.
Definition:
tcp-lp.h:103
ns3::TcpNewReno
The NewReno implementation.
Definition:
tcp-congestion-ops.h:212
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
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
src
internet
model
tcp-lp.h
Generated on Tue May 28 2024 23:36:13 for ns-3 by
1.9.6