21 #include "ns3/simulator.h"
33 .AddConstructor<TcpBic> ()
34 .SetGroupName (
"Internet")
35 .AddAttribute (
"FastConvergence",
"Turn on/off fast convergence.",
39 .AddAttribute (
"Beta",
"Beta for multiplicative decrease",
42 MakeDoubleChecker <double> (0.0))
43 .AddAttribute (
"MaxIncr",
"Limit on increment allowed during binary search",
46 MakeUintegerChecker <uint32_t> (1))
47 .AddAttribute (
"LowWnd",
"Threshold window size (in segments) for engaging BIC response",
50 MakeUintegerChecker <uint32_t> ())
51 .AddAttribute (
"SmoothPart",
"Number of RTT needed to approach cWnd_max from "
52 "cWnd_max-BinarySearchCoefficient. It can be viewed as the gradient "
53 "of the slow start AIM phase: less this value is, "
54 "more steep the increment will be.",
57 MakeUintegerChecker <uint32_t> (1))
58 .AddAttribute (
"BinarySearchCoefficient",
"Inverse of the coefficient for the "
59 "binary search. Default 4, as in Linux",
62 MakeUintegerChecker <uint8_t> (2))
80 m_fastConvergence (sock.m_fastConvergence),
82 m_maxIncr (sock.m_maxIncr),
83 m_lowWnd (sock.m_lowWnd),
84 m_smoothPart (sock.m_smoothPart),
85 m_cWndCnt (sock.m_cWndCnt),
86 m_lastMaxCwnd (sock.m_lastMaxCwnd),
87 m_lastCwnd (sock.m_lastCwnd),
88 m_epochStart (sock.m_epochStart),
112 uint32_t cnt =
Update (tcb);
127 NS_LOG_INFO (
"Not enough segments have been ACKed to increment cwnd."
150 NS_LOG_INFO (
"Under lowWnd, compatibility mode. Behaving as NewReno");
159 NS_LOG_INFO (
"cWnd = " << segCwnd <<
" under lastMax, " <<
181 cnt =
static_cast<uint32_t
> (segCwnd / dist);
183 NS_LOG_INFO (
"Binary search increase, cnt=" << cnt);
188 NS_LOG_INFO (
"cWnd = " << segCwnd <<
" above last max, " <<
243 uint32_t segCwnd = tcb->GetCwndInSegments ();
244 uint32_t ssThresh = 0;
252 " updated to " <<
static_cast<uint32_t
> (
m_beta * segCwnd));
264 ssThresh =
std::max (2 * tcb->m_segmentSize, bytesInFlight / 2);
265 NS_LOG_INFO (
"Less than lowWindow, ssTh= " << ssThresh);
269 ssThresh =
static_cast<uint32_t
> (
std::max (segCwnd *
m_beta, 2.0) * tcb->m_segmentSize);
270 NS_LOG_INFO (
"More than lowWindow, ssTh= " << ssThresh);
279 return CopyObject<TcpBic> (
this);
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static Time Now(void)
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.
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.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance algorithm implementation.
uint32_t m_smoothPart
Number of RTT needed to reach Wmax from Wmax-B.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
Time m_epochStart
Beginning of an epoch.
uint32_t m_cWndCnt
cWnd integer-to-float counter
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
static TypeId GetTypeId(void)
Get the type ID.
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.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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.