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