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 #pragma once
24 
25 #include "ns3/object.h"
26 
27 namespace ns3 {
28 
29 class TcpSocketState;
30 
59 class TcpRecoveryOps : public Object
60 {
61 public:
66  static TypeId GetTypeId (void);
67 
71  TcpRecoveryOps ();
72 
77  TcpRecoveryOps (const TcpRecoveryOps &other);
78 
82  virtual ~TcpRecoveryOps ();
83 
89  virtual std::string GetName () const = 0;
90 
101  virtual void EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount,
102  uint32_t unAckDataCount, uint32_t deliveredBytes) = 0;
103 
114  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) = 0;
115 
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
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes)=0
Performs variable initialization at the start of recovery.
recovery abstract class
static TypeId GetTypeId(void)
Get the type ID.
virtual void UpdateBytesSent(uint32_t bytesSent)
Keeps track of bytes sent during recovery phase.
static TypeId GetTypeId(void)
Get the type ID.
TcpClassicRecovery()
Constructor.
virtual void ExitRecovery(Ptr< TcpSocketState > tcb) override
Performs cwnd adjustments at the end of recovery.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes)=0
Performs recovery based on the recovery algorithm.
virtual ~TcpClassicRecovery() override
Constructor.
virtual Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes) override
Performs recovery based on the recovery algorithm.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes) override
Performs variable initialization at the start of recovery.
TcpRecoveryOps()
Constructor.
virtual void ExitRecovery(Ptr< TcpSocketState > tcb)=0
Performs cwnd adjustments at the end of recovery.
virtual std::string GetName() const =0
Get the name of the recovery algorithm.
The Classic recovery implementation.
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:58
virtual ~TcpRecoveryOps()
Deconstructor.
virtual std::string GetName() const override
Get the name of the recovery algorithm.
virtual Ptr< TcpRecoveryOps > Fork()=0
Copy the recovery algorithm across socket.