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