24 #include "ns3/simulator.h" 36 .AddConstructor<TcpLedbat> ()
37 .SetGroupName (
"Internet")
38 .AddAttribute (
"TargetDelay",
39 "Targeted Queue Delay",
43 .AddAttribute (
"BaseHistoryLen",
44 "Number of Base delay samples",
47 MakeUintegerChecker<uint32_t> ())
48 .AddAttribute (
"NoiseFilterLen",
49 "Number of Current delay samples",
52 MakeUintegerChecker<uint32_t> ())
53 .AddAttribute (
"Gain",
57 MakeDoubleChecker<double> ())
58 .AddAttribute (
"SSParam",
59 "Possibility of Slow Start",
64 .AddAttribute (
"MinCwnd",
65 "Minimum cWnd for Ledbat",
68 MakeUintegerChecker<uint32_t> ())
136 return CopyObject<TcpLedbat> (
this);
148 if (b.
buffer.size () == 0)
203 if (current_delay > base_delay)
205 queue_delay =
static_cast<int64_t
> (current_delay - base_delay);
210 queue_delay =
static_cast<int64_t
> (base_delay - current_delay);
232 if (cb.
buffer.size () == 0)
235 cb.
buffer.push_back (owd);
239 cb.
buffer.push_back (owd);
242 cb.
min =
static_cast<uint32_t
> (cb.
buffer.size () - 1);
244 if (cb.
buffer.size () >= maxlen)
250 for (uint32_t i = 1; i < maxlen - 1; i++)
uint32_t BaseDelay()
Return the value of base delay.
uint32_t m_rcvTimestampValue
Receiver Timestamp value.
uint32_t min
The index of minimum value.
Simulation virtual time values and global simulation resolution.
uint32_t m_noiseFilterLen
Length of current delay buffer.
std::vector< uint32_t > buffer
Vector to store the delay.
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.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Get information from the acked packet.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_rcvTimestampEchoReply
Sender Timestamp echoed by the receiver.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
uint64_t m_lastRollover
Timestamp of last added delay.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm
void AddDelay(struct OwdCircBuf &cb, uint32_t owd, uint32_t maxlen)
Add new delay to the buffers.
An implementation of LEDBAT.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following LEDBAT algorithm.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
The NewReno implementation.
static uint32_t MinCircBuf(struct OwdCircBuf &b)
Return the minimum delay of the buffer.
OwdCircBuf m_baseHistory
Buffer to store the base delay.
Buffer structure to store delays.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual ~TcpLedbat(void)
Destructor.
static TypeId GetTypeId(void)
Get the type ID.
void InitCircBuf(struct OwdCircBuf &buffer)
Initialise a new buffer.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Hold variables of type enum.
AttributeValue implementation for Time.
Hold an unsigned integer type.
SlowStartType m_doSs
Permissible Slow Start State.
uint32_t m_baseHistoLen
Length of base delay history buffer.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
SlowStartType
The slowstart types.
uint32_t CurrentDelay(FilterFunction filter)
Return the value of current delay.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
uint32_t m_minCwnd
Minimum cWnd value mentioned in RFC 6817.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double m_gain
GAIN value from RFC.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static Time Now(void)
Return the current simulation virtual time.
Time m_target
Target Queue Delay.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
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...
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
void UpdateBaseDelay(uint32_t owd)
Update the base delay buffer.
uint32_t m_flag
LEDBAT Flag.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsPositive(void) const
T Get(void) const
Get the underlying value.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Reduce Congestion.
void SetDoSs(SlowStartType doSS)
Change the Slow Start Capability.
TracedValue< SequenceNumber32 > m_highTxMark
Highest seqno ever sent, regardless of ReTx.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
OwdCircBuf m_noiseFilter
Buffer to store the current delay.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
virtual std::string GetName() const
Get the name of the TCP flavour.
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.
int32_t m_sndCwndCnt
The congestion window addition parameter.
TcpLedbat(void)
Create an unbound tcp socket.
If LEDBAT allows Slow Start.
If valid timestamps are present.