A Discrete-Event Network Simulator
API
tcp-prr-recovery.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/tcp-recovery-ops.h"
26 
27 namespace ns3 {
28 
42 {
43 public:
48  static TypeId GetTypeId (void);
49 
53  TcpPrrRecovery (void);
54 
59  TcpPrrRecovery (const TcpPrrRecovery& sock);
60 
61  virtual ~TcpPrrRecovery (void) override;
62 
66  typedef enum
67  {
68  CRB,
71 
72  std::string GetName () const override;
73 
74  virtual void EnterRecovery (Ptr<TcpSocketState> tcb, uint32_t dupAckCount,
75  uint32_t unAckDataCount, uint32_t lastSackedBytes) override;
76 
77  virtual void DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
78  uint32_t lastSackedBytes) override;
79 
80  virtual void ExitRecovery (Ptr<TcpSocketState> tcb) override;
81 
82  virtual void UpdateBytesSent (uint32_t bytesSent) override;
83 
84  virtual Ptr<TcpRecoveryOps> Fork () override;
85 
86 private:
87  uint32_t m_prrDelivered {0};
88  uint32_t m_prrOut {0};
89  uint32_t m_recoveryFlightSize {0};
90  uint32_t m_previousSackedBytes {0};
92 };
93 } // namespace ns3
94 
virtual void ExitRecovery(Ptr< TcpSocketState > tcb) override
Performs cwnd adjustments at the end of recovery.
Slow Start Reduction Bound.
virtual void UpdateBytesSent(uint32_t bytesSent) override
Keeps track of bytes sent during recovery phase.
uint32_t m_previousSackedBytes
total bytes SACKed by the previous ACK
uint32_t m_recoveryFlightSize
value of bytesInFlight at the start of recovery phase
ReductionBound_t
Reduction Bound variant (CRB or SSRB)
virtual Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
TcpPrrRecovery(void)
Create an unbound tcp socket.
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.
An implementation of PRR.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_prrOut
total bytes sent during recovery phase
ReductionBound_t m_reductionBoundMode
mode of Reduction Bound to be used
virtual void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes) override
Performs variable initialization at the start of recovery.
uint32_t m_prrDelivered
total bytes delivered during recovery phase
The Classic recovery implementation.
std::string GetName() const override
Get the name of the recovery algorithm.
Conservative Reduction Bound.
a unique identifier for an interface.
Definition: type-id.h:58
virtual ~TcpPrrRecovery(void) override