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);
BIC congestion control algorithm.
Simulation virtual time values and global simulation resolution.
Time m_epochStart
Beginning of an epoch.
bool m_fastConvergence
Enable or disable fast convergence algorithm.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
AttributeValue implementation for Boolean.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static Time Min()
Minimum representable Time.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_lastMaxCwnd
Last maximum cWnd.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_lowWnd
Lower bound on congestion window.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_maxIncr
Maximum window increment.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
virtual uint32_t Update(Ptr< TcpSocketState > tcb)
Bic window update after a new ack received.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
uint32_t m_cWndCnt
cWnd integer-to-float counter
Hold an unsigned integer type.
uint32_t m_smoothPart
Number of RTT needed to reach Wmax from Wmax-B.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
uint32_t m_lastCwnd
Last cWnd.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
double m_beta
Beta for cubic multiplicative increase.
Congestion control abstract class.
uint8_t m_b
Binary search coefficient.
static Time Now(void)
Return the current simulation virtual time.
TracedValue< uint32_t > m_cWnd
Congestion window.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance algorithm implementation.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.