A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tcp-westwood.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Authors: Siddharth Gangadhar <siddharth@ittc.ku.edu>, Truc Anh N. Nguyen <annguyen@ittc.ku.edu>,
19
* and Greeshma Umapathi
20
*
21
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
22
* ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
23
* Information and Telecommunication Technology Center (ITTC)
24
* and Department of Electrical Engineering and Computer Science
25
* The University of Kansas Lawrence, KS USA.
26
*
27
* Work supported in part by NSF FIND (Future Internet Design) Program
28
* under grant CNS-0626918 (Postmodern Internet Architecture),
29
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
30
* US Department of Defense (DoD), and ITTC at The University of Kansas.
31
*/
32
33
#ifndef TCP_WESTWOOD_H
34
#define TCP_WESTWOOD_H
35
36
#include "
tcp-socket-base.h
"
37
#include "ns3/packet.h"
38
39
namespace
ns3 {
40
62
class
TcpWestwood
:
public
TcpSocketBase
63
{
64
public
:
65
static
TypeId
GetTypeId
(
void
);
66
67
TcpWestwood
(
void
);
68
TcpWestwood
(
const
TcpWestwood
& sock);
69
virtual
~TcpWestwood
(
void
);
70
71
enum
ProtocolType
72
{
73
WESTWOOD
,
74
WESTWOODPLUS
75
};
76
77
enum
FilterType
78
{
79
NONE
,
80
TUSTIN
81
};
82
83
// From TcpSocketBase
84
virtual
int
Connect
(
const
Address
&
address
);
85
virtual
int
Listen
(
void
);
86
87
protected
:
93
virtual
uint32_t
Window
(
void
);
94
98
virtual
Ptr<TcpSocketBase>
Fork
(
void
);
99
106
virtual
void
ReceivedAck
(
Ptr<Packet>
packet,
const
TcpHeader
& tcpHeader);
107
114
virtual
void
NewAck
(
SequenceNumber32
const
& seq);
115
123
virtual
void
DupAck
(
const
TcpHeader
& header, uint32_t count);
124
129
virtual
void
Retransmit
(
void
);
130
135
virtual
void
EstimateRtt
(
const
TcpHeader
& header);
136
137
// Implementing ns3::TcpSocket -- Attribute get/set
141
virtual
void
SetSegSize
(uint32_t size);
142
146
virtual
void
SetSSThresh
(uint32_t threshold);
147
151
virtual
uint32_t
GetSSThresh
(
void
)
const
;
152
156
virtual
void
SetInitialCwnd
(uint32_t cwnd);
157
161
virtual
uint32_t
GetInitialCwnd
(
void
)
const
;
162
163
private
:
167
void
InitializeCwnd
(
void
);
168
175
int
CountAck
(
const
TcpHeader
& tcpHeader);
176
182
void
UpdateAckedSegments
(
int
acked);
183
191
void
EstimateBW
(
int
acked,
const
TcpHeader
& tcpHeader,
Time
rtt);
192
196
void
Filtering
(
void
);
197
198
protected
:
199
TracedValue<uint32_t>
m_cWnd
;
//< Congestion window
200
uint32_t
m_ssThresh
;
//< Slow Start Threshold
201
uint32_t
m_initialCWnd
;
//< Initial cWnd value
202
bool
m_inFastRec
;
//< Currently in fast recovery if TRUE
203
204
TracedValue<double>
m_currentBW
;
//< Current value of the estimated BW
205
double
m_lastSampleBW
;
//< Last bandwidth sample
206
double
m_lastBW
;
//< Last bandwidth sample after being filtered
207
Time
m_minRtt
;
//< Minimum RTT
208
double
m_lastAck
;
//< The time last ACK was received
209
SequenceNumber32
m_prevAckNo
;
//< Previously received ACK number
210
int
m_accountedFor
;
//< The number of received DUPACKs
211
enum
ProtocolType
m_pType
;
//< 0 for Westwood, 1 for Westwood+
212
enum
FilterType
m_fType
;
//< 0 for none, 1 for Tustin
213
214
int
m_ackedSegments
;
//< The number of segments ACKed between RTTs
215
bool
m_IsCount
;
//< Start keeping track of m_ackedSegments for Westwood+ if TRUE
216
EventId
m_bwEstimateEvent
;
//< The BW estimation event for Westwood+
217
218
};
219
220
}
// namespace ns3
221
222
#endif
/* TCP_WESTWOOD_H */
ns3::TcpWestwood::InitializeCwnd
void InitializeCwnd(void)
Definition:
tcp-westwood.cc:411
ns3::TcpWestwood::m_bwEstimateEvent
EventId m_bwEstimateEvent
Definition:
tcp-westwood.h:216
ns3::TcpWestwood::CountAck
int CountAck(const TcpHeader &tcpHeader)
Definition:
tcp-westwood.cc:228
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::TcpWestwood::m_lastBW
double m_lastBW
Definition:
tcp-westwood.h:206
ns3::TcpWestwood::m_accountedFor
int m_accountedFor
Definition:
tcp-westwood.h:210
ns3::TcpWestwood::m_ssThresh
uint32_t m_ssThresh
Definition:
tcp-westwood.h:200
ns3::TcpWestwood::NewAck
virtual void NewAck(SequenceNumber32 const &seq)
Definition:
tcp-westwood.cc:143
ns3::TcpWestwood::NONE
Definition:
tcp-westwood.h:79
ns3::TcpWestwood::TUSTIN
Definition:
tcp-westwood.h:80
ns3::TcpWestwood::WESTWOODPLUS
Definition:
tcp-westwood.h:74
ns3::TracedValue< uint32_t >
ns3::TcpWestwood::Window
virtual uint32_t Window(void)
Definition:
tcp-westwood.cc:129
ns3::TcpWestwood::Retransmit
virtual void Retransmit(void)
Definition:
tcp-westwood.cc:293
ns3::TcpWestwood::Listen
virtual int Listen(void)
Definition:
tcp-westwood.cc:113
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::TcpWestwood::m_cWnd
TracedValue< uint32_t > m_cWnd
Definition:
tcp-westwood.h:199
ns3::TcpWestwood::m_fType
enum FilterType m_fType
Definition:
tcp-westwood.h:212
ns3::TcpWestwood::Filtering
void Filtering(void)
Definition:
tcp-westwood.cc:357
ns3::TcpWestwood::GetInitialCwnd
virtual uint32_t GetInitialCwnd(void) const
Definition:
tcp-westwood.cc:404
ns3::TcpWestwood::SetSSThresh
virtual void SetSSThresh(uint32_t threshold)
Definition:
tcp-westwood.cc:383
ns3::TcpWestwood::DupAck
virtual void DupAck(const TcpHeader &header, uint32_t count)
Definition:
tcp-westwood.cc:268
ns3::TcpSocketBase
A base class for implementation of a stream socket using TCP.
Definition:
tcp-socket-base.h:61
ns3::TcpWestwood::m_inFastRec
bool m_inFastRec
Definition:
tcp-westwood.h:202
ns3::TcpWestwood::UpdateAckedSegments
void UpdateAckedSegments(int acked)
Definition:
tcp-westwood.cc:262
ns3::TcpWestwood::ProtocolType
ProtocolType
Definition:
tcp-westwood.h:71
ns3::TcpWestwood::m_lastAck
double m_lastAck
Definition:
tcp-westwood.h:208
ns3::SequenceNumber< uint32_t, int32_t >
ns3::TcpHeader
Header for the Transmission Control Protocol.
Definition:
tcp-header.h:43
ns3::TcpWestwood::m_prevAckNo
SequenceNumber32 m_prevAckNo
Definition:
tcp-westwood.h:209
ns3::TcpWestwood::GetTypeId
static TypeId GetTypeId(void)
Definition:
tcp-westwood.cc:52
ns3::TcpWestwood::SetSegSize
virtual void SetSegSize(uint32_t size)
Definition:
tcp-westwood.cc:376
ns3::TcpWestwood::FilterType
FilterType
Definition:
tcp-westwood.h:77
ns3::TcpWestwood::TcpWestwood
TcpWestwood(void)
Definition:
tcp-westwood.cc:71
ns3::TcpWestwood::~TcpWestwood
virtual ~TcpWestwood(void)
Definition:
tcp-westwood.cc:108
tcp-socket-base.h
ns3::TcpWestwood::m_ackedSegments
int m_ackedSegments
Definition:
tcp-westwood.h:214
ns3::TcpWestwood::ReceivedAck
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Definition:
tcp-westwood.cc:177
ns3::TcpWestwood::SetInitialCwnd
virtual void SetInitialCwnd(uint32_t cwnd)
Definition:
tcp-westwood.cc:397
ns3::TcpWestwood::Fork
virtual Ptr< TcpSocketBase > Fork(void)
Definition:
tcp-westwood.cc:136
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::TcpWestwood::m_lastSampleBW
double m_lastSampleBW
Definition:
tcp-westwood.h:205
ns3::TcpWestwood::m_currentBW
TracedValue< double > m_currentBW
Definition:
tcp-westwood.h:204
ns3::TcpWestwood::m_IsCount
bool m_IsCount
Definition:
tcp-westwood.h:215
ns3::TcpWestwood::EstimateBW
void EstimateBW(int acked, const TcpHeader &tcpHeader, Time rtt)
Definition:
tcp-westwood.cc:202
ns3::TcpWestwood::GetSSThresh
virtual uint32_t GetSSThresh(void) const
Definition:
tcp-westwood.cc:390
ns3::TcpWestwood::m_initialCWnd
uint32_t m_initialCWnd
Definition:
tcp-westwood.h:201
ns3::TcpWestwood::m_minRtt
Time m_minRtt
Definition:
tcp-westwood.h:207
first.address
tuple address
Definition:
first.py:37
ns3::TcpWestwood::Connect
virtual int Connect(const Address &address)
Definition:
tcp-westwood.cc:121
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TcpWestwood::EstimateRtt
virtual void EstimateRtt(const TcpHeader &header)
Definition:
tcp-westwood.cc:323
ns3::TcpWestwood::WESTWOOD
Definition:
tcp-westwood.h:73
ns3::TcpWestwood
An implementation of a stream socket using TCP.
Definition:
tcp-westwood.h:62
ns3::TcpWestwood::m_pType
enum ProtocolType m_pType
Definition:
tcp-westwood.h:211
src
internet
model
tcp-westwood.h
Generated on Sat Nov 16 2013 16:17:42 for ns-3 by
1.8.5