A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-vegas.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 ResiliNets, ITTC, University of Kansas
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 * Author: Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
18 *
19 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
20 * ResiliNets Research Group https://resilinets.org/
21 * Information and Telecommunication Technology Center (ITTC)
22 * and Department of Electrical Engineering and Computer Science
23 * The University of Kansas Lawrence, KS USA.
24 */
25
26#ifndef TCPVEGAS_H
27#define TCPVEGAS_H
28
29#include "tcp-congestion-ops.h"
30
31namespace ns3
32{
33
34class TcpSocketState;
35
65class TcpVegas : public TcpNewReno
66{
67 public:
72 static TypeId GetTypeId();
73
77 TcpVegas();
78
83 TcpVegas(const TcpVegas& sock);
84 ~TcpVegas() override;
85
86 std::string GetName() const override;
87
103 void PktsAcked(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked, const Time& rtt) override;
104
114 const TcpSocketState::TcpCongState_t newState) override;
115
122 void IncreaseWindow(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
123
132 uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
133
134 Ptr<TcpCongestionOps> Fork() override;
135
136 protected:
137 private:
150
154 void DisableVegas();
155
156 private:
165};
166
167} // namespace ns3
168
169#endif // TCPVEGAS_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
The NewReno implementation.
TcpCongState_t
Definition of the Congestion state machine.
An implementation of TCP Vegas.
Definition: tcp-vegas.h:66
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold following Vegas principle.
Definition: tcp-vegas.cc:290
void DisableVegas()
Stop taking Vegas samples.
Definition: tcp-vegas.cc:135
~TcpVegas() override
Definition: tcp-vegas.cc:91
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-vegas.h:162
std::string GetName() const override
Get the name of the congestion control algorithm.
Definition: tcp-vegas.cc:284
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-vegas.cc:97
uint32_t m_alpha
Alpha threshold, lower bound of packets in network.
Definition: tcp-vegas.h:157
uint32_t m_beta
Beta threshold, upper bound of packets in network.
Definition: tcp-vegas.h:158
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Adjust cwnd following Vegas linear increase/decrease algorithm.
Definition: tcp-vegas.cc:157
bool m_doingVegasNow
If true, do Vegas for this RTT.
Definition: tcp-vegas.h:163
void EnableVegas(Ptr< TcpSocketState > tcb)
Enable Vegas algorithm to start taking Vegas samples.
Definition: tcp-vegas.cc:124
Time m_minRtt
Minimum of all RTT measurements within last RTT.
Definition: tcp-vegas.h:161
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Compute RTTs needed to execute Vegas algorithm.
Definition: tcp-vegas.cc:103
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Enable/disable Vegas algorithm depending on the congestion state.
Definition: tcp-vegas.cc:143
TcpVegas()
Create an unbound tcp socket.
Definition: tcp-vegas.cc:63
Time m_baseRtt
Minimum of all Vegas RTT measurements seen during connection.
Definition: tcp-vegas.h:160
uint32_t m_gamma
Gamma threshold, limit on increase.
Definition: tcp-vegas.h:159
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-vegas.cc:39
SequenceNumber32 m_begSndNxt
Right edge during last RTT.
Definition: tcp-vegas.h:164
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.