A Discrete-Event Network Simulator
API
tcp-veno.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 TCPVENO_H
28 #define TCPVENO_H
29 
30 #include "tcp-congestion-ops.h"
31 
32 namespace ns3 {
33 
34 class TcpSocketState;
35 
71 class TcpVeno : public TcpNewReno
72 {
73 public:
78  static TypeId GetTypeId (void);
79 
83  TcpVeno (void);
84 
89  TcpVeno (const TcpVeno& sock);
90  virtual ~TcpVeno (void);
91 
92  virtual std::string GetName () const;
93 
109  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
110  const Time& rtt);
111 
120  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
121  const TcpSocketState::TcpCongState_t newState);
122 
129  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
130 
139  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
140  uint32_t bytesInFlight);
141 
142  virtual Ptr<TcpCongestionOps> Fork ();
143 
144 protected:
145 private:
156  void EnableVeno ();
157 
161  void DisableVeno ();
162 
163 private:
166  uint32_t m_cntRtt;
168  uint32_t m_diff;
169  bool m_inc;
170  uint32_t m_ackCnt;
171  uint32_t m_beta;
172 };
173 
174 } // namespace ns3
175 
176 #endif // TCPVENO_H
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
Definition: tcp-veno.cc:86
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold during Veno multiplicative-decrease phase.
Definition: tcp-veno.cc:242
TcpVeno(void)
Create an unbound tcp socket.
Definition: tcp-veno.cc:52
void DisableVeno()
Turn off Veno.
Definition: tcp-veno.cc:124
The NewReno implementation.
An implementation of TCP Veno.
Definition: tcp-veno.h:71
bool m_inc
If true, cwnd needs to be incremented.
Definition: tcp-veno.h:169
uint32_t m_beta
Threshold for congestion detection.
Definition: tcp-veno.h:171
bool m_doingVenoNow
If true, do Veno for this RTT.
Definition: tcp-veno.h:167
uint32_t m_diff
Difference between expected and actual throughput.
Definition: tcp-veno.h:168
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-veno.h:170
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-veno.cc:236
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable Veno depending on the congestion state.
Definition: tcp-veno.cc:132
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-veno.cc:38
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Perform RTT sampling needed to execute Veno algorithm.
Definition: tcp-veno.cc:92
Time m_baseRtt
Minimum of all RTT measurements seen during connection.
Definition: tcp-veno.h:164
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-veno.h:166
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Veno additive increase algorithm.
Definition: tcp-veno.cc:149
virtual ~TcpVeno(void)
Definition: tcp-veno.cc:80
a unique identifier for an interface.
Definition: type-id.h:58
Time m_minRtt
Minimum of RTTs measured within last RTT.
Definition: tcp-veno.h:165
void EnableVeno()
Enable Veno algorithm to start Veno sampling.
Definition: tcp-veno.cc:115