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-westwood-plus.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Siddharth Gangadhar <siddharth@ittc.ku.edu>, Truc Anh N. Nguyen <annguyen@ittc.ku.edu>,
7
* and Greeshma Umapathi
8
*
9
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
10
* ResiliNets Research Group https://resilinets.org/
11
* Information and Telecommunication Technology Center (ITTC)
12
* and Department of Electrical Engineering and Computer Science
13
* The University of Kansas Lawrence, KS USA.
14
*
15
* Work supported in part by NSF FIND (Future Internet Design) Program
16
* under grant CNS-0626918 (Postmodern Internet Architecture),
17
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
18
* US Department of Defense (DoD), and ITTC at The University of Kansas.
19
*/
20
21
#ifndef TCP_WESTWOOD_H
22
#define TCP_WESTWOOD_H
23
24
#include "
tcp-congestion-ops.h
"
25
#include "
tcp-recovery-ops.h
"
26
27
#include "ns3/data-rate.h"
28
#include "ns3/event-id.h"
29
#include "ns3/traced-value.h"
30
31
namespace
ns3
32
{
33
34
class
Time
;
35
36
/**
37
* \ingroup congestionOps
38
*
39
* \brief An implementation of TCP Westwood+.
40
*
41
* Westwood+ employ the AIAD (Additive Increase/Adaptive Decrease)
42
* congestion control paradigm. When a congestion episode happens,
43
* instead of halving the cwnd, these protocols try to estimate the network's
44
* bandwidth and use the estimated value to adjust the cwnd.
45
* While Westwood performs the bandwidth sampling every ACK reception,
46
* Westwood+ samples the bandwidth every RTT.
47
*
48
* The two main methods in the implementation are the CountAck (const TCPHeader&)
49
* and the EstimateBW (int, const, Time). The CountAck method calculates
50
* the number of acknowledged segments on the receipt of an ACK.
51
* The EstimateBW estimates the bandwidth based on the value returned by CountAck
52
* and the sampling interval (last RTT).
53
*
54
* WARNING: this TCP model lacks validation and regression tests; use with caution.
55
*/
56
class
TcpWestwoodPlus
:
public
TcpNewReno
57
{
58
public
:
59
/**
60
* \brief Get the type ID.
61
* \return the object TypeId
62
*/
63
static
TypeId
GetTypeId
();
64
65
TcpWestwoodPlus
();
66
/**
67
* \brief Copy constructor
68
* \param sock the object to copy
69
*/
70
TcpWestwoodPlus
(
const
TcpWestwoodPlus
& sock);
71
~TcpWestwoodPlus
()
override
;
72
73
/**
74
* \brief Filter type (None or Tustin)
75
*/
76
enum
FilterType
77
{
78
NONE
,
79
TUSTIN
80
};
81
82
uint32_t
GetSsThresh
(
Ptr<const TcpSocketState>
tcb,
uint32_t
bytesInFlight)
override
;
83
84
void
PktsAcked
(
Ptr<TcpSocketState>
tcb,
uint32_t
packetsAcked,
const
Time
& rtt)
override
;
85
86
Ptr<TcpCongestionOps>
Fork
()
override
;
87
88
private
:
89
/**
90
* Update the total number of acknowledged packets during the current RTT
91
*
92
* \param [in] acked the number of packets the currently received ACK acknowledges
93
*/
94
void
UpdateAckedSegments
(
int
acked);
95
96
/**
97
* Estimate the network's bandwidth
98
*
99
* \param [in] rtt the RTT estimation.
100
* \param [in] tcb the socket state.
101
*/
102
void
EstimateBW
(
const
Time
& rtt,
Ptr<TcpSocketState>
tcb);
103
104
protected
:
105
TracedValue<DataRate>
m_currentBW
;
//!< Current value of the estimated BW
106
DataRate
m_lastSampleBW
;
//!< Last bandwidth sample
107
DataRate
m_lastBW
;
//!< Last bandwidth sample after being filtered
108
FilterType
m_fType
;
//!< 0 for none, 1 for Tustin
109
110
uint32_t
m_ackedSegments
;
//!< The number of segments ACKed between RTTs
111
bool
m_IsCount
;
//!< Start keeping track of m_ackedSegments for Westwood+ if TRUE
112
EventId
m_bwEstimateEvent
;
//!< The BW estimation event for Westwood+
113
Time
m_lastAck
;
//!< The last ACK time
114
};
115
116
}
// namespace ns3
117
118
#endif
/* TCP_WESTWOOD_H */
ns3::DataRate
Class for representing data rates.
Definition
data-rate.h:78
ns3::EventId
An identifier for simulation events.
Definition
event-id.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TcpNewReno
The NewReno implementation.
Definition
tcp-congestion-ops.h:201
ns3::TcpWestwoodPlus
An implementation of TCP Westwood+.
Definition
tcp-westwood-plus.h:57
ns3::TcpWestwoodPlus::EstimateBW
void EstimateBW(const Time &rtt, Ptr< TcpSocketState > tcb)
Estimate the network's bandwidth.
Definition
tcp-westwood-plus.cc:105
ns3::TcpWestwoodPlus::m_currentBW
TracedValue< DataRate > m_currentBW
Current value of the estimated BW.
Definition
tcp-westwood-plus.h:105
ns3::TcpWestwoodPlus::m_lastBW
DataRate m_lastBW
Last bandwidth sample after being filtered.
Definition
tcp-westwood-plus.h:107
ns3::TcpWestwoodPlus::m_bwEstimateEvent
EventId m_bwEstimateEvent
The BW estimation event for Westwood+.
Definition
tcp-westwood-plus.h:112
ns3::TcpWestwoodPlus::UpdateAckedSegments
void UpdateAckedSegments(int acked)
Update the total number of acknowledged packets during the current RTT.
ns3::TcpWestwoodPlus::FilterType
FilterType
Filter type (None or Tustin)
Definition
tcp-westwood-plus.h:77
ns3::TcpWestwoodPlus::TUSTIN
@ TUSTIN
Definition
tcp-westwood-plus.h:79
ns3::TcpWestwoodPlus::NONE
@ NONE
Definition
tcp-westwood-plus.h:78
ns3::TcpWestwoodPlus::m_lastSampleBW
DataRate m_lastSampleBW
Last bandwidth sample.
Definition
tcp-westwood-plus.h:106
ns3::TcpWestwoodPlus::GetSsThresh
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
Definition
tcp-westwood-plus.cc:134
ns3::TcpWestwoodPlus::PktsAcked
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t packetsAcked, const Time &rtt) override
Timing information on received ACK.
Definition
tcp-westwood-plus.cc:84
ns3::TcpWestwoodPlus::m_IsCount
bool m_IsCount
Start keeping track of m_ackedSegments for Westwood+ if TRUE.
Definition
tcp-westwood-plus.h:111
ns3::TcpWestwoodPlus::m_fType
FilterType m_fType
0 for none, 1 for Tustin
Definition
tcp-westwood-plus.h:108
ns3::TcpWestwoodPlus::m_lastAck
Time m_lastAck
The last ACK time.
Definition
tcp-westwood-plus.h:113
ns3::TcpWestwoodPlus::m_ackedSegments
uint32_t m_ackedSegments
The number of segments ACKed between RTTs.
Definition
tcp-westwood-plus.h:110
ns3::TcpWestwoodPlus::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
tcp-westwood-plus.cc:35
ns3::TcpWestwoodPlus::TcpWestwoodPlus
TcpWestwoodPlus()
Definition
tcp-westwood-plus.cc:55
ns3::TcpWestwoodPlus::Fork
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition
tcp-westwood-plus.cc:145
ns3::TcpWestwoodPlus::~TcpWestwoodPlus
~TcpWestwoodPlus() override
Definition
tcp-westwood-plus.cc:79
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TracedValue
Trace classes with value semantics.
Definition
traced-value.h:105
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition
nstime.h:828
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
tcp-congestion-ops.h
tcp-recovery-ops.h
src
internet
model
tcp-westwood-plus.h
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0