A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::TcpWestwood Class Reference

An implementation of a stream socket using TCP. More...

#include <tcp-westwood.h>

+ Inheritance diagram for ns3::TcpWestwood:
+ Collaboration diagram for ns3::TcpWestwood:

Public Types

enum  FilterType { NONE, TUSTIN }
enum  ProtocolType { WESTWOOD, WESTWOODPLUS }

Public Member Functions

 TcpWestwood (void)
 TcpWestwood (const TcpWestwood &sock)
virtual ~TcpWestwood (void)
virtual int Connect (const Address &address)
virtual int Listen (void)
- Public Member Functions inherited from ns3::TcpSocketBase
 TcpSocketBase (void)
 TcpSocketBase (const TcpSocketBase &sock)
virtual ~TcpSocketBase (void)
virtual int Bind (void)
virtual int Bind (const Address &address)
virtual int Bind6 (void)
 Allocate a local IPv6 endpoint for this socket.
virtual void BindToNetDevice (Ptr< NetDevice > netdevice)
virtual int Close (void)
virtual enum SocketErrno GetErrno (void) const
virtual Ptr< NodeGetNode (void) const
virtual uint32_t GetRxAvailable (void) const
virtual enum SocketType GetSocketType (void) const
virtual int GetSockName (Address &address) const
virtual uint32_t GetTxAvailable (void) const
virtual Ptr< PacketRecv (uint32_t maxSize, uint32_t flags)
virtual Ptr< PacketRecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress)
virtual int Send (Ptr< Packet > p, uint32_t flags)
virtual int SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress)
virtual void SetNode (Ptr< Node > node)
virtual void SetRtt (Ptr< RttEstimator > rtt)
virtual void SetTcp (Ptr< TcpL4Protocol > tcp)
virtual int ShutdownRecv (void)
virtual int ShutdownSend (void)
- Public Member Functions inherited from ns3::TcpSocket
 TcpSocket (void)
virtual ~TcpSocket (void)
- Public Member Functions inherited from ns3::Socket
 Socket (void)
virtual ~Socket (void)
Ptr< NetDeviceGetBoundNetDevice ()
 Returns socket's bound netdevice, if any.
uint8_t GetIpTos (void) const
virtual uint8_t GetIpTtl (void) const
virtual uint8_t GetIpv6HopLimit (void) const
uint8_t GetIpv6Tclass (void) const
bool IsIpRecvTos (void) const
 Ask if the socket is currently passing information about IP Type of Service up the stack.
bool IsIpRecvTtl (void) const
 Ask if the socket is currently passing information about IP_TTL up the stack.
bool IsIpv6RecvHopLimit (void) const
 Ask if the socket is currently passing information about IPv6 Hop Limit up the stack.
bool IsIpv6RecvTclass (void) const
 Ask if the socket is currently passing information about IPv6 Traffic Class up the stack.
bool IsRecvPktInfo () const
 Get status indicating whether enable/disable packet information to socket.
Ptr< PacketRecv (void)
 Read a single packet from the socket.
int Recv (uint8_t *buf, uint32_t size, uint32_t flags)
 Recv data (or dummy data) from the remote host.
Ptr< PacketRecvFrom (Address &fromAddress)
 Read a single packet from the socket and retrieve the sender address.
int RecvFrom (uint8_t *buf, uint32_t size, uint32_t flags, Address &fromAddress)
 Read a single packet from the socket and retrieve the sender address.
int Send (Ptr< Packet > p)
 Send data (or dummy data) to the remote host.
int Send (const uint8_t *buf, uint32_t size, uint32_t flags)
 Send data (or dummy data) to the remote host.
int SendTo (const uint8_t *buf, uint32_t size, uint32_t flags, const Address &address)
 Send data to a specified peer.
void SetAcceptCallback (Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated)
 Accept connection requests from remote hosts.
void SetCloseCallbacks (Callback< void, Ptr< Socket > > normalClose, Callback< void, Ptr< Socket > > errorClose)
 Detect socket recv() events such as graceful shutdown or error.
void SetConnectCallback (Callback< void, Ptr< Socket > > connectionSucceeded, Callback< void, Ptr< Socket > > connectionFailed)
 Specify callbacks to allow the caller to determine if the connection succeeds of fails.
void SetDataSentCallback (Callback< void, Ptr< Socket >, uint32_t > dataSent)
 Notify application when a packet has been sent from transport protocol (non-standard socket call)
void SetIpRecvTos (bool ipv4RecvTos)
 Tells a socket to pass information about IP Type of Service up the stack.
void SetIpRecvTtl (bool ipv4RecvTtl)
 Tells a socket to pass information about IP_TTL up the stack.
void SetIpTos (uint8_t ipTos)
virtual void SetIpTtl (uint8_t ipTtl)
virtual void SetIpv6HopLimit (uint8_t ipHopLimit)
void SetIpv6RecvHopLimit (bool ipv6RecvHopLimit)
 Tells a socket to pass information about IPv6 Hop Limit up the stack.
void SetIpv6RecvTclass (bool ipv6RecvTclass)
 Tells a socket to pass information about IPv6 Traffic Class up the stack.
void SetIpv6Tclass (int ipTclass)
void SetRecvCallback (Callback< void, Ptr< Socket > >)
 Notify application when new data is available to be read.
void SetRecvPktInfo (bool flag)
 Enable/Disable receive packet information to socket.
void SetSendCallback (Callback< void, Ptr< Socket >, uint32_t > sendCb)
 Notify application when space in transmit buffer is added.
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
AggregateIterator GetAggregateIterator (void) const
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Initialize (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId (void)

Protected Member Functions

virtual void DupAck (const TcpHeader &header, uint32_t count)
virtual void EstimateRtt (const TcpHeader &header)
virtual Ptr< TcpSocketBaseFork (void)
virtual uint32_t GetInitialCwnd (void) const
virtual uint32_t GetSSThresh (void) const
virtual void NewAck (SequenceNumber32 const &seq)
virtual void ReceivedAck (Ptr< Packet > packet, const TcpHeader &tcpHeader)
virtual void Retransmit (void)
virtual void SetInitialCwnd (uint32_t cwnd)
virtual void SetSegSize (uint32_t size)
virtual void SetSSThresh (uint32_t threshold)
virtual uint32_t Window (void)
- Protected Member Functions inherited from ns3::TcpSocketBase
virtual void AddOptions (TcpHeader &)
virtual uint16_t AdvertisedWindowSize (void)
virtual uint32_t AvailableWindow (void)
virtual uint32_t BytesInFlight (void)
void CancelAllTimers (void)
void CloseAndNotify (void)
void CompleteFork (Ptr< Packet >, const TcpHeader &, const Address &fromAddress, const Address &toAdress)
void ConnectionSucceeded (void)
void DeallocateEndPoint (void)
virtual void DelAckTimeout (void)
void Destroy (void)
void Destroy6 (void)
int DoClose (void)
int DoConnect (void)
virtual void DoForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface)
virtual void DoForwardUp (Ptr< Packet > packet, Ipv6Header header, uint16_t port)
void DoPeerClose (void)
virtual void DoRetransmit (void)
void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
void ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
void ForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface)
void ForwardUp6 (Ptr< Packet > packet, Ipv6Header header, uint16_t port)
virtual bool GetAllowBroadcast (void) const
 Query whether broadcast datagram transmissions are allowed.
virtual uint32_t GetConnCount (void) const
virtual Time GetConnTimeout (void) const
virtual uint32_t GetDelAckMaxCount (void) const
virtual Time GetDelAckTimeout (void) const
virtual Time GetPersistTimeout (void) const
virtual uint32_t GetRcvBufSize (void) const
virtual uint32_t GetSegSize (void) const
virtual uint32_t GetSndBufSize (void) const
virtual bool GetTcpNoDelay (void) const
virtual void LastAckTimeout (void)
bool OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const
void PeerClose (Ptr< Packet >, const TcpHeader &)
virtual void PersistTimeout (void)
void ProcessClosing (Ptr< Packet >, const TcpHeader &)
void ProcessEstablished (Ptr< Packet >, const TcpHeader &)
void ProcessLastAck (Ptr< Packet >, const TcpHeader &)
void ProcessListen (Ptr< Packet >, const TcpHeader &, const Address &, const Address &)
void ProcessSynRcvd (Ptr< Packet >, const TcpHeader &, const Address &, const Address &)
void ProcessSynSent (Ptr< Packet >, const TcpHeader &)
void ProcessWait (Ptr< Packet >, const TcpHeader &)
virtual void ReadOptions (const TcpHeader &)
virtual void ReceivedData (Ptr< Packet >, const TcpHeader &)
virtual void ReTxTimeout (void)
uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck)
void SendEmptyPacket (uint8_t flags)
bool SendPendingData (bool withAck=false)
void SendRST (void)
virtual bool SetAllowBroadcast (bool allowBroadcast)
 Configure whether broadcast datagram transmissions are allowed.
virtual void SetConnCount (uint32_t count)
virtual void SetConnTimeout (Time timeout)
virtual void SetDelAckMaxCount (uint32_t count)
virtual void SetDelAckTimeout (Time timeout)
virtual void SetPersistTimeout (Time timeout)
virtual void SetRcvBufSize (uint32_t size)
virtual void SetSndBufSize (uint32_t size)
virtual void SetTcpNoDelay (bool noDelay)
int SetupCallback (void)
int SetupEndpoint (void)
int SetupEndpoint6 (void)
void TimeWait (void)
virtual uint32_t UnAckDataCount (void)

Protected Attributes

int m_accountedFor
int m_ackedSegments
EventId m_bwEstimateEvent
TracedValue< double > m_currentBW
TracedValue< uint32_t > m_cWnd
enum FilterType m_fType
bool m_inFastRec
uint32_t m_initialCWnd
bool m_IsCount
double m_lastAck
double m_lastBW
double m_lastSampleBW
Time m_minRtt
SequenceNumber32 m_prevAckNo
enum ProtocolType m_pType
uint32_t m_ssThresh
- Protected Attributes inherited from ns3::TcpSocketBase
bool m_closeNotified
bool m_closeOnEmpty
uint32_t m_cnCount
uint32_t m_cnRetries
Time m_cnTimeout
bool m_connected
uint32_t m_delAckCount
EventId m_delAckEvent
uint32_t m_delAckMaxCount
Time m_delAckTimeout
uint32_t m_dupAckCount
Ipv4EndPointm_endPoint
Ipv6EndPointm_endPoint6
enum SocketErrno m_errno
TracedValue< SequenceNumber32m_highTxMark
Callback< void, Ipv4Address,
uint8_t, uint8_t, uint8_t,
uint32_t > 
m_icmpCallback
Callback< void, Ipv6Address,
uint8_t, uint8_t, uint8_t,
uint32_t > 
m_icmpCallback6
EventId m_lastAckEvent
TracedValue< Timem_lastRtt
uint16_t m_maxWinSize
double m_msl
TracedValue< SequenceNumber32m_nextTxSequence
Ptr< Nodem_node
bool m_noDelay
EventId m_persistEvent
Time m_persistTimeout
EventId m_retxEvent
TracedValue< Timem_rto
Ptr< RttEstimatorm_rtt
TracedValue< uint32_t > m_rWnd
TcpRxBuffer m_rxBuffer
uint32_t m_segmentSize
bool m_shutdownRecv
bool m_shutdownSend
TracedValue< TcpStates_tm_state
Ptr< TcpL4Protocolm_tcp
EventId m_timewaitEvent
TcpTxBuffer m_txBuffer

Private Member Functions

int CountAck (const TcpHeader &tcpHeader)
void EstimateBW (int acked, const TcpHeader &tcpHeader, Time rtt)
void Filtering (void)
void InitializeCwnd (void)
void UpdateAckedSegments (int acked)

Additional Inherited Members

- Static Public Attributes inherited from ns3::TcpSocket
static const char *const TcpStateName [LAST_STATE] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "LAST_ACK", "FIN_WAIT_1", "FIN_WAIT_2", "CLOSING", "TIME_WAIT" }

Detailed Description

An implementation of a stream socket using TCP.

This class contains the implementation of TCP Westwood and Westwood+.

Westwood and Westwood+ employ the AIAD (Additive Increase/Adaptive Decrease) congestion control paradigm. When a congestion episode happens, instead of halving the cwnd, these protocols try to estimate the network's bandwidth and use the estimated value to adjust the cwnd. While Westwood performs the bandwidth sampling every ACK reception, Westwood+ samples the bandwidth every RTT.

The two main methods in the implementation are the CountAck (const TCPHeader&) and the EstimateBW (int, const, Time). The CountAck method calculates the number of acknowledged segments on the receipt of an ACK. The EstimateBW estimates the bandwidth based on the value returned by CountAck and the sampling interval (last ACK inter-arrival time for Westwood and last RTT for Westwood+).

Config Paths

ns3::TcpWestwood is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::TcpL4Protocol/SocketList/[i]/$ns3::TcpWestwood

Attributes

  • FilterType: Use this to choose no filter or Tustin's approximation filter
    • Set with class: ns3::EnumValue
    • Underlying type: None|Tustin
    • Initial value: Tustin
    • Flags: construct write read
  • ProtocolType: Use this to let the code run as Westwood or WestwoodPlus
    • Set with class: ns3::EnumValue
    • Underlying type: Westwood|WestwoodPlus
    • Initial value: Westwood
    • Flags: construct write read

Attributes defined in parent class ns3::TcpSocketBase

  • MaxSegLifetime: Maximum segment lifetime in seconds, use for TIME_WAIT state transition to CLOSED state
    • Set with class: ns3::DoubleValue
    • Underlying type: double 0:1.79769e+308
    • Initial value: 120
    • Flags: construct write read
  • MaxWindowSize: Max size of advertised window
  • IcmpCallback: Callback invoked whenever an icmp error is received on this socket.
  • IcmpCallback6: Callback invoked whenever an icmpv6 error is received on this socket.

Attributes defined in parent class ns3::TcpSocket

  • SndBufSize: TcpSocket maximum transmit buffer size (bytes)
  • RcvBufSize: TcpSocket maximum receive buffer size (bytes)
  • SegmentSize: TCP maximum segment size in bytes (may be adjusted based on MTU discovery)
  • SlowStartThreshold: TCP slow start threshold (bytes)
  • InitialCwnd: TCP initial congestion window size (segments)
  • ConnTimeout: TCP retransmission timeout when opening connection (seconds)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +3000000000.0ns
    • Flags: construct write read
  • ConnCount: Number of connection attempts (SYN retransmissions) before returning failure
  • DelAckTimeout: Timeout value for TCP delayed acks, in seconds
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +200000000.0ns
    • Flags: construct write read
  • DelAckCount: Number of packets to wait before sending a TCP ack
  • TcpNoDelay: Set to true to disable Nagle's algorithm
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • PersistTimeout: Persist timeout to probe for rx window
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +6000000000.0ns
    • Flags: construct write read

TraceSources

  • CongestionWindow: The TCP connection's congestion window
  • EstimatedBW: The estimated bandwidth

TraceSources defined in parent class ns3::TcpSocketBase

  • RTO: Retransmission timeout
  • RTT: Last RTT sample
  • NextTxSequence: Next sequence number to send (SND.NXT)
  • HighestSequence: Highest sequence number ever sent in socket's life time
  • State: TCP state
  • RWND: Remote side's flow control window

Definition at line 62 of file tcp-westwood.h.

Member Enumeration Documentation

Enumerator:
NONE 
TUSTIN 

Definition at line 77 of file tcp-westwood.h.

Enumerator:
WESTWOOD 
WESTWOODPLUS 

Definition at line 71 of file tcp-westwood.h.

Constructor & Destructor Documentation

ns3::TcpWestwood::TcpWestwood ( void  )

Definition at line 71 of file tcp-westwood.cc.

References NS_LOG_FUNCTION.

ns3::TcpWestwood::TcpWestwood ( const TcpWestwood sock)

Definition at line 86 of file tcp-westwood.cc.

References m_minRtt, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.

ns3::TcpWestwood::~TcpWestwood ( void  )
virtual

Definition at line 108 of file tcp-westwood.cc.

Member Function Documentation

int ns3::TcpWestwood::Connect ( const Address address)
virtual

Inherit from Socket class: Initiate connection to a remote address:port

Reimplemented from ns3::TcpSocketBase.

Definition at line 121 of file tcp-westwood.cc.

References InitializeCwnd(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

int ns3::TcpWestwood::CountAck ( const TcpHeader tcpHeader)
private

Calculate the number of acknowledged packets upon the receipt of an ACK packet

Parameters
tcpHeaderthe header of the received ACK packet
Returns
the number of ACKed packets

Definition at line 228 of file tcp-westwood.cc.

References ns3::TcpHeader::GetAckNumber(), m_accountedFor, m_prevAckNo, ns3::TcpSocketBase::m_segmentSize, and NS_LOG_FUNCTION.

Referenced by ReceivedAck().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpWestwood::DupAck ( const TcpHeader header,
uint32_t  count 
)
protectedvirtual

Adjust the cwnd using the currently estimated bandwidth, retransmit the missing packet, and enter fast recovery if 3 DUPACKs are received

Parameters
headerthe TCP header of the ACK packet
countthe number of DUPACKs

Implements ns3::TcpSocketBase.

Definition at line 268 of file tcp-westwood.cc.

References ns3::TcpSocketBase::DoRetransmit(), ns3::Time::GetSeconds(), ns3::TcpSocketBase::m_connected, m_currentBW, m_cWnd, m_inFastRec, m_minRtt, ns3::TcpSocketBase::m_segmentSize, m_ssThresh, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpSocketBase::SendPendingData().

+ Here is the call graph for this function:

void ns3::TcpWestwood::EstimateBW ( int  acked,
const TcpHeader tcpHeader,
Time  rtt 
)
private

Estimate the network's bandwidth

Parameters
ackedthe number of acknowledged packets returned by CountAck
tcpHeaderthe header of the packet
rttthe RTT estimation

Definition at line 202 of file tcp-westwood.cc.

References Filtering(), ns3::Time::GetSeconds(), m_ackedSegments, m_currentBW, m_IsCount, m_lastAck, m_pType, ns3::TcpSocketBase::m_segmentSize, ns3::Now(), NS_LOG_FUNCTION, WESTWOOD, and WESTWOODPLUS.

Referenced by EstimateRtt(), and ReceivedAck().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpWestwood::EstimateRtt ( const TcpHeader header)
protectedvirtual

Estimate the RTT, record the minimum value, and run a clock on the RTT to trigger Westwood+ bandwidth sampling

Reimplemented from ns3::TcpSocketBase.

Definition at line 323 of file tcp-westwood.cc.

References ns3::EventId::Cancel(), ns3::ESTABLISHED, EstimateBW(), m_ackedSegments, m_bwEstimateEvent, m_IsCount, ns3::TcpSocketBase::m_lastRtt, m_minRtt, m_pType, ns3::TcpSocketBase::m_state, NS_LOG_FUNCTION_NOARGS, ns3::Simulator::Schedule(), and WESTWOODPLUS.

+ Here is the call graph for this function:

void ns3::TcpWestwood::Filtering ( void  )
private

Tustin filter

Definition at line 357 of file tcp-westwood.cc.

References m_currentBW, m_fType, m_lastBW, m_lastSampleBW, NONE, NS_LOG_FUNCTION, and TUSTIN.

Referenced by EstimateBW().

+ Here is the caller graph for this function:

Ptr< TcpSocketBase > ns3::TcpWestwood::Fork ( void  )
protectedvirtual

Call CopyObject<TcpWestwood> to clone me

Implements ns3::TcpSocketBase.

Definition at line 136 of file tcp-westwood.cc.

References NS_LOG_FUNCTION.

uint32_t ns3::TcpWestwood::GetInitialCwnd ( void  ) const
protectedvirtual
Returns
the initial cwnd

Implements ns3::TcpSocketBase.

Definition at line 404 of file tcp-westwood.cc.

References m_initialCWnd, and NS_LOG_FUNCTION.

uint32_t ns3::TcpWestwood::GetSSThresh ( void  ) const
protectedvirtual
Returns
the slow-start threshold

Implements ns3::TcpSocketBase.

Definition at line 390 of file tcp-westwood.cc.

References m_ssThresh, and NS_LOG_FUNCTION.

TypeId ns3::TcpWestwood::GetTypeId ( void  )
static

Reimplemented from ns3::TcpSocketBase.

Definition at line 52 of file tcp-westwood.cc.

References m_currentBW, m_cWnd, m_fType, m_pType, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeTraceSourceAccessor(), NONE, ns3::TypeId::SetParent(), TUSTIN, WESTWOOD, and WESTWOODPLUS.

+ Here is the call graph for this function:

void ns3::TcpWestwood::InitializeCwnd ( void  )
private

Initialize cwnd at the beginning of a connection

Definition at line 411 of file tcp-westwood.cc.

References m_cWnd, m_initialCWnd, ns3::TcpSocketBase::m_segmentSize, and NS_LOG_FUNCTION.

Referenced by Connect(), and Listen().

+ Here is the caller graph for this function:

int ns3::TcpWestwood::Listen ( void  )
virtual

Inherit from Socket class: Listen on the endpoint for an incoming connection

Reimplemented from ns3::TcpSocketBase.

Definition at line 113 of file tcp-westwood.cc.

References InitializeCwnd(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::TcpWestwood::NewAck ( SequenceNumber32 const &  seq)
protectedvirtual

Adjust the cwnd based on the current congestion control phase, and then call the TcpSocketBase::NewAck() to complete the processing

Parameters
seqthe acknowledgment number

Reimplemented from ns3::TcpSocketBase.

Definition at line 143 of file tcp-westwood.cc.

References ns3::TracedValue< T >::Get(), m_cWnd, m_inFastRec, ns3::TcpSocketBase::m_segmentSize, m_ssThresh, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

void ns3::TcpWestwood::ReceivedAck ( Ptr< Packet packet,
const TcpHeader tcpHeader 
)
protectedvirtual

Process the newly received ACK

Parameters
packetthe received ACK packet
tcpHeaderthe header attached to the ACK packet

Reimplemented from ns3::TcpSocketBase.

Definition at line 177 of file tcp-westwood.cc.

References ns3::TcpHeader::ACK, CountAck(), EstimateBW(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), m_IsCount, m_prevAckNo, m_pType, NS_LOG_FUNCTION, UpdateAckedSegments(), WESTWOOD, and WESTWOODPLUS.

+ Here is the call graph for this function:

void ns3::TcpWestwood::Retransmit ( void  )
protectedvirtual
void ns3::TcpWestwood::SetInitialCwnd ( uint32_t  cwnd)
protectedvirtual
Parameters
cwndthe initial cwnd

Implements ns3::TcpSocketBase.

Definition at line 397 of file tcp-westwood.cc.

References ns3::CLOSED, m_initialCWnd, ns3::TcpSocketBase::m_state, and NS_ABORT_MSG_UNLESS.

void ns3::TcpWestwood::SetSegSize ( uint32_t  size)
protectedvirtual
Parameters
sizethe segment size to be used in a connection

Reimplemented from ns3::TcpSocketBase.

Definition at line 376 of file tcp-westwood.cc.

References ns3::CLOSED, ns3::TcpSocketBase::m_segmentSize, ns3::TcpSocketBase::m_state, and NS_ABORT_MSG_UNLESS.

void ns3::TcpWestwood::SetSSThresh ( uint32_t  threshold)
protectedvirtual
Parameters
theslow-start threshold

Implements ns3::TcpSocketBase.

Definition at line 383 of file tcp-westwood.cc.

References m_ssThresh, and NS_LOG_FUNCTION.

void ns3::TcpWestwood::UpdateAckedSegments ( int  acked)
private

Update the total number of acknowledged packets during the current RTT

Parameters
ackedthe number of packets the currently received ACK acknowledges

Definition at line 262 of file tcp-westwood.cc.

References m_ackedSegments.

Referenced by ReceivedAck().

+ Here is the caller graph for this function:

uint32_t ns3::TcpWestwood::Window ( void  )
protectedvirtual

Limit the size of outstanding data based on the cwnd and the receiver's advertised window

Returns
the max. possible number of unacked bytes

Reimplemented from ns3::TcpSocketBase.

Definition at line 129 of file tcp-westwood.cc.

References ns3::TracedValue< T >::Get(), m_cWnd, ns3::TcpSocketBase::m_rWnd, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Data Documentation

int ns3::TcpWestwood::m_accountedFor
protected

Definition at line 210 of file tcp-westwood.h.

Referenced by CountAck().

int ns3::TcpWestwood::m_ackedSegments
protected

Definition at line 214 of file tcp-westwood.h.

Referenced by EstimateBW(), EstimateRtt(), and UpdateAckedSegments().

EventId ns3::TcpWestwood::m_bwEstimateEvent
protected

Definition at line 216 of file tcp-westwood.h.

Referenced by EstimateRtt().

TracedValue<double> ns3::TcpWestwood::m_currentBW
protected

Definition at line 204 of file tcp-westwood.h.

Referenced by DupAck(), EstimateBW(), Filtering(), GetTypeId(), and Retransmit().

TracedValue<uint32_t> ns3::TcpWestwood::m_cWnd
protected

Definition at line 199 of file tcp-westwood.h.

Referenced by DupAck(), GetTypeId(), InitializeCwnd(), NewAck(), Retransmit(), and Window().

enum FilterType ns3::TcpWestwood::m_fType
protected

Definition at line 212 of file tcp-westwood.h.

Referenced by Filtering(), and GetTypeId().

bool ns3::TcpWestwood::m_inFastRec
protected

Definition at line 202 of file tcp-westwood.h.

Referenced by DupAck(), NewAck(), and Retransmit().

uint32_t ns3::TcpWestwood::m_initialCWnd
protected

Definition at line 201 of file tcp-westwood.h.

Referenced by GetInitialCwnd(), InitializeCwnd(), and SetInitialCwnd().

bool ns3::TcpWestwood::m_IsCount
protected

Definition at line 215 of file tcp-westwood.h.

Referenced by EstimateBW(), EstimateRtt(), and ReceivedAck().

double ns3::TcpWestwood::m_lastAck
protected

Definition at line 208 of file tcp-westwood.h.

Referenced by EstimateBW().

double ns3::TcpWestwood::m_lastBW
protected

Definition at line 206 of file tcp-westwood.h.

Referenced by Filtering().

double ns3::TcpWestwood::m_lastSampleBW
protected

Definition at line 205 of file tcp-westwood.h.

Referenced by Filtering().

Time ns3::TcpWestwood::m_minRtt
protected

Definition at line 207 of file tcp-westwood.h.

Referenced by DupAck(), EstimateRtt(), Retransmit(), and TcpWestwood().

SequenceNumber32 ns3::TcpWestwood::m_prevAckNo
protected

Definition at line 209 of file tcp-westwood.h.

Referenced by CountAck(), and ReceivedAck().

enum ProtocolType ns3::TcpWestwood::m_pType
protected

Definition at line 211 of file tcp-westwood.h.

Referenced by EstimateBW(), EstimateRtt(), GetTypeId(), and ReceivedAck().

uint32_t ns3::TcpWestwood::m_ssThresh
protected

Definition at line 200 of file tcp-westwood.h.

Referenced by DupAck(), GetSSThresh(), NewAck(), Retransmit(), and SetSSThresh().


The documentation for this class was generated from the following files: