26 #include "ns3/tcp-congestion-ops.h" 27 #include "ns3/traced-value.h" 28 #include "ns3/data-rate.h" 29 #include "ns3/random-variable-stream.h" 30 #include "ns3/windowed-filter.h" 96 virtual std::string
GetName ()
const;
106 uint32_t bytesInFlight);
Time m_rtPropStamp
The wall clock time at which the current BBR.RTProp sample was obtained.
Simulation virtual time values and global simulation resolution.
uint32_t m_targetCWnd
Target value for congestion window, adapted to the estimated BDP.
MaxBandwidthFilter_t m_maxBwFilter
Maximum bandwidth filter.
void RestoreCwnd(Ptr< TcpSocketState > tcb)
Helper to restore the last-known good congestion window.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
void EnterProbeRTT()
Updates variables specific to BBR_PROBE_RTT state.
Time m_rtProp
Estimated two-way round-trip propagation delay of the path, estimated from the windowed minimum recen...
uint32_t m_cycleIndex
Current index of gain cycle.
bool m_packetConservation
Enable/Disable packet conservation mode.
uint32_t m_extraAckedWinRttLength
Window length of extra acked window.
bool m_isPipeFilled
A boolean that records whether BBR has filled the pipe.
TcpCAEvent_t
Congestion avoidance events.
Ramp up sending rate rapidly to fill pipe.
Tests whether BBR sets correct value of pacing and cwnd gain based on different state.
static const uint8_t GAIN_CYCLE_LENGTH
The number of phases in the BBR ProbeBW gain cycle.
virtual void CwndEvent(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Trigger events/calculations on occurrence of congestion window event.
bool m_hasSeenRtt
Have we seen RTT sample yet?
uint32_t m_priorCwnd
The last-known good congestion window.
static TypeId GetTypeId(void)
Get the type ID.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
double m_highGain
A constant specifying highest gain factor, default is 2.89.
void CheckFullPipe(const TcpRateOps::TcpRateSample &rs)
Identifies whether pipe or BDP is already full.
Time m_probeRttDuration
A constant specifying the minimum duration for which ProbeRTT state, default 200 millisecs.
void ModulateCwndForProbeRTT(Ptr< TcpSocketState > tcb)
Modulates congestion window in BBR_PROBE_RTT.
void UpdateBtlBw(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates maximum bottleneck.
uint32_t GetBbrState()
Gets BBR state.
uint32_t m_ackEpochAcked
Bytes ACked in sampling epoch.
uint32_t m_txItemDelivered
The number of bytes already delivered at the time of new packet transmission.
uint32_t InFlight(Ptr< TcpSocketState > tcb, double gain)
Estimates the target value for congestion window.
void InitFullPipe()
Intializes the full pipe estimator.
void SaveCwnd(Ptr< const TcpSocketState > tcb)
Helper to remember the last-known good congestion window or the latest congestion window unmodulated ...
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
void HandleProbeRTT(Ptr< TcpSocketState > tcb)
Handles the steps for BBR_PROBE_RTT state.
Class for representing data rates.
uint32_t m_extraAckedIdx
Current index in extra acked array.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
uint32_t AckAggregationCwnd()
Find Cwnd increment based on ack aggregation.
void EnterDrain()
Updates variables specific to BBR_DRAIN state.
void SetCwnd(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates congestion window based on the network model.
void UpdateModelAndState(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates BBR network model (Maximum bandwidth and minimum RTT).
uint32_t m_fullBandwidthCount
Count of full bandwidth recorded consistently.
Time m_ackEpochTime
Starting of ACK sampling epoch time.
friend class TcpBbrCheckGainValuesTest
TcpBbrCheckGainValuesTest friend class (for tests).
void CheckProbeRTT(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
This method handles the steps related to the ProbeRTT state.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
Time m_rtPropFilterLen
A constant specifying the length of the RTProp min filter window, default 10 secs.
static const char *const BbrModeName[BBR_PROBE_RTT+1]
Literal names of BBR mode for use in log messages.
uint32_t m_extraAckedGain
Gain factor for adding extra ack to cwnd.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Trigger events/calculations specific to a congestion state.
void SetBbrState(BbrMode_t state)
Sets BBR state.
void UpdateTargetCwnd(Ptr< TcpSocketState > tcb)
Updates target congestion window.
bool m_isInitialized
Set to true after first time initializtion variables.
uint32_t m_appLimited
The index of the last transmitted packet marked as application-limited.
void UpdateRound(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates round counting related variables.
uint32_t m_extraAckedWinRtt
Age of extra acked in rtt.
Construct a windowed filter.
bool m_idleRestart
When restarting from idle, set it true.
bool m_roundStart
A boolean that BBR sets to true once per packet-timed round trip.
Cut inflight to min to probe min_rtt.
bool IsNextCyclePhase(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Checks whether to move to next value of pacing gain while in BBR_PROBE_BW.
TcpCongState_t
Definition of the Congestion state machine.
BbrMode_t
BBR has the following 4 modes for deciding how fast to send:
void ExitProbeRTT()
Called on exiting from BBR_PROBE_RTT state, it eithers invoke EnterProbeBW () or EnterStartup () ...
bool ModulateCwndForRecovery(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Modulates congestion window in CA_RECOVERY.
Discover, share bw: pace around estimated bw.
uint32_t m_ackEpochAckedResetThresh
Max allowed val for m_ackEpochAcked, after which sampling epoch is reset.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AdvanceCyclePhase()
Advances pacing gain using cycle gain algorithm, while in BBR_PROBE_BW state.
BbrMode_t m_state
Current state of BBR state machine.
void UpdateRTprop(Ptr< TcpSocketState > tcb)
Updates minimum RTT.
Congestion control abstract class.
double GetPacingGain()
Gets current pacing gain.
void CheckDrain(Ptr< TcpSocketState > tcb)
Checks whether its time to enter BBR_DRAIN or BBR_PROBE_BW state.
void SetPacingRate(Ptr< TcpSocketState > tcb, double gain)
Updates pacing rate based on network model.
void InitRoundCounting()
Intializes the round counting related variables.
void SetSendQuantum(Ptr< TcpSocketState > tcb)
Updates send quantum based on the network model.
void UpdateAckAggregation(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Estimates max degree of aggregation.
Time m_probeRtPropStamp
The wall clock time at which the current BBR.RTProp sample was obtained.
Time m_probeRttDoneStamp
Time to exit from BBR_PROBE_RTT state.
uint32_t m_nextRoundDelivered
Denotes the end of a packet-timed round trip.
Information about the connection rate.
virtual bool HasCongControl() const
Returns true when Congestion Control Algorithm implements CongControl.
DataRate m_fullBandwidth
Value of full bandwidth recorded.
bool m_probeRttRoundDone
True when it is time to exit BBR_PROBE_RTT.
Ptr< UniformRandomVariable > m_uv
Uniform Random Variable.
Time Seconds(double value)
Construct a Time in the indicated unit.
uint32_t m_extraAcked[2]
Maximum excess data acked in epoch.
virtual void SetStream(uint32_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
uint32_t m_bandwidthWindowLength
A constant specifying the length of the BBR.BtlBw max filter window, default 10 packet-timed round tr...
static const double PACING_GAIN_CYCLE[]
BBR uses an eight-phase cycle with the given pacing_gain value in the BBR ProbeBW gain cycle...
Time m_cycleStamp
Last time gain cycle updated.
uint32_t m_sendQuantum
The maximum size of a data aggregate scheduled and transmitted together.
double m_pacingGain
The dynamic pacing gain factor.
uint32_t m_roundCount
Count of packet-timed round trips.
void EnterStartup()
Updates variables specific to BBR_STARTUP state.
virtual void CongControl(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateConnection &rc, const TcpRateOps::TcpRateSample &rs)
Called when packets are delivered to update cwnd and pacing rate.
WindowedFilter< DataRate, MaxFilter< DataRate >, uint32_t, uint32_t > MaxBandwidthFilter_t
Definition of max bandwidth filter.
double m_cWndGain
The dynamic congestion window gain factor.
uint64_t m_delivered
The total amount of data in bytes delivered so far.
void CheckCyclePhase(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Checks whether to advance pacing gain in BBR_PROBE_BW state, and if allowed calls AdvanceCyclePhase (...
uint32_t m_minPipeCwnd
The minimal congestion window value BBR tries to target, default 4 Segment size.
void HandleRestartFromIdle(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates pacing rate if socket is restarting from idle state.
void InitPacingRate(Ptr< TcpSocketState > tcb)
Intializes the pacing rate.
void UpdateControlParameters(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs)
Updates control parameters congestion windowm, pacing rate, send quantum.
a unique identifier for an interface.
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
Drain any queue created during startup.
bool m_rtPropExpired
A boolean recording whether the BBR.RTprop has expired.
void EnterProbeBW()
Updates variables specific to BBR_PROBE_BW state.
double GetCwndGain()
Gets current cwnd gain.