32 .AddConstructor<TcpVeno>()
33 .SetGroupName(
"Internet")
35 "Threshold for congestion detection",
58 m_baseRtt(sock.m_baseRtt),
59 m_minRtt(sock.m_minRtt),
60 m_cntRtt(sock.m_cntRtt),
64 m_ackCnt(sock.m_ackCnt),
142 uint32_t segCwnd = tcb->GetCwndInSegments();
153 targetCwnd =
static_cast<uint32_t>(segCwnd * tmp);
158 m_diff = segCwnd - targetCwnd;
164 NS_LOG_LOGIC(
"Veno is not turned on, we follow NewReno algorithm.");
172 NS_LOG_LOGIC(
"We do not have enough RTT samples to perform Veno "
173 "calculations, we behave like NewReno.");
178 NS_LOG_LOGIC(
"We have enough RTT samples to perform Veno calculations.");
180 if (tcb->m_cWnd < tcb->m_ssThresh)
182 NS_LOG_LOGIC(
"We are in slow start, behave like NewReno.");
187 NS_LOG_LOGIC(
"We are in congestion avoidance, execute Veno additive "
194 NS_LOG_LOGIC(
"Available bandwidth not fully utilized, increase "
195 "cwnd by 1 every RTT");
202 NS_LOG_LOGIC(
"Available bandwidth fully utilized, increase cwnd "
203 "by 1 every other RTT");
237 NS_LOG_LOGIC(
"Random loss is most likely to have occurred, "
238 "cwnd is reduced by 1/5");
239 static double tmp = 4.0 / 5.0;
240 return std::max(
static_cast<uint32_t>(bytesInFlight * tmp), 2 * tcb->m_segmentSize);
246 NS_LOG_LOGIC(
"Congestive loss is most likely to have occurred, "
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
Smart pointer class similar to boost::intrusive_ptr.
The NewReno implementation.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Try to increase the cWnd following the NewReno specification.
TcpCongState_t
Definition of the Congestion state machine.
@ CA_OPEN
Normal state, no dubious events.
An implementation of TCP Veno.
std::string GetName() const override
Get the name of the congestion control algorithm.
bool m_inc
If true, cwnd needs to be incremented.
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Perform RTT sampling needed to execute Veno algorithm.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold during Veno multiplicative-decrease phase.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
static TypeId GetTypeId()
Get the type ID.
void EnableVeno()
Enable Veno algorithm to start Veno sampling.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Adjust cwnd following Veno additive increase algorithm.
Time m_minRtt
Minimum of RTTs measured within last RTT.
bool m_doingVenoNow
If true, do Veno for this RTT.
uint32_t m_beta
Threshold for congestion detection.
void DisableVeno()
Turn off Veno.
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Enable/disable Veno depending on the congestion state.
TcpVeno()
Create an unbound tcp socket.
uint32_t m_diff
Difference between expected and actual throughput.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
Time m_baseRtt
Minimum of all RTT measurements seen during connection.
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
bool IsZero() const
Exactly equivalent to t == 0.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#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_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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 > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)