21 #include "ns3/tcp-socket-base.h"
34 .AddConstructor<TcpHighSpeed> ()
35 .SetGroupName (
"Internet")
49 m_ackCnt (sock.m_ackCnt)
62 return CopyObject<TcpHighSpeed> (
this);
102 uint32_t segCwnd = tcb->GetCwndInSegments ();
103 uint32_t oldCwnd = segCwnd;
105 if (segmentsAcked > 0)
117 if (segCwnd != oldCwnd)
119 tcb->m_cWnd = segCwnd * tcb->m_segmentSize;
120 NS_LOG_INFO (
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
121 " ssthresh " << tcb->m_ssThresh);
128 return "TcpHighSpeed";
141 uint32_t bytesInFlight)
145 uint32_t segCwnd = bytesInFlight / tcb->m_segmentSize;
148 uint32_t ssThresh = std::max (2.0, segCwnd * b);
151 " resulting (in segment) ssThresh=" << ssThresh);
153 return ssThresh * tcb->m_segmentSize;
An implementation of TCP HighSpeed.
Smart pointer class similar to boost::intrusive_ptr.
#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.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold following HighSpeed principles.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
The NewReno implementation.
static double TableLookupB(uint32_t w)
Lookup table for the coefficent b (from RFC 3649)
static uint32_t TableLookupA(uint32_t w)
Lookup table for the coefficent a (from RFC 3649)
virtual ~TcpHighSpeed(void)
static TypeId GetTypeId(void)
Get the type ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
TcpHighSpeed(void)
Create an unbound tcp socket.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t m_ackCnt
Number of received ACK, corrected with the coefficent a.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance of TcpHighSpeed.