14#include "ns3/simulator.h"
27 .SetGroupName(
"Internet")
29 .AddAttribute(
"BetaLoss",
30 "Beta for multiplicative decrease",
34 .AddAttribute(
"BetaEcn",
35 "Beta for multiplicative decrease for ABE",
64 if (segmentsAcked >= 1)
68 std::min((sndCwnd + (segmentsAcked * tcb->m_segmentSize)), (
uint32_t)tcb->m_ssThresh);
69 NS_LOG_INFO(
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
71 return segmentsAcked - ((tcb->m_cWnd - sndCwnd) / tcb->m_segmentSize);
84 NS_LOG_DEBUG(
"No increase because current cwnd " << tcb->m_cWnd
85 <<
" is not limiting the flow");
89 uint32_t w = tcb->m_cWnd / tcb->m_segmentSize;
102 tcb->m_cWnd += tcb->m_segmentSize;
113 tcb->m_cWnd += delta * tcb->m_segmentSize;
114 NS_LOG_DEBUG(
"Subtracting delta * w from m_cWndCnt " << delta * w);
116 NS_LOG_DEBUG(
"At end of CongestionAvoidance(), m_cWnd: " << tcb->m_cWnd
126 if (tcb->m_cWnd < tcb->m_ssThresh)
128 NS_LOG_DEBUG(
"In slow start, m_cWnd " << tcb->m_cWnd <<
" m_ssThresh " << tcb->m_ssThresh);
129 segmentsAcked =
SlowStart(tcb, segmentsAcked);
133 NS_LOG_DEBUG(
"In cong. avoidance, m_cWnd " << tcb->m_cWnd <<
" m_ssThresh "
142 return "TcpLinuxReno";
152 return std::max<uint32_t>(2 * state->m_segmentSize,
156 return std::max<uint32_t>(2 * state->m_segmentSize, state->m_cWnd *
m_betaLoss);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
Smart pointer class similar to boost::intrusive_ptr.
Reno congestion control algorithm.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
bool m_suppressIncreaseIfCwndLimited
Suppress window increase if TCP is not cwnd limited.
std::string GetName() const override
Get the name of the congestion control algorithm.
static TypeId GetTypeId()
Get the type ID.
double m_betaEcn
Beta for Linux-Reno multiplicative decrease with ABE.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Slow start phase handler.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance phase handler.
uint32_t m_cWndCnt
Linear increase counter.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
double m_betaLoss
Beta for Linux-Reno multiplicative decrease.
void SetSuppressIncreaseIfCwndLimited(bool value)
TcpSocketBase follows the Linux way of setting a flag 'isCwndLimited' when BytesInFlight() >= cwnd.
@ ECN_ECE_RCVD
Last ACK received had ECE bit set in TCP header.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.