A Discrete-Event Network Simulator
API
tcp-recovery-ops.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 NITK Surathkal
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: Viyom Mittal <viyommittal@gmail.com>
19  * Vivek Jain <jain.vivek.anand@gmail.com>
20  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
21  *
22  */
23 #ifndef TCP_RECOVERY_OPS_H
24 #define TCP_RECOVERY_OPS_H
25 
26 #include "ns3/object.h"
27 
28 namespace ns3 {
29 
30 class TcpSocketState;
31 
60 class TcpRecoveryOps : public Object
61 {
62 public:
67  static TypeId GetTypeId (void);
68 
72  TcpRecoveryOps ();
73 
78  TcpRecoveryOps (const TcpRecoveryOps &other);
79 
83  virtual ~TcpRecoveryOps ();
84 
90  virtual std::string GetName () const = 0;
91 
102  virtual void EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount,
103  uint32_t unAckDataCount, uint32_t deliveredBytes) = 0;
104 
115  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) = 0;
116 
124  virtual void ExitRecovery (Ptr<TcpSocketState> tcb) = 0;
125 
134  virtual void UpdateBytesSent (uint32_t bytesSent);
135 
141  virtual Ptr<TcpRecoveryOps> Fork () = 0;
142 };
143 
159 {
160 public:
165  static TypeId GetTypeId (void);
166 
171 
176  TcpClassicRecovery (const TcpClassicRecovery& recovery);
177 
181  virtual ~TcpClassicRecovery () override;
182 
183  virtual std::string GetName () const override;
184 
185  virtual void EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount,
186  uint32_t unAckDataCount, uint32_t deliveredBytes) override;
187 
188  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) override;
189 
190  virtual void ExitRecovery (Ptr<TcpSocketState> tcb) override;
191 
192  virtual Ptr<TcpRecoveryOps> Fork () override;
193 };
194 
195 } // namespace ns3
196 
197 #endif /* TCP_RECOVERY_OPS_H */
A base class which provides memory management and object aggregation.
Definition: object.h:88
The Classic recovery implementation.
virtual Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes) override
Performs variable initialization at the start of recovery.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes) override
Performs recovery based on the recovery algorithm.
static TypeId GetTypeId(void)
Get the type ID.
virtual void ExitRecovery(Ptr< TcpSocketState > tcb) override
Performs cwnd adjustments at the end of recovery.
virtual std::string GetName() const override
Get the name of the recovery algorithm.
TcpClassicRecovery()
Constructor.
virtual ~TcpClassicRecovery() override
Constructor.
recovery abstract class
virtual ~TcpRecoveryOps()
Deconstructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes)=0
Performs variable initialization at the start of recovery.
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.
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.