A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tcp-scalable.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 ResiliNets, ITTC, University of Kansas
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 * Authors: Truc Anh N. Nguyen <annguyen@ittc.ku.edu>
18 * Keerthi Ganta <keerthig@ittc.ku.edu>
19 * Md Moshfequr Rahman <moshfequr@ittc.ku.edu>
20 * Amir Modarresi <amodarresi@ittc.ku.edu>
21 *
22 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
23 * ResiliNets Research Group https://resilinets.org/
24 * Information and Telecommunication Technology Center (ITTC)
25 * and Department of Electrical Engineering and Computer Science
26 * The University of Kansas Lawrence, KS USA.
27 */
28
29#ifndef TCPSCALABLE_H
30#define TCPSCALABLE_H
31
32#include "tcp-congestion-ops.h"
33
34namespace ns3
35{
36
37class TcpSocketState;
38
39/**
40 * \ingroup congestionOps
41 *
42 * \brief An implementation of TCP Scalable
43 *
44 * Scalable improves TCP performance to better utilize the available bandwidth
45 * of a highspeed wide area network by altering NewReno congestion window
46 * adjustment algorithm.
47 *
48 * When congestion has not been detected, for each ACK received in an RTT,
49 * Scalable increases its cwnd per:
50 *
51 * cwnd = cwnd + 0.01 (1)
52 *
53 * Following Linux implementation of Scalable, we use 50 instead of 100 to
54 * account for delayed ACK.
55 *
56 * On the first detection of congestion in a given RTT, cwnd is reduced based
57 * on the following equation:
58 *
59 * cwnd = cwnd - ceil(0.125 * cwnd) (2)
60 *
61 * More information: http://doi.acm.org/10.1145/956981.956989
62 */
63
64class TcpScalable : public TcpNewReno
65{
66 public:
67 /**
68 * \brief Get the type ID.
69 * \return the object TypeId
70 */
71 static TypeId GetTypeId();
72
73 /**
74 * Create an unbound tcp socket.
75 */
77
78 /**
79 * \brief Copy constructor
80 * \param sock the object to copy
81 */
82 TcpScalable(const TcpScalable& sock);
83 ~TcpScalable() override;
84
85 std::string GetName() const override;
86
87 /**
88 * \brief Get slow start threshold following Scalable principle (Equation 2)
89 *
90 * \param tcb internal congestion state
91 * \param bytesInFlight bytes in flight
92 *
93 * \return the slow start threshold value
94 */
95 uint32_t GetSsThresh(Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight) override;
96
97 Ptr<TcpCongestionOps> Fork() override;
98
99 protected:
100 /**
101 * \brief Congestion avoidance of TcpScalable (Equation 1)
102 *
103 * \param tcb internal congestion state
104 * \param segmentsAcked count of segments acked
105 */
106 void CongestionAvoidance(Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) override;
107
108 private:
109 uint32_t m_ackCnt; //!< Number of received ACK
110 uint32_t m_aiFactor; //!< Additive increase factor
111 double m_mdFactor; //!< Multiplicative decrease factor
112};
113
114} // namespace ns3
115
116#endif // TCPSCALABLE_H
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
The NewReno implementation.
An implementation of TCP Scalable.
Definition: tcp-scalable.h:65
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Definition: tcp-scalable.cc:85
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold following Scalable principle (Equation 2)
~TcpScalable() override
Definition: tcp-scalable.cc:79
static TypeId GetTypeId()
Get the type ID.
Definition: tcp-scalable.cc:42
uint32_t m_ackCnt
Number of received ACK.
Definition: tcp-scalable.h:109
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance of TcpScalable (Equation 1)
Definition: tcp-scalable.cc:91
TcpScalable()
Create an unbound tcp socket.
Definition: tcp-scalable.cc:61
uint32_t m_aiFactor
Additive increase factor.
Definition: tcp-scalable.h:110
std::string GetName() const override
Get the name of the congestion control algorithm.
double m_mdFactor
Multiplicative decrease factor.
Definition: tcp-scalable.h:111
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.