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 lastSackedBytes) = 0;
103 
118  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
119  uint32_t lastSackedBytes) = 0;
120 
129  virtual void ExitRecovery (Ptr<TcpSocketState> tcb) = 0;
130 
139  virtual void UpdateBytesSent (uint32_t bytesSent)
140  {
141  NS_UNUSED (bytesSent);
142  }
143 
149  virtual Ptr<TcpRecoveryOps> Fork () = 0;
150 };
151 
167 {
168 public:
173  static TypeId GetTypeId (void);
174 
179 
184  TcpClassicRecovery (const TcpClassicRecovery& recovery);
185 
189  virtual ~TcpClassicRecovery () override;
190 
191  virtual std::string GetName () const override;
192 
193  virtual void EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount,
194  uint32_t unAckDataCount, uint32_t lastSackedBytes) override;
195 
196  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
197  uint32_t lastSackedBytes) override;
198 
199  virtual void ExitRecovery (Ptr<TcpSocketState> tcb) override;
200 
201  virtual Ptr<TcpRecoveryOps> Fork () override;
202 };
203 
204 } // namespace ns3
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes)=0
Performs variable initialization at the start of recovery.
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
recovery abstract class
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t lastAckedBytes, uint32_t lastSackedBytes) override
Performs recovery based on the recovery algorithm.
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 ~TcpClassicRecovery() override
Constructor.
virtual Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t lastAckedBytes, uint32_t lastSackedBytes)=0
Performs recovery based on the recovery algorithm.
TcpRecoveryOps()
Constructor.
virtual void ExitRecovery(Ptr< TcpSocketState > tcb)=0
Performs cwnd adjustments at the end of recovery.
virtual void UpdateBytesSent(uint32_t bytesSent)
Keeps track of bytes sent during recovery phase.
virtual std::string GetName() const =0
Get the name of the recovery algorithm.
The Classic recovery implementation.
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes) override
Performs variable initialization at the start of recovery.
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.