A Discrete-Event Network Simulator
API
tcp-bic.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Natale Patriciello <natale.patriciello@gmail.com>
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  */
19 
20 #ifndef TCPBIC_H
21 #define TCPBIC_H
22 
23 #include "ns3/tcp-congestion-ops.h"
24 #include "ns3/traced-value.h"
25 
26 namespace ns3 {
27 
78 class TcpBic : public TcpCongestionOps
79 {
80 public:
85  static TypeId GetTypeId (void);
86 
90  TcpBic ();
91 
96  TcpBic (const TcpBic &sock);
97 
98  virtual std::string GetName () const;
99  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb,
100  uint32_t segmentsAcked);
101  virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
102  uint32_t bytesInFlight);
103 
104  virtual Ptr<TcpCongestionOps> Fork ();
105 
106 protected:
110  virtual uint32_t Update (Ptr<TcpSocketState> tcb);
111 
112 private:
113  friend class TcpBicIncrementTest;
114  friend class TcpBicDecrementTest;
115 
116  // User parameters
118  double m_beta;
119  uint32_t m_maxIncr;
120  uint32_t m_lowWnd;
122 
123  // Bic parameters
124  uint32_t m_cWndCnt;
125  uint32_t m_lastMaxCwnd;
126  uint32_t m_lastCwnd;
128  uint8_t m_b;
129 };
130 
131 } // namespace ns3
132 #endif // TCPBIC_H
BIC congestion control algorithm.
Definition: tcp-bic.h:78
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Time m_epochStart
Beginning of an epoch.
Definition: tcp-bic.h:127
bool m_fastConvergence
Enable or disable fast convergence algorithm.
Definition: tcp-bic.h:117
Testing the congestion avoidance increment on TcpBic.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
int m_smoothPart
Number of RTT needed to reach Wmax from Wmax-B.
Definition: tcp-bic.h:121
uint32_t m_lastMaxCwnd
Last maximum cWnd.
Definition: tcp-bic.h:125
uint32_t m_lowWnd
Lower bound on congestion window.
Definition: tcp-bic.h:120
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-bic.cc:29
Testing the congestion avoidance increment on TcpBic.
Definition: tcp-bic-test.cc:33
uint32_t m_maxIncr
Maximum window increment.
Definition: tcp-bic.h:119
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
Definition: tcp-bic.cc:239
virtual uint32_t Update(Ptr< TcpSocketState > tcb)
Bic window update after a new ack received.
Definition: tcp-bic.cc:134
uint32_t m_cWndCnt
cWnd integer-to-float counter
Definition: tcp-bic.h:124
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Definition: tcp-bic.cc:277
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-bic.cc:233
TcpBic()
Constructor.
Definition: tcp-bic.cc:68
uint32_t m_lastCwnd
Last cWnd.
Definition: tcp-bic.h:126
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double m_beta
Beta for cubic multiplicative increase.
Definition: tcp-bic.h:118
Congestion control abstract class.
uint8_t m_b
Binary search coefficient.
Definition: tcp-bic.h:128
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance algorithm implementation.
Definition: tcp-bic.cc:96
a unique identifier for an interface.
Definition: type-id.h:58