BBR congestion control algorithm. More...
#include "tcp-bbr.h"
Public Types | |
enum | BbrMode_t { BBR_STARTUP , BBR_DRAIN , BBR_PROBE_BW , BBR_PROBE_RTT } |
BBR has the following 4 modes for deciding how fast to send: More... | |
typedef WindowedFilter< DataRate, MaxFilter< DataRate >, uint32_t, uint32_t > | MaxBandwidthFilter_t |
Definition of max bandwidth filter. More... | |
Public Member Functions | |
TcpBbr () | |
Constructor. More... | |
TcpBbr (const TcpBbr &sock) | |
Copy constructor. More... | |
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. More... | |
virtual void | CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) |
Trigger events/calculations specific to a congestion state. More... | |
virtual void | CwndEvent (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event) |
Trigger events/calculations on occurrence of congestion window event. More... | |
virtual Ptr< TcpCongestionOps > | Fork () |
Copy the congestion control algorithm across sockets. More... | |
virtual std::string | GetName () const |
Get the name of the congestion control algorithm. More... | |
virtual uint32_t | GetSsThresh (Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) |
Get the slow start threshold after a loss event. More... | |
virtual bool | HasCongControl () const |
Returns true when Congestion Control Algorithm implements CongControl. More... | |
virtual void | SetStream (uint32_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
Public Member Functions inherited from ns3::TcpCongestionOps | |
TcpCongestionOps () | |
TcpCongestionOps (const TcpCongestionOps &other) | |
Copy constructor. More... | |
virtual | ~TcpCongestionOps () |
virtual void | IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) |
Congestion avoidance algorithm implementation. More... | |
virtual void | Init ([[maybe_unused]] Ptr< TcpSocketState > tcb) |
Set configuration required by congestion control algorithm. More... | |
virtual void | PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) |
Timing information on received ACK. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::TcpCongestionOps | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Attributes | |
static const char *const | BbrModeName [BBR_PROBE_RTT+1] |
Literal names of BBR mode for use in log messages. More... | |
static const uint8_t | GAIN_CYCLE_LENGTH = 8 |
The number of phases in the BBR ProbeBW gain cycle. More... | |
static const double | PACING_GAIN_CYCLE [] = {5.0 / 4, 3.0 / 4, 1, 1, 1, 1, 1, 1} |
BBR uses an eight-phase cycle with the given pacing_gain value in the BBR ProbeBW gain cycle. More... | |
Protected Member Functions | |
uint32_t | AckAggregationCwnd () |
Find Cwnd increment based on ack aggregation. More... | |
void | AdvanceCyclePhase () |
Advances pacing gain using cycle gain algorithm, while in BBR_PROBE_BW state. More... | |
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 () More... | |
void | CheckDrain (Ptr< TcpSocketState > tcb) |
Checks whether its time to enter BBR_DRAIN or BBR_PROBE_BW state. More... | |
void | CheckFullPipe (const TcpRateOps::TcpRateSample &rs) |
Identifies whether pipe or BDP is already full. More... | |
void | CheckProbeRTT (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
This method handles the steps related to the ProbeRTT state. More... | |
void | EnterDrain () |
Updates variables specific to BBR_DRAIN state. More... | |
void | EnterProbeBW () |
Updates variables specific to BBR_PROBE_BW state. More... | |
void | EnterProbeRTT () |
Updates variables specific to BBR_PROBE_RTT state. More... | |
void | EnterStartup () |
Updates variables specific to BBR_STARTUP state. More... | |
void | ExitProbeRTT () |
Called on exiting from BBR_PROBE_RTT state, it eithers invoke EnterProbeBW () or EnterStartup () More... | |
uint32_t | GetBbrState () |
Gets BBR state. More... | |
double | GetCwndGain () |
Gets current cwnd gain. More... | |
double | GetPacingGain () |
Gets current pacing gain. More... | |
void | HandleProbeRTT (Ptr< TcpSocketState > tcb) |
Handles the steps for BBR_PROBE_RTT state. More... | |
void | HandleRestartFromIdle (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates pacing rate if socket is restarting from idle state. More... | |
uint32_t | InFlight (Ptr< TcpSocketState > tcb, double gain) |
Estimates the target value for congestion window. More... | |
void | InitFullPipe () |
Intializes the full pipe estimator. More... | |
void | InitPacingRate (Ptr< TcpSocketState > tcb) |
Intializes the pacing rate. More... | |
void | InitRoundCounting () |
Intializes the round counting related variables. More... | |
bool | IsNextCyclePhase (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Checks whether to move to next value of pacing gain while in BBR_PROBE_BW. More... | |
void | ModulateCwndForProbeRTT (Ptr< TcpSocketState > tcb) |
Modulates congestion window in BBR_PROBE_RTT. More... | |
bool | ModulateCwndForRecovery (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Modulates congestion window in CA_RECOVERY. More... | |
void | RestoreCwnd (Ptr< TcpSocketState > tcb) |
Helper to restore the last-known good congestion window. More... | |
void | SaveCwnd (Ptr< const TcpSocketState > tcb) |
Helper to remember the last-known good congestion window or the latest congestion window unmodulated by loss recovery or ProbeRTT. More... | |
void | SetBbrState (BbrMode_t state) |
Sets BBR state. More... | |
void | SetCwnd (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates congestion window based on the network model. More... | |
void | SetPacingRate (Ptr< TcpSocketState > tcb, double gain) |
Updates pacing rate based on network model. More... | |
void | SetSendQuantum (Ptr< TcpSocketState > tcb) |
Updates send quantum based on the network model. More... | |
void | UpdateAckAggregation (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Estimates max degree of aggregation. More... | |
void | UpdateBtlBw (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates maximum bottleneck. More... | |
void | UpdateControlParameters (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates control parameters congestion windowm, pacing rate, send quantum. More... | |
void | UpdateModelAndState (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates BBR network model (Maximum bandwidth and minimum RTT). More... | |
void | UpdateRound (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateSample &rs) |
Updates round counting related variables. More... | |
void | UpdateRTprop (Ptr< TcpSocketState > tcb) |
Updates minimum RTT. More... | |
void | UpdateTargetCwnd (Ptr< TcpSocketState > tcb) |
Updates target congestion window. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Attributes | |
uint32_t | m_ackEpochAcked {0} |
Bytes ACked in sampling epoch. More... | |
uint32_t | m_ackEpochAckedResetThresh {1 << 17} |
Max allowed val for m_ackEpochAcked, after which sampling epoch is reset. More... | |
Time | m_ackEpochTime {Seconds(0)} |
Starting of ACK sampling epoch time. More... | |
uint32_t | m_appLimited {0} |
The index of the last transmitted packet marked as application-limited. More... | |
uint32_t | m_bandwidthWindowLength {0} |
A constant specifying the length of the BBR.BtlBw max filter window, default 10 packet-timed round trips. More... | |
double | m_cWndGain {0} |
The dynamic congestion window gain factor. More... | |
uint32_t | m_cycleIndex {0} |
Current index of gain cycle. More... | |
Time | m_cycleStamp {Seconds (0)} |
Last time gain cycle updated. More... | |
uint64_t | m_delivered {0} |
The total amount of data in bytes delivered so far. More... | |
uint32_t | m_extraAcked [2] {0, 0} |
Maximum excess data acked in epoch. More... | |
uint32_t | m_extraAckedGain {1} |
Gain factor for adding extra ack to cwnd. More... | |
uint32_t | m_extraAckedIdx {0} |
Current index in extra acked array. More... | |
uint32_t | m_extraAckedWinRtt {0} |
Age of extra acked in rtt. More... | |
uint32_t | m_extraAckedWinRttLength {5} |
Window length of extra acked window. More... | |
DataRate | m_fullBandwidth {0} |
Value of full bandwidth recorded. More... | |
uint32_t | m_fullBandwidthCount {0} |
Count of full bandwidth recorded consistently. More... | |
bool | m_hasSeenRtt {false} |
Have we seen RTT sample yet? More... | |
double | m_highGain {0} |
A constant specifying highest gain factor, default is 2.89. More... | |
bool | m_idleRestart {false} |
When restarting from idle, set it true. More... | |
bool | m_isInitialized {false} |
Set to true after first time initializtion variables. More... | |
bool | m_isPipeFilled {false} |
A boolean that records whether BBR has filled the pipe. More... | |
MaxBandwidthFilter_t | m_maxBwFilter |
Maximum bandwidth filter. More... | |
uint32_t | m_minPipeCwnd {0} |
The minimal congestion window value BBR tries to target, default 4 Segment size. More... | |
uint32_t | m_nextRoundDelivered {0} |
Denotes the end of a packet-timed round trip. More... | |
double | m_pacingGain {0} |
The dynamic pacing gain factor. More... | |
bool | m_packetConservation {false} |
Enable/Disable packet conservation mode. More... | |
uint32_t | m_priorCwnd {0} |
The last-known good congestion window. More... | |
Time | m_probeRtPropStamp {Seconds (0)} |
The wall clock time at which the current BBR.RTProp sample was obtained. More... | |
Time | m_probeRttDoneStamp {Seconds (0)} |
Time to exit from BBR_PROBE_RTT state. More... | |
Time | m_probeRttDuration {MilliSeconds (200)} |
A constant specifying the minimum duration for which ProbeRTT state, default 200 millisecs. More... | |
bool | m_probeRttRoundDone {false} |
True when it is time to exit BBR_PROBE_RTT. More... | |
uint32_t | m_roundCount {0} |
Count of packet-timed round trips. More... | |
bool | m_roundStart {false} |
A boolean that BBR sets to true once per packet-timed round trip. More... | |
Time | m_rtProp {Time::Max ()} |
Estimated two-way round-trip propagation delay of the path, estimated from the windowed minimum recent round-trip delay sample. More... | |
bool | m_rtPropExpired {false} |
A boolean recording whether the BBR.RTprop has expired. More... | |
Time | m_rtPropFilterLen {Seconds (10)} |
A constant specifying the length of the RTProp min filter window, default 10 secs. More... | |
Time | m_rtPropStamp {Seconds (0)} |
The wall clock time at which the current BBR.RTProp sample was obtained. More... | |
uint32_t | m_sendQuantum {0} |
The maximum size of a data aggregate scheduled and transmitted together. More... | |
BbrMode_t | m_state {BbrMode_t::BBR_STARTUP} |
Current state of BBR state machine. More... | |
uint32_t | m_targetCWnd {0} |
Target value for congestion window, adapted to the estimated BDP. More... | |
uint32_t | m_txItemDelivered {0} |
The number of bytes already delivered at the time of new packet transmission. More... | |
Ptr< UniformRandomVariable > | m_uv {nullptr} |
Uniform Random Variable. More... | |
Related Functions | |
(Note that these are not member functions.) | |
class | TcpBbrCheckGainValuesTest |
TcpBbrCheckGainValuesTest friend class (for tests). More... | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
BBR congestion control algorithm.
This class implement the BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control type.
ns3::TcpBbr is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 336 bytes (on a 64-bit architecture).
typedef WindowedFilter<DataRate, MaxFilter<DataRate>, uint32_t, uint32_t> ns3::TcpBbr::MaxBandwidthFilter_t |
ns3::TcpBbr::TcpBbr | ( | ) |
ns3::TcpBbr::TcpBbr | ( | const TcpBbr & | sock | ) |
Copy constructor.
sock | The socket to copy from. |
Definition at line 88 of file tcp-bbr.cc.
References NS_LOG_FUNCTION.
|
protected |
Find Cwnd increment based on ack aggregation.
Definition at line 471 of file tcp-bbr.cc.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::DataRate::GetBitRate(), m_extraAcked, m_extraAckedGain, m_isPipeFilled, m_maxBwFilter, max, and min.
Referenced by UpdateTargetCwnd().
|
protected |
Advances pacing gain using cycle gain algorithm, while in BBR_PROBE_BW state.
Definition at line 253 of file tcp-bbr.cc.
References GAIN_CYCLE_LENGTH, m_cycleIndex, m_cycleStamp, m_pacingGain, ns3::Simulator::Now(), NS_LOG_FUNCTION, and PACING_GAIN_CYCLE.
Referenced by CheckCyclePhase(), and EnterProbeBW().
|
protected |
Checks whether to advance pacing gain in BBR_PROBE_BW state, and if allowed calls AdvanceCyclePhase ()
tcb | the socket state. |
rs | rate sample. |
Definition at line 281 of file tcp-bbr.cc.
References AdvanceCyclePhase(), IsNextCyclePhase(), m_state, and NS_LOG_FUNCTION.
Referenced by UpdateModelAndState().
|
protected |
Checks whether its time to enter BBR_DRAIN or BBR_PROBE_BW state.
tcb | the socket state. |
Definition at line 336 of file tcp-bbr.cc.
References EnterDrain(), EnterProbeBW(), InFlight(), ns3::TcpSocketState::m_bytesInFlight, m_isPipeFilled, ns3::TcpSocketState::m_ssThresh, m_state, and NS_LOG_FUNCTION.
Referenced by UpdateModelAndState().
|
protected |
Identifies whether pipe or BDP is already full.
rs | rate sample. |
Definition at line 291 of file tcp-bbr.cc.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::DataRate::GetBitRate(), m_fullBandwidth, m_fullBandwidthCount, ns3::TcpRateOps::TcpRateSample::m_isAppLimited, m_isPipeFilled, m_maxBwFilter, m_roundStart, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by UpdateModelAndState().
|
protected |
This method handles the steps related to the ProbeRTT state.
tcb | the socket state. |
rs | rate sample. |
Definition at line 435 of file tcp-bbr.cc.
References EnterProbeRTT(), HandleProbeRTT(), ns3::TcpRateOps::TcpRateSample::m_delivered, m_idleRestart, m_probeRttDoneStamp, m_rtPropExpired, m_state, NS_LOG_FUNCTION, SaveCwnd(), and ns3::Seconds().
Referenced by UpdateModelAndState().
|
virtual |
Called when packets are delivered to update cwnd and pacing rate.
This function mimics the function cong_control in Linux. It is allowed to change directly cWnd and pacing rate.
tcb | internal congestion state |
rc | Rate information for the connection |
rs | Rate sample (over a period of time) information |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 689 of file tcp-bbr.cc.
References m_delivered, ns3::TcpRateOps::TcpRateConnection::m_delivered, m_txItemDelivered, ns3::TcpRateOps::TcpRateConnection::m_txItemDelivered, NS_LOG_FUNCTION, UpdateControlParameters(), and UpdateModelAndState().
|
virtual |
Trigger events/calculations specific to a congestion state.
This function mimics the notification function set_state in Linux. The function does not change the congestion state in the tcb; it notifies the congestion control algorithm that this state is about to be changed. The tcb->m_congState variable must be separately set; for example:
tcb | internal congestion state |
newState | new congestion state to which the TCP is going to switch |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 701 of file tcp-bbr.cc.
References ns3::TcpSocketState::CA_LOSS, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, EnterStartup(), ns3::TracedValue< T >::Get(), InitFullPipe(), InitPacingRate(), InitRoundCounting(), m_ackEpochAcked, m_ackEpochTime, ns3::TcpSocketState::m_bytesInFlight, ns3::TcpSocketState::m_cWnd, m_extraAcked, m_extraAckedIdx, m_extraAckedWinRtt, ns3::TcpSocketState::m_initialSsThresh, m_isInitialized, ns3::TcpSocketState::m_lastAckedSackedBytes, ns3::TcpSocketState::m_lastRtt, m_minPipeCwnd, m_packetConservation, m_priorCwnd, m_roundStart, m_rtProp, m_rtPropStamp, ns3::TcpSocketState::m_segmentSize, m_sendQuantum, ns3::TcpSocketState::m_ssThresh, m_targetCWnd, ns3::Time::Max(), max, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and SaveCwnd().
|
virtual |
Trigger events/calculations on occurrence of congestion window event.
This function mimics the function cwnd_event in Linux. The function is called in case of congestion window events.
tcb | internal congestion state |
event | the event which triggered this function |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 744 of file tcp-bbr.cc.
References ns3::TcpSocketState::CA_EVENT_COMPLETE_CWR, ns3::TcpSocketState::CA_EVENT_TX_START, ExitProbeRTT(), m_ackEpochAcked, m_ackEpochTime, m_appLimited, m_idleRestart, m_packetConservation, m_probeRttDoneStamp, m_probeRttRoundDone, m_rtPropStamp, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, RestoreCwnd(), and SetPacingRate().
|
protected |
Updates variables specific to BBR_DRAIN state.
Definition at line 316 of file tcp-bbr.cc.
References m_cWndGain, m_highGain, m_pacingGain, NS_LOG_FUNCTION, and SetBbrState().
Referenced by CheckDrain().
|
protected |
Updates variables specific to BBR_PROBE_BW state.
Definition at line 325 of file tcp-bbr.cc.
References AdvanceCyclePhase(), GAIN_CYCLE_LENGTH, ns3::UniformRandomVariable::GetValue(), m_cWndGain, m_cycleIndex, m_pacingGain, m_uv, NS_LOG_FUNCTION, and SetBbrState().
Referenced by CheckDrain(), and ExitProbeRTT().
|
protected |
Updates variables specific to BBR_PROBE_RTT state.
Definition at line 364 of file tcp-bbr.cc.
References m_cWndGain, m_pacingGain, NS_LOG_FUNCTION, and SetBbrState().
Referenced by CheckProbeRTT().
|
protected |
Updates variables specific to BBR_STARTUP state.
Definition at line 194 of file tcp-bbr.cc.
References m_cWndGain, m_highGain, m_pacingGain, NS_LOG_FUNCTION, and SetBbrState().
Referenced by CongestionStateSet(), and ExitProbeRTT().
|
protected |
Called on exiting from BBR_PROBE_RTT state, it eithers invoke EnterProbeBW () or EnterStartup ()
Definition at line 394 of file tcp-bbr.cc.
References EnterProbeBW(), EnterStartup(), m_isPipeFilled, and NS_LOG_FUNCTION.
Referenced by CwndEvent(), and HandleProbeRTT().
|
virtual |
Copy the congestion control algorithm across sockets.
Implements ns3::TcpCongestionOps.
Definition at line 785 of file tcp-bbr.cc.
|
protected |
Gets BBR state.
Definition at line 655 of file tcp-bbr.cc.
References m_state, and NS_LOG_FUNCTION.
|
protected |
Gets current cwnd gain.
Definition at line 662 of file tcp-bbr.cc.
References m_cWndGain, and NS_LOG_FUNCTION.
|
virtual |
Get the name of the congestion control algorithm.
Implements ns3::TcpCongestionOps.
Definition at line 676 of file tcp-bbr.cc.
|
protected |
Gets current pacing gain.
Definition at line 669 of file tcp-bbr.cc.
References m_pacingGain, and NS_LOG_FUNCTION.
|
virtual |
Get the slow start threshold after a loss event.
Is guaranteed that the congestion control state (TcpAckState_t
) is changed BEFORE the invocation of this method. The implementator should return the slow start threshold (and not change it directly) because, in the future, the TCP implementation may require to instantly recover from a loss event (e.g. when there is a network with an high reordering factor).
tcb | internal congestion state |
bytesInFlight | total bytes in flight |
Implements ns3::TcpCongestionOps.
Definition at line 777 of file tcp-bbr.cc.
References NS_LOG_FUNCTION, and SaveCwnd().
|
static |
Get the type ID.
Definition at line 36 of file tcp-bbr.cc.
References m_ackEpochAckedResetThresh, m_bandwidthWindowLength, m_extraAckedWinRttLength, m_highGain, m_probeRttDuration, m_rtPropFilterLen, ns3::MakeDoubleAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::MilliSeconds(), ns3::Seconds(), ns3::TypeId::SetParent(), and SetStream().
|
protected |
Handles the steps for BBR_PROBE_RTT state.
tcb | the socket state. |
Definition at line 408 of file tcp-bbr.cc.
References ExitProbeRTT(), ns3::TracedValue< T >::Get(), m_appLimited, ns3::TcpSocketState::m_bytesInFlight, m_delivered, m_minPipeCwnd, m_nextRoundDelivered, m_probeRttDoneStamp, m_probeRttDuration, m_probeRttRoundDone, m_roundStart, m_rtPropStamp, ns3::Simulator::Now(), NS_LOG_FUNCTION, RestoreCwnd(), and ns3::Seconds().
Referenced by CheckProbeRTT().
|
protected |
Updates pacing rate if socket is restarting from idle state.
tcb | the socket state. |
rs | rate sample. |
Definition at line 203 of file tcp-bbr.cc.
References ns3::TracedValue< T >::Get(), ns3::TcpSocketState::m_bytesInFlight, m_idleRestart, ns3::TcpRateOps::TcpRateSample::m_isAppLimited, m_state, NS_LOG_FUNCTION, and SetPacingRate().
|
virtual |
Returns true when Congestion Control Algorithm implements CongControl.
This function is the equivalent in C++ of the C checks that are used in the Linux kernel to see if an optional function has been defined. Since CongControl is optional, not all congestion controls have it. But, from the perspective of TcpSocketBase, the behavior is different if CongControl is present. Therefore, this check should return true for any congestion controls that implements the CongControl optional function.
Reimplemented from ns3::TcpCongestionOps.
Definition at line 682 of file tcp-bbr.cc.
References NS_LOG_FUNCTION.
|
protected |
Estimates the target value for congestion window.
tcb | the socket state. |
gain | cwnd gain. |
Definition at line 235 of file tcp-bbr.cc.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), m_cycleIndex, ns3::TcpSocketState::m_initialCWnd, m_maxBwFilter, m_rtProp, ns3::TcpSocketState::m_segmentSize, m_sendQuantum, m_state, ns3::Time::Max(), and NS_LOG_FUNCTION.
Referenced by CheckDrain(), IsNextCyclePhase(), and UpdateTargetCwnd().
|
protected |
Intializes the full pipe estimator.
Definition at line 156 of file tcp-bbr.cc.
References m_fullBandwidth, m_fullBandwidthCount, m_isPipeFilled, and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
protected |
Intializes the pacing rate.
tcb | the socket state. |
Definition at line 165 of file tcp-bbr.cc.
References ns3::DataRate::GetBitRate(), ns3::Time::GetMilliSeconds(), ns3::Time::GetSeconds(), m_bandwidthWindowLength, ns3::TcpSocketState::m_cWnd, m_hasSeenRtt, m_maxBwFilter, ns3::TcpSocketState::m_minRtt, ns3::TcpSocketState::m_pacing, m_pacingGain, ns3::TcpSocketState::m_pacingRate, ns3::Time::Max(), ns3::MilliSeconds(), NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by CongestionStateSet(), and SetPacingRate().
|
protected |
Intializes the round counting related variables.
Definition at line 147 of file tcp-bbr.cc.
References m_nextRoundDelivered, m_roundCount, m_roundStart, and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
protected |
Checks whether to move to next value of pacing gain while in BBR_PROBE_BW.
tcb | the socket state. |
rs | rate sample. |
Definition at line 262 of file tcp-bbr.cc.
References InFlight(), ns3::TcpRateOps::TcpRateSample::m_bytesLoss, m_cycleStamp, m_pacingGain, ns3::TcpRateOps::TcpRateSample::m_priorInFlight, m_rtProp, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by CheckCyclePhase().
|
protected |
Modulates congestion window in BBR_PROBE_RTT.
tcb | the socket state. |
Definition at line 546 of file tcp-bbr.cc.
References ns3::TracedValue< T >::Get(), ns3::TcpSocketState::m_cWnd, m_minPipeCwnd, m_state, min, and NS_LOG_FUNCTION.
Referenced by SetCwnd().
|
protected |
Modulates congestion window in CA_RECOVERY.
tcb | the socket state. |
rs | rate sample. |
Definition at line 529 of file tcp-bbr.cc.
References ns3::TracedValue< T >::Get(), ns3::TcpRateOps::TcpRateSample::m_ackedSacked, ns3::TcpSocketState::m_bytesInFlight, ns3::TcpRateOps::TcpRateSample::m_bytesLoss, ns3::TcpSocketState::m_cWnd, m_packetConservation, ns3::TcpSocketState::m_segmentSize, max, and NS_LOG_FUNCTION.
Referenced by SetCwnd().
|
protected |
Helper to restore the last-known good congestion window.
tcb | the socket state. |
Definition at line 387 of file tcp-bbr.cc.
References ns3::TracedValue< T >::Get(), ns3::TcpSocketState::m_cWnd, m_priorCwnd, max, and NS_LOG_FUNCTION.
Referenced by CwndEvent(), and HandleProbeRTT().
|
protected |
Helper to remember the last-known good congestion window or the latest congestion window unmodulated by loss recovery or ProbeRTT.
tcb | the socket state. |
Definition at line 373 of file tcp-bbr.cc.
References ns3::TcpSocketState::CA_RECOVERY, m_priorCwnd, m_state, max, and NS_LOG_FUNCTION.
Referenced by CheckProbeRTT(), CongestionStateSet(), and GetSsThresh().
|
protected |
Sets BBR state.
state | BBR state. |
Definition at line 647 of file tcp-bbr.cc.
References BbrModeName, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by EnterDrain(), EnterProbeBW(), EnterProbeRTT(), and EnterStartup().
|
protected |
Updates congestion window based on the network model.
tcb | the socket state. |
rs | rate sample |
Definition at line 556 of file tcp-bbr.cc.
References ns3::TcpSocketState::CA_RECOVERY, ns3::TracedValue< T >::Get(), ns3::TcpRateOps::TcpRateSample::m_ackedSacked, ns3::TcpSocketState::m_congState, ns3::TcpSocketState::m_cWnd, m_isPipeFilled, m_minPipeCwnd, ns3::TcpSocketState::m_segmentSize, m_targetCWnd, max, min, ModulateCwndForProbeRTT(), ModulateCwndForRecovery(), NS_LOG_FUNCTION, and UpdateTargetCwnd().
Referenced by UpdateControlParameters().
|
protected |
Updates pacing rate based on network model.
tcb | the socket state. |
gain | pacing gain. |
Definition at line 217 of file tcp-bbr.cc.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::DataRate::GetBitRate(), InitPacingRate(), m_hasSeenRtt, m_isPipeFilled, m_maxBwFilter, ns3::TcpSocketState::m_maxPacingRate, ns3::TcpSocketState::m_minRtt, ns3::TcpSocketState::m_pacingRate, ns3::Time::Max(), min, and NS_LOG_FUNCTION.
Referenced by CwndEvent(), HandleRestartFromIdle(), and UpdateControlParameters().
|
protected |
Updates send quantum based on the network model.
tcb | the socket state. |
Definition at line 457 of file tcp-bbr.cc.
References ns3::TcpSocketState::m_segmentSize, m_sendQuantum, and NS_LOG_FUNCTION.
Referenced by UpdateControlParameters().
|
virtual |
Assign a fixed random variable stream number to the random variables used by this model.
stream | first stream index to use |
Definition at line 140 of file tcp-bbr.cc.
References m_uv, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
Referenced by GetTypeId().
|
protected |
Estimates max degree of aggregation.
tcb | the socket state. |
rs | rate sample. |
Definition at line 486 of file tcp-bbr.cc.
References ns3::TracedValue< T >::Get(), ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::DataRate::GetBitRate(), ns3::Time::GetSeconds(), ns3::TcpRateOps::TcpRateSample::m_ackedSacked, m_ackEpochAcked, m_ackEpochAckedResetThresh, m_ackEpochTime, ns3::TcpSocketState::m_cWnd, ns3::TcpRateOps::TcpRateSample::m_delivered, m_extraAcked, m_extraAckedGain, m_extraAckedIdx, m_extraAckedWinRtt, m_extraAckedWinRttLength, m_maxBwFilter, m_roundStart, min, and ns3::Simulator::Now().
Referenced by UpdateModelAndState().
|
protected |
Updates maximum bottleneck.
tcb | the socket state. |
rs | rate sample. |
Definition at line 607 of file tcp-bbr.cc.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::TcpRateOps::TcpRateSample::m_deliveryRate, ns3::TcpRateOps::TcpRateSample::m_isAppLimited, m_maxBwFilter, m_roundCount, NS_LOG_FUNCTION, ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update(), and UpdateRound().
Referenced by UpdateModelAndState().
|
protected |
Updates control parameters congestion windowm, pacing rate, send quantum.
tcb | the socket state. |
rs | rate sample. |
Definition at line 638 of file tcp-bbr.cc.
References m_pacingGain, NS_LOG_FUNCTION, SetCwnd(), SetPacingRate(), and SetSendQuantum().
Referenced by CongControl().
|
protected |
Updates BBR network model (Maximum bandwidth and minimum RTT).
tcb | the socket state. |
rs | rate sample. |
Definition at line 625 of file tcp-bbr.cc.
References CheckCyclePhase(), CheckDrain(), CheckFullPipe(), CheckProbeRTT(), NS_LOG_FUNCTION, UpdateAckAggregation(), UpdateBtlBw(), and UpdateRTprop().
Referenced by CongControl().
|
protected |
Updates round counting related variables.
tcb | the socket state. |
rs | rate sample. |
Definition at line 590 of file tcp-bbr.cc.
References m_delivered, m_nextRoundDelivered, m_packetConservation, ns3::TcpRateOps::TcpRateSample::m_priorDelivered, m_roundCount, m_roundStart, and NS_LOG_FUNCTION.
Referenced by UpdateBtlBw().
|
protected |
Updates minimum RTT.
tcb | the socket state. |
Definition at line 352 of file tcp-bbr.cc.
References ns3::TcpSocketState::m_lastRtt, m_rtProp, m_rtPropExpired, m_rtPropFilterLen, m_rtPropStamp, ns3::Simulator::Now(), NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by UpdateModelAndState().
|
protected |
Updates target congestion window.
tcb | the socket state. |
Definition at line 464 of file tcp-bbr.cc.
References AckAggregationCwnd(), InFlight(), m_cWndGain, m_targetCWnd, and NS_LOG_FUNCTION.
Referenced by SetCwnd().
|
friend |
TcpBbrCheckGainValuesTest friend class (for tests).
|
static |
Literal names of BBR mode for use in log messages.
Definition at line 94 of file tcp-bbr.h.
Referenced by SetBbrState().
|
static |
The number of phases in the BBR ProbeBW gain cycle.
Definition at line 50 of file tcp-bbr.h.
Referenced by AdvanceCyclePhase(), and EnterProbeBW().
|
private |
Bytes ACked in sampling epoch.
Definition at line 391 of file tcp-bbr.h.
Referenced by CongestionStateSet(), CwndEvent(), and UpdateAckAggregation().
|
private |
Max allowed val for m_ackEpochAcked, after which sampling epoch is reset.
Definition at line 388 of file tcp-bbr.h.
Referenced by GetTypeId(), and UpdateAckAggregation().
Starting of ACK sampling epoch time.
Definition at line 390 of file tcp-bbr.h.
Referenced by CongestionStateSet(), CwndEvent(), and UpdateAckAggregation().
|
private |
The index of the last transmitted packet marked as application-limited.
Definition at line 382 of file tcp-bbr.h.
Referenced by CwndEvent(), and HandleProbeRTT().
|
private |
A constant specifying the length of the BBR.BtlBw max filter window, default 10 packet-timed round trips.
Definition at line 353 of file tcp-bbr.h.
Referenced by GetTypeId(), and InitPacingRate().
|
private |
The dynamic congestion window gain factor.
Definition at line 355 of file tcp-bbr.h.
Referenced by EnterDrain(), EnterProbeBW(), EnterProbeRTT(), EnterStartup(), GetCwndGain(), and UpdateTargetCwnd().
|
private |
Current index of gain cycle.
Definition at line 375 of file tcp-bbr.h.
Referenced by AdvanceCyclePhase(), EnterProbeBW(), and InFlight().
Last time gain cycle updated.
Definition at line 374 of file tcp-bbr.h.
Referenced by AdvanceCyclePhase(), and IsNextCyclePhase().
|
private |
The total amount of data in bytes delivered so far.
Definition at line 381 of file tcp-bbr.h.
Referenced by CongControl(), HandleProbeRTT(), and UpdateRound().
|
private |
Maximum excess data acked in epoch.
Definition at line 385 of file tcp-bbr.h.
Referenced by AckAggregationCwnd(), CongestionStateSet(), and UpdateAckAggregation().
|
private |
Gain factor for adding extra ack to cwnd.
Definition at line 384 of file tcp-bbr.h.
Referenced by AckAggregationCwnd(), and UpdateAckAggregation().
|
private |
Current index in extra acked array.
Definition at line 389 of file tcp-bbr.h.
Referenced by CongestionStateSet(), and UpdateAckAggregation().
|
private |
Age of extra acked in rtt.
Definition at line 386 of file tcp-bbr.h.
Referenced by CongestionStateSet(), and UpdateAckAggregation().
|
private |
Window length of extra acked window.
Definition at line 387 of file tcp-bbr.h.
Referenced by GetTypeId(), and UpdateAckAggregation().
|
private |
Value of full bandwidth recorded.
Definition at line 370 of file tcp-bbr.h.
Referenced by CheckFullPipe(), and InitFullPipe().
|
private |
Count of full bandwidth recorded consistently.
Definition at line 371 of file tcp-bbr.h.
Referenced by CheckFullPipe(), and InitFullPipe().
|
private |
Have we seen RTT sample yet?
Definition at line 392 of file tcp-bbr.h.
Referenced by InitPacingRate(), and SetPacingRate().
|
private |
A constant specifying highest gain factor, default is 2.89.
Definition at line 356 of file tcp-bbr.h.
Referenced by EnterDrain(), EnterStartup(), and GetTypeId().
|
private |
When restarting from idle, set it true.
Definition at line 368 of file tcp-bbr.h.
Referenced by CheckProbeRTT(), CwndEvent(), and HandleRestartFromIdle().
|
private |
Set to true after first time initializtion variables.
Definition at line 379 of file tcp-bbr.h.
Referenced by CongestionStateSet().
|
private |
A boolean that records whether BBR has filled the pipe.
Definition at line 357 of file tcp-bbr.h.
Referenced by AckAggregationCwnd(), CheckDrain(), CheckFullPipe(), ExitProbeRTT(), InitFullPipe(), SetCwnd(), and SetPacingRate().
|
private |
Maximum bandwidth filter.
Definition at line 352 of file tcp-bbr.h.
Referenced by AckAggregationCwnd(), CheckFullPipe(), InFlight(), InitPacingRate(), SetPacingRate(), UpdateAckAggregation(), and UpdateBtlBw().
|
private |
The minimal congestion window value BBR tries to target, default 4 Segment size.
Definition at line 358 of file tcp-bbr.h.
Referenced by CongestionStateSet(), HandleProbeRTT(), ModulateCwndForProbeRTT(), and SetCwnd().
|
private |
Denotes the end of a packet-timed round trip.
Definition at line 361 of file tcp-bbr.h.
Referenced by HandleProbeRTT(), InitRoundCounting(), and UpdateRound().
|
private |
The dynamic pacing gain factor.
Definition at line 354 of file tcp-bbr.h.
Referenced by AdvanceCyclePhase(), EnterDrain(), EnterProbeBW(), EnterProbeRTT(), EnterStartup(), GetPacingGain(), InitPacingRate(), IsNextCyclePhase(), and UpdateControlParameters().
|
private |
Enable/Disable packet conservation mode.
Definition at line 366 of file tcp-bbr.h.
Referenced by CongestionStateSet(), CwndEvent(), ModulateCwndForRecovery(), and UpdateRound().
|
private |
The last-known good congestion window.
Definition at line 367 of file tcp-bbr.h.
Referenced by CongestionStateSet(), RestoreCwnd(), and SaveCwnd().
Time to exit from BBR_PROBE_RTT state.
Definition at line 364 of file tcp-bbr.h.
Referenced by CheckProbeRTT(), CwndEvent(), and HandleProbeRTT().
|
private |
A constant specifying the minimum duration for which ProbeRTT state, default 200 millisecs.
Definition at line 362 of file tcp-bbr.h.
Referenced by GetTypeId(), and HandleProbeRTT().
|
private |
True when it is time to exit BBR_PROBE_RTT.
Definition at line 365 of file tcp-bbr.h.
Referenced by CwndEvent(), and HandleProbeRTT().
|
private |
Count of packet-timed round trips.
Definition at line 359 of file tcp-bbr.h.
Referenced by InitRoundCounting(), UpdateBtlBw(), and UpdateRound().
|
private |
A boolean that BBR sets to true once per packet-timed round trip.
Definition at line 360 of file tcp-bbr.h.
Referenced by CheckFullPipe(), CongestionStateSet(), HandleProbeRTT(), InitRoundCounting(), UpdateAckAggregation(), and UpdateRound().
Estimated two-way round-trip propagation delay of the path, estimated from the windowed minimum recent round-trip delay sample.
Definition at line 372 of file tcp-bbr.h.
Referenced by CongestionStateSet(), InFlight(), IsNextCyclePhase(), and UpdateRTprop().
|
private |
A boolean recording whether the BBR.RTprop has expired.
Definition at line 376 of file tcp-bbr.h.
Referenced by CheckProbeRTT(), and UpdateRTprop().
A constant specifying the length of the RTProp min filter window, default 10 secs.
Definition at line 377 of file tcp-bbr.h.
Referenced by GetTypeId(), and UpdateRTprop().
The wall clock time at which the current BBR.RTProp sample was obtained.
Definition at line 378 of file tcp-bbr.h.
Referenced by CongestionStateSet(), CwndEvent(), HandleProbeRTT(), and UpdateRTprop().
|
private |
The maximum size of a data aggregate scheduled and transmitted together.
Definition at line 373 of file tcp-bbr.h.
Referenced by CongestionStateSet(), InFlight(), and SetSendQuantum().
|
private |
Current state of BBR state machine.
Definition at line 351 of file tcp-bbr.h.
Referenced by CheckCyclePhase(), CheckDrain(), CheckProbeRTT(), CwndEvent(), GetBbrState(), HandleRestartFromIdle(), InFlight(), ModulateCwndForProbeRTT(), SaveCwnd(), and SetBbrState().
|
private |
Target value for congestion window, adapted to the estimated BDP.
Definition at line 369 of file tcp-bbr.h.
Referenced by CongestionStateSet(), SetCwnd(), and UpdateTargetCwnd().
|
private |
The number of bytes already delivered at the time of new packet transmission.
Definition at line 383 of file tcp-bbr.h.
Referenced by CongControl().
|
private |
Uniform Random Variable.
Definition at line 380 of file tcp-bbr.h.
Referenced by TcpBbr(), EnterProbeBW(), and SetStream().
|
static |
BBR uses an eight-phase cycle with the given pacing_gain value in the BBR ProbeBW gain cycle.
Definition at line 56 of file tcp-bbr.h.
Referenced by AdvanceCyclePhase().