|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
26 #include "ns3/simulator.h"
38 .AddConstructor<TcpLedbat> ()
39 .SetGroupName (
"Internet")
40 .AddAttribute (
"TargetDelay",
41 "Targeted Queue Delay",
45 .AddAttribute (
"BaseHistoryLen",
46 "Number of Base delay samples",
49 MakeUintegerChecker<uint32_t> ())
50 .AddAttribute (
"NoiseFilterLen",
51 "Number of Current delay samples",
54 MakeUintegerChecker<uint32_t> ())
55 .AddAttribute (
"Gain",
59 MakeDoubleChecker<double> ())
60 .AddAttribute (
"SSParam",
61 "Possibility of Slow Start",
66 .AddAttribute (
"MinCwnd",
67 "Minimum cWnd for Ledbat",
70 MakeUintegerChecker<uint32_t> ())
138 return CopyObject<TcpLedbat> (
this);
150 if (b.
buffer.size () == 0)
205 if (current_delay > base_delay)
207 queue_delay =
static_cast<int64_t
> (current_delay - base_delay);
212 queue_delay =
static_cast<int64_t
> (base_delay - current_delay);
234 if (cb.
buffer.size () == 0)
237 cb.
buffer.push_back (owd);
241 cb.
buffer.push_back (owd);
244 cb.
min =
static_cast<uint32_t
> (cb.
buffer.size () - 1);
246 if (cb.
buffer.size () >= maxlen)
252 for (uint32_t i = 1; i < maxlen - 1; i++)
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
T Get(void) const
Get the underlying value.
@ LEDBAT_CAN_SS
If LEDBAT allows Slow Start.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
void InitCircBuf(struct OwdCircBuf &buffer)
Initialise a new buffer.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TracedValue< SequenceNumber32 > m_highTxMark
Highest seqno ever sent, regardless of ReTx.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
uint32_t m_flag
LEDBAT Flag.
void AddDelay(struct OwdCircBuf &cb, uint32_t owd, uint32_t maxlen)
Add new delay to the buffers.
uint32_t m_segmentSize
Segment size.
uint32_t m_minCwnd
Minimum cWnd value mentioned in RFC 6817.
void SetDoSs(SlowStartType doSS)
Change the Slow Start Capability.
uint32_t m_baseHistoLen
Length of base delay history buffer.
uint64_t m_lastRollover
Timestamp of last added delay.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
double m_gain
GAIN value from RFC.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
uint32_t m_rcvTimestampValue
Receiver Timestamp value.
Smart pointer class similar to boost::intrusive_ptr.
virtual std::string GetName() const
Get the name of the TCP flavour.
uint32_t min
The index of minimum value.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
Buffer structure to store delays.
TcpLedbat(void)
Create an unbound tcp socket.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
OwdCircBuf m_noiseFilter
Buffer to store the current delay.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following LEDBAT algorithm.
Simulation virtual time values and global simulation resolution.
SlowStartType
The slowstart types.
std::vector< uint32_t > buffer
Vector to store the delay.
static TypeId GetTypeId(void)
Get the type ID.
SlowStartType m_doSs
Permissible Slow Start State.
void UpdateBaseDelay(uint32_t owd)
Update the base delay buffer.
#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.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual ~TcpLedbat(void)
Destructor.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsPositive(void) const
Exactly equivalent to t >= 0.
An implementation of LEDBAT.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
@ DO_NOT_SLOWSTART
Do not Slow Start.
@ DO_SLOWSTART
Do NewReno Slow Start.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
The NewReno implementation.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Reduce Congestion.
static uint32_t MinCircBuf(struct OwdCircBuf &b)
Return the minimum delay of the buffer.
TracedValue< uint32_t > m_cWnd
Congestion window.
uint32_t BaseDelay()
Return the value of base delay.
@ LEDBAT_VALID_OWD
If valid timestamps are present.
Time m_target
Target Queue Delay.
Hold an unsigned integer type.
OwdCircBuf m_baseHistory
Buffer to store the base delay.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Get information from the acked packet.
uint32_t m_rcvTimestampEchoReply
Sender Timestamp echoed by the receiver.
int32_t m_sndCwndCnt
The congestion window addition parameter.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
uint32_t m_noiseFilterLen
Length of current delay buffer.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint32_t CurrentDelay(FilterFunction filter)
Return the value of current delay.