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;
250 operator<< (std::ostream & os, TcpRateLinux::TcpRateSample
const & sample)
252 os <<
"m_deliveryRate = " << sample.m_deliveryRate << std::endl;
253 os <<
" m_isAppLimited = " << sample.m_isAppLimited << std::endl;
254 os <<
" m_interval = " << sample.m_interval << std::endl;
255 os <<
" m_delivered = " << sample.m_delivered << std::endl;
256 os <<
" m_priorDelivered = " << sample.m_priorDelivered << 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;
261 os <<
" m_priorInFlight= " << sample.m_priorInFlight << std::endl;
262 os <<
" m_ackedSacked = " << sample.m_ackedSacked << std::endl;
267 operator== (TcpRateLinux::TcpRateSample
const & lhs, TcpRateLinux::TcpRateSample
const & rhs)
269 return (lhs.m_deliveryRate == rhs.m_deliveryRate
270 && lhs.m_isAppLimited == rhs.m_isAppLimited
271 && lhs.m_interval == rhs.m_interval
272 && lhs.m_delivered == rhs.m_delivered
273 && lhs.m_priorDelivered == rhs.m_priorDelivered
274 && lhs.m_priorTime == rhs.m_priorTime
275 && lhs.m_sendElapsed == rhs.m_sendElapsed
276 && lhs.m_ackElapsed == rhs.m_ackElapsed
Simulation virtual time values and global simulation resolution.
#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.
Time m_sendElapsed
Send time interval calculated from the most recent packet delivered.
Interface for all operations that involve a Rate monitoring for TCP.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_priorDelivered
The delivered count of the most recent packet delivered.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time m_ackElapsed
ACK time interval calculated from the most recent packet delivered.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Linux management and generation of Rate information for TCP.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t GetSeqSize(void) const
Get the size in the sequence number space.
uint32_t m_priorInFlight
The value if bytes in flight prior to last received ack.
TracedCallback< const TcpRateSample & > m_rateSampleTrace
Rate Sample trace.
uint32_t m_txItemDelivered
The value of delivered when the acked item was sent.
bool m_isAppLimited
Indicates whether the rate sample is application-limited.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
TcpRateConnection m_rate
Rate information.
Time m_priorTime
The delivered time of the most recent packet delivered.
TcpRateSample m_rateSample
Rate sample (continuosly updated)
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Item that encloses the application packet and some flags for it.
int32_t m_delivered
The amount of data marked as delivered over the sampling interval.
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.
RateInformation & GetRateInformation(void)
Get (to modify) the Rate Information of this item.
DataRate m_deliveryRate
The delivery rate sample.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time m_rateInterval
The value of interval considered to calculate delivery rate.
bool m_rateAppLimited
Was sample was taken when data is app limited?
uint32_t m_ackedSacked
The amount of data acked and sacked in the last received ack.
static Time Now(void)
Return the current simulation virtual time.
static TypeId GetTypeId(void)
Get the type ID.
Time m_interval
The length of the sampling interval.
uint32_t m_appLimited
The index of the last transmitted packet marked as application-limited.
Information about the connection rate.
TracedCallback< const TcpRateConnection & > m_rateTrace
Rate trace.
uint64_t m_delivered
The total amount of data in bytes delivered so far.
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.
virtual void SkbSent(TcpTxItem *skb, bool isStartOfTransmission) override
Put the rate information inside the sent skb.
Time Seconds(double value)
Construct a Time in the indicated unit.
bool operator==(const EventId &a, const EventId &b)
const Time & GetLastSent(void) const
Get a reference to the time the packet was sent for the last time.
Time m_firstSentTime
The send time of the packet that was most recently marked as delivered.
virtual void SkbDelivered(TcpTxItem *skb) override
Update the Rate information after an item is received.
A base class which provides memory management and object aggregation.
int32_t m_rateDelivered
The amount of data delivered considered to calculate delivery rate.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
uint32_t m_bytesLoss
The amount of data marked as lost from the most recent ack received.
Time m_deliveredTime
Simulator time when m_delivered was last updated.