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 */
src
internet
model
tcp-westwood.h
Generated on Tue May 14 2013 11:08:23 for ns-3 by
1.8.1.2