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