A Discrete-Event Network Simulator
API
tcp-recovery-ops.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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: Viyom Mittal <viyommittal@gmail.com>
18  * Vivek Jain <jain.vivek.anand@gmail.com>
19  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
20  *
21  */
22 #ifndef TCP_RECOVERY_OPS_H
23 #define TCP_RECOVERY_OPS_H
24 
25 #include "ns3/object.h"
26 
27 namespace ns3
28 {
29 
30 class TcpSocketState;
31 
60 class TcpRecoveryOps : public Object
61 {
62  public:
67  static TypeId GetTypeId();
68 
73 
78  TcpRecoveryOps(const TcpRecoveryOps& other);
79 
83  ~TcpRecoveryOps() override;
84 
90  virtual std::string GetName() const = 0;
91 
103  uint32_t dupAckCount,
104  uint32_t unAckDataCount,
105  uint32_t deliveredBytes) = 0;
106 
117  virtual void DoRecovery(Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) = 0;
118 
126  virtual void ExitRecovery(Ptr<TcpSocketState> tcb) = 0;
127 
136  virtual void UpdateBytesSent(uint32_t bytesSent);
137 
143  virtual Ptr<TcpRecoveryOps> Fork() = 0;
144 };
145 
161 {
162  public:
167  static TypeId GetTypeId();
168 
173 
178  TcpClassicRecovery(const TcpClassicRecovery& recovery);
179 
183  ~TcpClassicRecovery() override;
184 
185  std::string GetName() const override;
186 
188  uint32_t dupAckCount,
189  uint32_t unAckDataCount,
190  uint32_t deliveredBytes) override;
191 
192  void DoRecovery(Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) override;
193 
194  void ExitRecovery(Ptr<TcpSocketState> tcb) override;
195 
196  Ptr<TcpRecoveryOps> Fork() override;
197 };
198 
199 } // namespace ns3
200 
201 #endif /* TCP_RECOVERY_OPS_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
The Classic recovery implementation.
Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes) override
Performs variable initialization at the start of recovery.
void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes) override
Performs recovery based on the recovery algorithm.
void ExitRecovery(Ptr< TcpSocketState > tcb) override
Performs cwnd adjustments at the end of recovery.
std::string GetName() const override
Get the name of the recovery algorithm.
static TypeId GetTypeId()
Get the type ID.
TcpClassicRecovery()
Constructor.
~TcpClassicRecovery() override
Constructor.
recovery abstract class
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes)=0
Performs variable initialization at the start of recovery.
static TypeId GetTypeId()
Get the type ID.
virtual void UpdateBytesSent(uint32_t bytesSent)
Keeps track of bytes sent during recovery phase.
virtual Ptr< TcpRecoveryOps > Fork()=0
Copy the recovery algorithm across socket.
virtual std::string GetName() const =0
Get the name of the recovery algorithm.
TcpRecoveryOps()
Constructor.
~TcpRecoveryOps() override
Deconstructor.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes)=0
Performs recovery based on the recovery algorithm.
virtual void ExitRecovery(Ptr< TcpSocketState > tcb)=0
Performs cwnd adjustments at the end of recovery.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.