21 #include "ns3/simulator.h"
33 .SetGroupName (
"Internet")
45 .SetGroupName (
"Internet")
46 .AddTraceSource (
"TcpRateUpdated",
47 "Tcp rate information has been updated",
49 "ns3::TcpRateLinux::TcpRateUpdated")
50 .AddTraceSource (
"TcpRateSampleUpdated",
51 "Tcp rate sample has been updated",
53 "ns3::TcpRateLinux::TcpRateSampleUpdated")
60 uint32_t priorInFlight,
const Time &minRtt)
71 NS_LOG_INFO (
"Updating RateSample m_ackedSacked=" << delivered <<
72 ", m_bytesLoss=" << lost <<
" and m_priorInFlight" << priorInFlight);
84 NS_LOG_INFO (
"PriorTime is zero, invalidating sample");
141 const uint32_t retransOut)
148 if (tailSeq - nextTx <
static_cast<int32_t
> (
segmentSize)
150 && lostOut <= retransOut)
221 if (isStartOfTransmission)
238 os <<
"m_delivered = " << rate.
m_delivered << std::endl;
241 os <<
"m_appLimited = " << rate.
m_appLimited << std::endl;
254 os <<
" m_interval = " << sample.
m_interval << std::endl;
255 os <<
" m_delivered = " << sample.
m_delivered << std::endl;
257 os <<
" m_priorTime = " << sample.
m_priorTime << std::endl;
258 os <<
" m_sendElapsed = " << sample.
m_sendElapsed << std::endl;
259 os <<
" m_ackElapsed = " << sample.
m_ackElapsed << std::endl;
260 os <<
" m_bytesLoss = " << sample.
m_bytesLoss << std::endl;
262 os <<
" m_ackedSacked = " << sample.
m_ackedSacked << std::endl;
A base class which provides memory management and object aggregation.
static Time Now(void)
Return the current simulation virtual time.
Linux management and generation of Rate information for TCP.
TracedCallback< const TcpRateConnection & > m_rateTrace
Rate trace.
TracedCallback< const TcpRateSample & > m_rateSampleTrace
Rate Sample trace.
virtual void SkbDelivered(TcpTxItem *skb) override
Update the Rate information after an item is received.
TcpRateSample m_rateSample
Rate sample (continuosly updated)
TcpRateConnection m_rate
Rate information.
virtual void SkbSent(TcpTxItem *skb, bool isStartOfTransmission) override
Put the rate information inside the sent skb.
virtual const TcpRateSample & GenerateSample(uint32_t delivered, uint32_t lost, bool is_sack_reneg, uint32_t priorInFlight, const Time &minRtt) override
Generate a TcpRateSample to feed a congestion avoidance algorithm.
static TypeId GetTypeId(void)
Get the type ID.
virtual void CalculateAppLimited(uint32_t cWnd, uint32_t in_flight, uint32_t segmentSize, const SequenceNumber32 &tailSeq, const SequenceNumber32 &nextTx, const uint32_t lostOut, const uint32_t retransOut) override
If a gap is detected between sends, it means we are app-limited.
Interface for all operations that involve a Rate monitoring for TCP.
static TypeId GetTypeId(void)
Get the type ID.
Item that encloses the application packet and some flags for it.
RateInformation & GetRateInformation(void)
Get (to modify) the Rate Information of this item.
uint32_t GetSeqSize(void) const
Get the size in the sequence number space.
const Time & GetLastSent(void) const
Get a reference to the time the packet was sent for the last time.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) 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).
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator==(const EventId &a, const EventId &b)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Information about the connection rate.
uint32_t m_txItemDelivered
The value of delivered when the acked item was sent.
Time m_deliveredTime
Simulator time when m_delivered was last updated.
int32_t m_rateDelivered
The amount of data delivered considered to calculate delivery rate.
uint64_t m_delivered
The total amount of data in bytes delivered so far.
uint32_t m_appLimited
The index of the last transmitted packet marked as application-limited.
bool m_rateAppLimited
Was sample was taken when data is app limited?
Time m_firstSentTime
The send time of the packet that was most recently marked as delivered.
Time m_rateInterval
The value of interval considered to calculate delivery rate.
Time m_ackElapsed
ACK time interval calculated from the most recent packet delivered.
bool m_isAppLimited
Indicates whether the rate sample is application-limited.
uint32_t m_ackedSacked
The amount of data acked and sacked in the last received ack.
DataRate m_deliveryRate
The delivery rate sample.
uint32_t m_priorInFlight
The value if bytes in flight prior to last received ack.
Time m_sendElapsed
Send time interval calculated from the most recent packet delivered.
Time m_interval
The length of the sampling interval.
uint32_t m_priorDelivered
The delivered count of the most recent packet delivered.
int32_t m_delivered
The amount of data marked as delivered over the sampling interval.
uint32_t m_bytesLoss
The amount of data marked as lost from the most recent ack received.
Time m_priorTime
The delivered time of the most recent packet delivered.