21 #include "ns3/simulator.h"
35 .AddConstructor<TcpBic>()
36 .SetGroupName(
"Internet")
37 .AddAttribute(
"FastConvergence",
38 "Turn on/off fast convergence.",
43 "Beta for multiplicative decrease",
46 MakeDoubleChecker<double>(0.0))
47 .AddAttribute(
"MaxIncr",
48 "Limit on increment allowed during binary search",
51 MakeUintegerChecker<uint32_t>(1))
52 .AddAttribute(
"LowWnd",
53 "Threshold window size (in segments) for engaging BIC response",
56 MakeUintegerChecker<uint32_t>())
57 .AddAttribute(
"SmoothPart",
58 "Number of RTT needed to approach cWnd_max from "
59 "cWnd_max-BinarySearchCoefficient. It can be viewed as the gradient "
60 "of the slow start AIM phase: less this value is, "
61 "more steep the increment will be.",
64 MakeUintegerChecker<uint32_t>(1))
65 .AddAttribute(
"BinarySearchCoefficient",
66 "Inverse of the coefficient for the "
67 "binary search. Default 4, as in Linux",
70 MakeUintegerChecker<uint8_t>(2));
86 m_fastConvergence(sock.m_fastConvergence),
88 m_maxIncr(sock.m_maxIncr),
89 m_lowWnd(sock.m_lowWnd),
90 m_smoothPart(sock.m_smoothPart),
91 m_cWndCnt(sock.m_cWndCnt),
92 m_lastMaxCwnd(sock.m_lastMaxCwnd),
93 m_lastCwnd(sock.m_lastCwnd),
94 m_epochStart(sock.m_epochStart),
117 uint32_t cnt =
Update(tcb);
132 NS_LOG_INFO(
"Not enough segments have been ACKed to increment cwnd."
156 NS_LOG_INFO(
"Under lowWnd, compatibility mode. Behaving as NewReno");
166 <<
" and dist=" << dist);
186 cnt =
static_cast<uint32_t
>(segCwnd / dist);
188 NS_LOG_INFO(
"Binary search increase, cnt=" << cnt);
247 uint32_t segCwnd = tcb->GetCwndInSegments();
248 uint32_t ssThresh = 0;
256 <<
static_cast<uint32_t
>(
m_beta * segCwnd));
267 ssThresh =
std::max(2 * tcb->m_segmentSize, bytesInFlight / 2);
268 NS_LOG_INFO(
"Less than lowWindow, ssTh= " << ssThresh);
272 ssThresh =
static_cast<uint32_t
>(
std::max(segCwnd *
m_beta, 2.0) * tcb->m_segmentSize);
273 NS_LOG_INFO(
"More than lowWindow, ssTh= " << ssThresh);
282 return CopyObject<TcpBic>(
this);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static Time Now()
Return the current simulation virtual time.
BIC congestion control algorithm.
bool m_fastConvergence
Enable or disable fast convergence algorithm.
uint32_t m_lastMaxCwnd
Last maximum cWnd.
uint32_t m_lowWnd
Lower bound on congestion window.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
uint8_t m_b
Binary search coefficient.
uint32_t m_lastCwnd
Last cWnd.
uint32_t m_maxIncr
Maximum window increment.
double m_beta
Beta for cubic multiplicative increase.
virtual uint32_t Update(Ptr< TcpSocketState > tcb)
Bic window update after a new ack received.
uint32_t m_smoothPart
Number of RTT needed to reach Wmax from Wmax-B.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance algorithm implementation.
Time m_epochStart
Beginning of an epoch.
uint32_t m_cWndCnt
cWnd integer-to-float counter
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
std::string GetName() const override
Get the name of the congestion control algorithm.
Congestion control abstract class.
uint32_t m_segmentSize
Segment size.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Simulation virtual time values and global simulation resolution.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)