A Discrete-Event Network Simulator
API
tcp-linux-reno.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 NITK Surathkal
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: Apoorva Bharagava <apoorvabhargava13@gmail.com>
18  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
19  *
20  */
21 
22 #ifndef TCPLINUXRENO_H
23 #define TCPLINUXRENO_H
24 
25 #include "tcp-congestion-ops.h"
26 #include "tcp-socket-state.h"
27 
28 namespace ns3
29 {
30 
40 {
41  public:
46  static TypeId GetTypeId();
47 
48  TcpLinuxReno();
49 
54  TcpLinuxReno(const TcpLinuxReno& sock);
55 
56  ~TcpLinuxReno() override;
57 
58  std::string GetName() const override;
59 
60  void IncreaseWindow(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
61  uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
62  Ptr<TcpCongestionOps> Fork() override;
63 
64  protected:
71  virtual uint32_t SlowStart(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
77  virtual void CongestionAvoidance(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
78 
79  private:
80  uint32_t m_cWndCnt{0};
81 };
82 
83 } // namespace ns3
84 
85 #endif // TCPLINUXRENO_H
Congestion control abstract class.
Reno congestion control algorithm.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
std::string GetName() const override
Get the name of the congestion control algorithm.
static TypeId GetTypeId()
Get the type ID.
~TcpLinuxReno() override
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Slow start phase handler.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance phase handler.
uint32_t m_cWndCnt
Linear increase counter.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.