A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-prr-recovery.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_PRR_RECOVERY_H
23#define TCP_PRR_RECOVERY_H
24
25#include "tcp-recovery-ops.h"
26
27namespace ns3
28{
29
30/**
31 * \ingroup recoveryOps
32 *
33 * \brief An implementation of PRR
34 *
35 * PRR is an algorithm that determines TCP's sending rate in fast
36 * recovery. PRR avoids excessive window reductions and aims for
37 * the actual congestion window size at the end of recovery to be as
38 * close as possible to the window determined by the congestion control
39 * algorithm. PRR also improves accuracy of the amount of data sent
40 * during loss recovery.
41 */
43{
44 public:
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50
51 /**
52 * Create an unbound tcp socket.
53 */
55
56 /**
57 * \brief Copy constructor
58 * \param sock the object to copy
59 */
60 TcpPrrRecovery(const TcpPrrRecovery& sock);
61
62 ~TcpPrrRecovery() override;
63
64 /**
65 * \brief Reduction Bound variant (CRB or SSRB)
66 */
68 {
69 CRB, /**< Conservative Reduction Bound */
70 SSRB /**< Slow Start Reduction Bound */
71 };
72
73 std::string GetName() const override;
74
76 uint32_t dupAckCount,
77 uint32_t unAckDataCount,
78 uint32_t deliveredBytes) override;
79
80 void DoRecovery(Ptr<TcpSocketState> tcb, uint32_t deliveredBytes) override;
81
82 void ExitRecovery(Ptr<TcpSocketState> tcb) override;
83
84 void UpdateBytesSent(uint32_t bytesSent) override;
85
86 Ptr<TcpRecoveryOps> Fork() override;
87
88 private:
89 uint32_t m_prrDelivered{0}; //!< total bytes delivered during recovery phase
90 uint32_t m_prrOut{0}; //!< total bytes sent during recovery phase
91 uint32_t m_recoveryFlightSize{0}; //!< value of bytesInFlight at the start of recovery phase
92 ReductionBound_t m_reductionBoundMode{SSRB}; //!< mode of Reduction Bound to be used
93};
94} // namespace ns3
95
96#endif /* TCP_PRR_RECOVERY_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
The Classic recovery implementation.
An implementation of PRR.
ReductionBound_t m_reductionBoundMode
mode of Reduction Bound to be used
void EnterRecovery(Ptr< TcpSocketState > tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t deliveredBytes) override
Performs variable initialization at the start of recovery.
static TypeId GetTypeId()
Get the type ID.
void UpdateBytesSent(uint32_t bytesSent) override
Keeps track of bytes sent during recovery phase.
ReductionBound_t
Reduction Bound variant (CRB or SSRB)
@ CRB
Conservative Reduction Bound.
@ SSRB
Slow Start Reduction Bound.
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.
uint32_t m_prrOut
total bytes sent during recovery phase
TcpPrrRecovery()
Create an unbound tcp socket.
uint32_t m_prrDelivered
total bytes delivered during recovery phase
Ptr< TcpRecoveryOps > Fork() override
Copy the recovery algorithm across socket.
void DoRecovery(Ptr< TcpSocketState > tcb, uint32_t deliveredBytes) override
Performs recovery based on the recovery algorithm.
uint32_t m_recoveryFlightSize
value of bytesInFlight at the start of recovery phase
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.