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 "ns3/tcp-congestion-ops.h"
31 #include "ns3/tcp-recovery-ops.h"
32 
33 namespace ns3 {
34 
70 class TcpVeno : public TcpNewReno
71 {
72 public:
77  static TypeId GetTypeId (void);
78 
82  TcpVeno (void);
83 
88  TcpVeno (const TcpVeno& sock);
89  virtual ~TcpVeno (void);
90 
91  virtual std::string GetName () const;
92 
108  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
109  const Time& rtt);
110 
119  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
120  const TcpSocketState::TcpCongState_t newState);
121 
128  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
129 
138  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
139  uint32_t bytesInFlight);
140 
141  virtual Ptr<TcpCongestionOps> Fork ();
142 
143 protected:
144 private:
155  void EnableVeno ();
156 
160  void DisableVeno ();
161 
162 private:
165  uint32_t m_cntRtt;
167  uint32_t m_diff;
168  bool m_inc;
169  uint32_t m_ackCnt;
170  uint32_t m_beta;
171 };
172 
173 } // namespace ns3
174 
175 #endif // TCPVENO_H
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Definition: tcp-veno.cc:84
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold during Veno multiplicative-decrease phase.
Definition: tcp-veno.cc:240
TcpVeno(void)
Create an unbound tcp socket.
Definition: tcp-veno.cc:50
void DisableVeno()
Turn off Veno.
Definition: tcp-veno.cc:122
The NewReno implementation.
An implementation of TCP Veno.
Definition: tcp-veno.h:70
bool m_inc
If true, cwnd needs to be incremented.
Definition: tcp-veno.h:168
uint32_t m_beta
Threshold for congestion detection.
Definition: tcp-veno.h:170
bool m_doingVenoNow
If true, do Veno for this RTT.
Definition: tcp-veno.h:166
uint32_t m_diff
Difference between expected and actual throughput.
Definition: tcp-veno.h:167
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:169
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-veno.cc:234
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable Veno depending on the congestion state.
Definition: tcp-veno.cc:130
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-veno.cc:36
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Perform RTT sampling needed to execute Veno algorithm.
Definition: tcp-veno.cc:90
Time m_baseRtt
Minimum of all RTT measurements seen during connection.
Definition: tcp-veno.h:163
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
Definition: tcp-veno.h:165
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Veno additive increase algorithm.
Definition: tcp-veno.cc:147
virtual ~TcpVeno(void)
Definition: tcp-veno.cc:78
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:164
void EnableVeno()
Enable Veno algorithm to start Veno sampling.
Definition: tcp-veno.cc:113