|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
42 .AddConstructor<TcpVeno> ()
43 .SetGroupName (
"Internet")
44 .AddAttribute (
"Beta",
"Threshold for congestion detection",
47 MakeUintegerChecker<uint32_t> ())
57 m_doingVenoNow (true),
68 m_baseRtt (sock.m_baseRtt),
69 m_minRtt (sock.m_minRtt),
70 m_cntRtt (sock.m_cntRtt),
71 m_doingVenoNow (true),
74 m_ackCnt (sock.m_ackCnt),
88 return CopyObject<TcpVeno> (
this);
166 targetCwnd =
static_cast<uint32_t
> (segCwnd * tmp);
167 NS_LOG_DEBUG (
"Calculated targetCwnd = " << targetCwnd);
171 m_diff = segCwnd - targetCwnd;
177 NS_LOG_LOGIC (
"Veno is not turned on, we follow NewReno algorithm.");
185 NS_LOG_LOGIC (
"We do not have enough RTT samples to perform Veno "
186 "calculations, we behave like NewReno.");
191 NS_LOG_LOGIC (
"We have enough RTT samples to perform Veno calculations.");
195 NS_LOG_LOGIC (
"We are in slow start, behave like NewReno.");
200 NS_LOG_LOGIC (
"We are in congestion avoidance, execute Veno additive "
207 NS_LOG_LOGIC (
"Available bandwidth not fully utilized, increase "
208 "cwnd by 1 every RTT");
215 NS_LOG_LOGIC (
"Available bandwidth fully utilized, increase cwnd "
216 "by 1 every other RTT");
243 uint32_t bytesInFlight)
251 NS_LOG_LOGIC (
"Random loss is most likely to have occurred, "
252 "cwnd is reduced by 1/5");
253 static double tmp = 4.0/5.0;
254 return std::max (
static_cast<uint32_t
> (bytesInFlight * tmp),
255 2 * tcb->m_segmentSize);
261 NS_LOG_LOGIC (
"Congestive loss is most likely to have occurred, "
a unique identifier for an interface.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Time m_baseRtt
Minimum of all RTT measurements seen during connection.
uint32_t m_diff
Difference between expected and actual throughput.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_beta
Threshold for congestion detection.
static TypeId GetTypeId(void)
Get the type ID.
@ CA_OPEN
Normal state, no dubious events.
TcpCongState_t
Definition of the Congestion state machine.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold during Veno multiplicative-decrease phase.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Smart pointer class similar to boost::intrusive_ptr.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
bool IsZero(void) const
Exactly equivalent to t == 0.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
TcpVeno(void)
Create an unbound tcp socket.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Veno additive increase algorithm.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Simulation virtual time values and global simulation resolution.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
An implementation of TCP Veno.
The NewReno implementation.
Time m_minRtt
Minimum of RTTs measured within last RTT.
bool m_doingVenoNow
If true, do Veno for this RTT.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
bool m_inc
If true, cwnd needs to be incremented.
TracedValue< uint32_t > m_cWnd
Congestion window.
Hold an unsigned integer type.
void EnableVeno()
Enable Veno algorithm to start Veno sampling.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Perform RTT sampling needed to execute Veno algorithm.
void DisableVeno()
Turn off Veno.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable Veno depending on the congestion state.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Try to increase the cWnd following the NewReno specification.