A Discrete-Event Network Simulator
API
ns3::TcpSocketBase Class Reference

A base class for implementation of a stream socket using TCP. More...

#include "tcp-socket-base.h"

+ Inheritance diagram for ns3::TcpSocketBase:
+ Collaboration diagram for ns3::TcpSocketBase:

Public Types

typedef void(* TcpTxRxTracedCallback) (const Ptr< const Packet > packet, const TcpHeader &header, const Ptr< const TcpSocketBase > socket)
 TracedCallback signature for tcp packet transmission or reception events. More...
 
- Public Types inherited from ns3::TcpSocket
enum  TcpStates_t {
  CLOSED = 0 , LISTEN , SYN_SENT , SYN_RCVD ,
  ESTABLISHED , CLOSE_WAIT , LAST_ACK , FIN_WAIT_1 ,
  FIN_WAIT_2 , CLOSING , TIME_WAIT , LAST_STATE
}
 Names of the 11 TCP states. More...
 
- Public Types inherited from ns3::Socket
enum  Ipv6MulticastFilterMode { INCLUDE = 1 , EXCLUDE }
 Enumeration of the possible filter of a socket. More...
 
enum  SocketErrno {
  ERROR_NOTERROR , ERROR_ISCONN , ERROR_NOTCONN , ERROR_MSGSIZE ,
  ERROR_AGAIN , ERROR_SHUTDOWN , ERROR_OPNOTSUPP , ERROR_AFNOSUPPORT ,
  ERROR_INVAL , ERROR_BADF , ERROR_NOROUTETOHOST , ERROR_NODEV ,
  ERROR_ADDRNOTAVAIL , ERROR_ADDRINUSE , SOCKET_ERRNO_LAST
}
 Enumeration of the possible errors returned by a socket. More...
 
enum  SocketPriority {
  NS3_PRIO_BESTEFFORT = 0 , NS3_PRIO_FILLER = 1 , NS3_PRIO_BULK = 2 , NS3_PRIO_INTERACTIVE_BULK = 4 ,
  NS3_PRIO_INTERACTIVE = 6 , NS3_PRIO_CONTROL = 7
}
 Enumeration of the possible socket priorities. More...
 
enum  SocketType { NS3_SOCK_STREAM , NS3_SOCK_SEQPACKET , NS3_SOCK_DGRAM , NS3_SOCK_RAW }
 Enumeration of the possible socket types. More...
 

Public Member Functions

 TcpSocketBase ()
 Create an unbound TCP socket. More...
 
 TcpSocketBase (const TcpSocketBase &sock)
 Clone a TCP socket, for use upon receiving a connection request in LISTEN state. More...
 
 ~TcpSocketBase () override
 
int Bind () override
 Allocate a local IPv4 endpoint for this socket. More...
 
int Bind (const Address &address) override
 Allocate a local endpoint for this socket. More...
 
int Bind6 () override
 Allocate a local IPv6 endpoint for this socket. More...
 
void BindToNetDevice (Ptr< NetDevice > netdevice) override
 Bind a socket to specific device. More...
 
bool CheckEcnCe (uint8_t tos) const
 Checks for CE codepoint. More...
 
bool CheckEcnEct0 (uint8_t tos) const
 Checks for ECT(0) codepoint. More...
 
bool CheckEcnEct1 (uint8_t tos) const
 Checks for ECT(1) codepoint. More...
 
bool CheckNoEcn (uint8_t tos) const
 Checks if TOS has no ECN codepoints. More...
 
uint8_t ClearEcnBits (uint8_t tos) const
 Clears ECN bits from TOS. More...
 
int Close () override
 Close a socket. More...
 
int Connect (const Address &address) override
 Initiate a connection to a remote host. More...
 
Time GetClockGranularity () const
 Get the Clock Granularity (used in RTO calcs). More...
 
SocketErrno GetErrno () const override
 Get last error number. More...
 
TypeId GetInstanceTypeId () const override
 Get the instance TypeId. More...
 
Time GetMinRto () const
 Get the Minimum RTO. More...
 
Ptr< NodeGetNode () const override
 Return the node this socket is associated with. More...
 
int GetPeerName (Address &address) const override
 Get the peer address of a connected socket. More...
 
uint32_t GetRetxThresh () const
 Get the retransmission threshold (dup ack threshold for a fast retransmit) More...
 
uint32_t GetRxAvailable () const override
 Return number of bytes which can be returned from one or multiple calls to Recv. More...
 
Ptr< TcpRxBufferGetRxBuffer () const
 Get a pointer to the Rx buffer. More...
 
SocketType GetSocketType () const override
 
int GetSockName (Address &address) const override
 Get socket address. More...
 
uint32_t GetTxAvailable () const override
 Returns the number of bytes which can be sent in a single call to Send. More...
 
Ptr< TcpTxBufferGetTxBuffer () const
 Get a pointer to the Tx buffer. More...
 
int Listen () override
 Listen for incoming connections. More...
 
uint8_t MarkEcnCe (uint8_t tos) const
 Mark CE codepoint. More...
 
uint8_t MarkEcnCodePoint (const uint8_t tos, const TcpSocketState::EcnCodePoint_t codePoint) const
 mark ECN code point More...
 
uint8_t MarkEcnEct0 (uint8_t tos) const
 Mark ECT(0) codepoint. More...
 
uint8_t MarkEcnEct1 (uint8_t tos) const
 Mark ECT(1) codepoint. More...
 
Ptr< PacketRecv (uint32_t maxSize, uint32_t flags) override
 Read data from the socket. More...
 
Ptr< PacketRecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress) override
 Read a single packet from the socket and retrieve the sender address. More...
 
int Send (Ptr< Packet > p, uint32_t flags) override
 Send data (or dummy data) to the remote host. More...
 
int SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress) override
 Send data to a specified peer. More...
 
void SetClockGranularity (Time clockGranularity)
 Sets the Clock Granularity (used in RTO calcs). More...
 
void SetCongestionControlAlgorithm (Ptr< TcpCongestionOps > algo)
 Install a congestion control algorithm on this socket. More...
 
void SetMinRto (Time minRto)
 Sets the Minimum RTO. More...
 
virtual void SetNode (Ptr< Node > node)
 Set the associated node. More...
 
void SetPaceInitialWindow (bool paceWindow)
 Enable or disable pacing of the initial window. More...
 
void SetPacingStatus (bool pacing)
 Enable or disable pacing. More...
 
void SetRecoveryAlgorithm (Ptr< TcpRecoveryOps > recovery)
 Install a recovery algorithm on this socket. More...
 
void SetRetxThresh (uint32_t retxThresh)
 Set the retransmission threshold (dup ack threshold for a fast retransmit) More...
 
virtual void SetRtt (Ptr< RttEstimator > rtt)
 Set the associated RTT estimator. More...
 
virtual void SetTcp (Ptr< TcpL4Protocol > tcp)
 Set the associated TCP L4 protocol. More...
 
void SetUseEcn (TcpSocketState::UseEcn_t useEcn)
 Set ECN mode of use on the socket. More...
 
int ShutdownRecv () override
 
int ShutdownSend () override
 
void UpdateBytesInFlight (uint32_t oldValue, uint32_t newValue) const
 Callback function to hook to TcpSocketState bytes inflight. More...
 
void UpdateCongState (TcpSocketState::TcpCongState_t oldValue, TcpSocketState::TcpCongState_t newValue) const
 Callback function to hook to TcpSocketState congestion state. More...
 
void UpdateCwnd (uint32_t oldValue, uint32_t newValue) const
 Callback function to hook to TcpSocketState congestion window. More...
 
void UpdateCwndInfl (uint32_t oldValue, uint32_t newValue) const
 Callback function to hook to TcpSocketState inflated congestion window. More...
 
void UpdateEcnState (TcpSocketState::EcnState_t oldValue, TcpSocketState::EcnState_t newValue) const
 Callback function to hook to EcnState state. More...
 
void UpdateHighTxMark (SequenceNumber32 oldValue, SequenceNumber32 newValue) const
 Callback function to hook to TcpSocketState high tx mark. More...
 
void UpdateNextTxSequence (SequenceNumber32 oldValue, SequenceNumber32 newValue) const
 Callback function to hook to TcpSocketState next tx sequence. More...
 
void UpdatePacingRateTrace (DataRate oldValue, DataRate newValue) const
 Callback function to hook to TcpSocketState pacing rate. More...
 
void UpdateRtt (Time oldValue, Time newValue) const
 Callback function to hook to TcpSocketState rtt. More...
 
void UpdateSsThresh (uint32_t oldValue, uint32_t newValue) const
 Callback function to hook to TcpSocketState slow start threshold. More...
 
- Public Member Functions inherited from ns3::TcpSocket
 TcpSocket ()
 
 ~TcpSocket () override
 
- Public Member Functions inherited from ns3::Socket
 Socket ()
 
 ~Socket () override
 
Ptr< NetDeviceGetBoundNetDevice ()
 Returns socket's bound NetDevice, if any. More...
 
uint8_t GetIpTos () const
 Query the value of IP Type of Service of this socket. More...
 
virtual uint8_t GetIpTtl () const
 Query the value of IP Time to Live field of this socket. More...
 
virtual uint8_t GetIpv6HopLimit () const
 Query the value of IP Hop Limit field of this socket. More...
 
uint8_t GetIpv6Tclass () const
 Query the value of IPv6 Traffic Class field of this socket. More...
 
uint8_t GetPriority () const
 Query the priority value of this socket. More...
 
virtual void Ipv6JoinGroup (Ipv6Address address)
 Joins a IPv6 multicast group without filters. More...
 
virtual void Ipv6JoinGroup (Ipv6Address address, Ipv6MulticastFilterMode filterMode, std::vector< Ipv6Address > sourceAddresses)
 Joins a IPv6 multicast group. More...
 
virtual void Ipv6LeaveGroup ()
 Leaves IPv6 multicast group this socket is joined to. More...
 
bool IsIpRecvTos () const
 Ask if the socket is currently passing information about IP Type of Service up the stack. More...
 
bool IsIpRecvTtl () const
 Ask if the socket is currently passing information about IP_TTL up the stack. More...
 
bool IsIpv6RecvHopLimit () const
 Ask if the socket is currently passing information about IPv6 Hop Limit up the stack. More...
 
bool IsIpv6RecvTclass () const
 Ask if the socket is currently passing information about IPv6 Traffic Class up the stack. More...
 
bool IsRecvPktInfo () const
 Get status indicating whether enable/disable packet information to socket. More...
 
Ptr< PacketRecv ()
 Read a single packet from the socket. More...
 
int Recv (uint8_t *buf, uint32_t size, uint32_t flags)
 Recv data (or dummy data) from the remote host. More...
 
Ptr< PacketRecvFrom (Address &fromAddress)
 Read a single packet from the socket and retrieve the sender address. More...
 
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. More...
 
int Send (const uint8_t *buf, uint32_t size, uint32_t flags)
 Send data (or dummy data) to the remote host. More...
 
int Send (Ptr< Packet > p)
 Send data (or dummy data) to the remote host. More...
 
int SendTo (const uint8_t *buf, uint32_t size, uint32_t flags, const Address &address)
 Send data to a specified peer. More...
 
void SetAcceptCallback (Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated)
 Accept connection requests from remote hosts. More...
 
void SetCloseCallbacks (Callback< void, Ptr< Socket >> normalClose, Callback< void, Ptr< Socket >> errorClose)
 Detect socket recv() events such as graceful shutdown or error. More...
 
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. More...
 
void SetDataSentCallback (Callback< void, Ptr< Socket >, uint32_t > dataSent)
 Notify application when a packet has been sent from transport protocol (non-standard socket call) More...
 
void SetIpRecvTos (bool ipv4RecvTos)
 Tells a socket to pass information about IP Type of Service up the stack. More...
 
void SetIpRecvTtl (bool ipv4RecvTtl)
 Tells a socket to pass information about IP_TTL up the stack. More...
 
void SetIpTos (uint8_t ipTos)
 Manually set IP Type of Service field. More...
 
virtual void SetIpTtl (uint8_t ipTtl)
 Manually set IP Time to Live field. More...
 
virtual void SetIpv6HopLimit (uint8_t ipHopLimit)
 Manually set IPv6 Hop Limit. More...
 
void SetIpv6RecvHopLimit (bool ipv6RecvHopLimit)
 Tells a socket to pass information about IPv6 Hop Limit up the stack. More...
 
void SetIpv6RecvTclass (bool ipv6RecvTclass)
 Tells a socket to pass information about IPv6 Traffic Class up the stack. More...
 
void SetIpv6Tclass (int ipTclass)
 Manually set IPv6 Traffic Class field. More...
 
void SetPriority (uint8_t priority)
 Manually set the socket priority. More...
 
void SetRecvCallback (Callback< void, Ptr< Socket >> receivedData)
 Notify application when new data is available to be read. More...
 
void SetRecvPktInfo (bool flag)
 Enable/Disable receive packet information to socket. More...
 
void SetSendCallback (Callback< void, Ptr< Socket >, uint32_t > sendCb)
 Notify application when space in transmit buffer is added. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () 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< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () 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 () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () 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 errors. 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 ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::TcpSocket
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Socket
static Ptr< SocketCreateSocket (Ptr< Node > node, TypeId tid)
 This method wraps the creation of sockets that is performed on a given node by a SocketFactory specified by TypeId. More...
 
static TypeId GetTypeId ()
 Get the type ID. More...
 
static uint8_t IpTos2Priority (uint8_t ipTos)
 Return the priority corresponding to a given TOS value. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Public Attributes

TracedCallback< uint32_t, uint32_t > m_bytesInFlightTrace
 Callback pointer for bytesInFlight trace chaining. More...
 
TracedCallback< TcpSocketState::TcpCongState_t, TcpSocketState::TcpCongState_tm_congStateTrace
 Callback pointer for congestion state trace chaining. More...
 
TracedCallback< uint32_t, uint32_t > m_cWndInflTrace
 Callback pointer for cWndInfl trace chaining. More...
 
TracedCallback< uint32_t, uint32_t > m_cWndTrace
 Callback pointer for cWnd trace chaining. More...
 
TracedCallback< TcpSocketState::EcnState_t, TcpSocketState::EcnState_tm_ecnStateTrace
 Callback pointer for ECN state trace chaining. More...
 
TracedCallback< SequenceNumber32, SequenceNumber32m_highTxMarkTrace
 Callback pointer for high tx mark chaining. More...
 
TracedCallback< Time, Timem_lastRttTrace
 Callback pointer for RTT trace chaining. More...
 
TracedCallback< SequenceNumber32, SequenceNumber32m_nextTxSequenceTrace
 Callback pointer for next tx sequence chaining. More...
 
TracedCallback< DataRate, DataRatem_pacingRateTrace
 Callback pointer for pacing rate trace chaining. More...
 
TracedCallback< uint32_t, uint32_t > m_ssThTrace
 Callback pointer for ssTh trace chaining. More...
 

Protected Member Functions

void AddOptions (TcpHeader &tcpHeader)
 Add options to TcpHeader. More...
 
void AddOptionSack (TcpHeader &header)
 Add the SACK option to the header. More...
 
void AddOptionSackPermitted (TcpHeader &header)
 Add the SACK PERMITTED option to the header. More...
 
void AddOptionTimestamp (TcpHeader &header)
 Add the timestamp option to the header. More...
 
void AddOptionWScale (TcpHeader &header)
 Add the window scale option to the header. More...
 
void AddSocketTags (const Ptr< Packet > &p) const
 Add Tags for the Socket. More...
 
virtual uint16_t AdvertisedWindowSize (bool scale=true) const
 The amount of Rx window announced to the peer. More...
 
virtual uint32_t AvailableWindow () const
 Return unfilled portion of window. More...
 
virtual uint32_t BytesInFlight () const
 Return total bytes in flight. More...
 
uint8_t CalculateWScale () const
 Calculate window scale value based on receive buffer space. More...
 
void CancelAllTimers ()
 Cancel all timer when endpoint is deleted. More...
 
void CloseAndNotify ()
 Peacefully close the socket by notifying the upper layer and deallocate end point. More...
 
virtual void CompleteFork (Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
 Complete a connection by forking the socket. More...
 
void ConnectionSucceeded ()
 Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded() More...
 
void DeallocateEndPoint ()
 Deallocate m_endPoint and m_endPoint6. More...
 
virtual void DelAckTimeout ()
 Action upon delay ACK timeout, i.e. More...
 
void Destroy ()
 Kill this socket by zeroing its attributes (IPv4) More...
 
void Destroy6 ()
 Kill this socket by zeroing its attributes (IPv6) More...
 
int DoClose ()
 Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state. More...
 
int DoConnect ()
 Perform the real connection tasks: Send SYN if allowed, RST if invalid. More...
 
virtual void DoForwardUp (Ptr< Packet > packet, const Address &fromAddress, const Address &toAddress)
 Called by TcpSocketBase::ForwardUp{,6}(). More...
 
void DoPeerClose ()
 FIN is in sequence, notify app and respond with a FIN. More...
 
void DoRetransmit ()
 Retransmit the first segment marked as lost, without considering available window nor pacing. More...
 
void DupAck (uint32_t currentDelivered)
 Dupack management. More...
 
void EnterCwr (uint32_t currentDelivered)
 Enter CA_CWR state upon receipt of an ECN Echo. More...
 
void EnterRecovery (uint32_t currentDelivered)
 Enter the CA_RECOVERY, and retransmit the head. More...
 
virtual void EstimateRtt (const TcpHeader &tcpHeader)
 Take into account the packet for RTT estimation. More...
 
virtual Ptr< TcpSocketBaseFork ()
 Call CopyObject<> to clone me. More...
 
void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
 Called by the L3 protocol when it received an ICMP packet to pass on to TCP. More...
 
void ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
 Called by the L3 protocol when it received an ICMPv6 packet to pass on to TCP. More...
 
void ForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface)
 Called by the L3 protocol when it received a packet to pass on to TCP. More...
 
void ForwardUp6 (Ptr< Packet > packet, Ipv6Header header, uint16_t port, Ptr< Ipv6Interface > incomingInterface)
 Called by the L3 protocol when it received a packet to pass on to TCP. More...
 
bool GetAllowBroadcast () const override
 Query whether broadcast datagram transmissions are allowed. More...
 
Time GetConnTimeout () const override
 Get the connection timeout. More...
 
uint32_t GetDataRetries () const override
 Get the number of data transmission retries before giving up. More...
 
uint32_t GetDelAckMaxCount () const override
 Get the number of packet to fire an ACK before delay timeout. More...
 
Time GetDelAckTimeout () const override
 Get the time to delay an ACK. More...
 
SequenceNumber32 GetHighRxAck () const
 Get the current value of the receiver's highest (in-sequence) sequence number acked. More...
 
uint32_t GetInitialCwnd () const override
 Get the initial Congestion Window. More...
 
uint32_t GetInitialSSThresh () const override
 Get the initial Slow Start Threshold. More...
 
Time GetPersistTimeout () const override
 Get the timeout for persistent connection. More...
 
uint32_t GetRcvBufSize () const override
 Get the receive buffer size. More...
 
uint32_t GetRWnd () const
 Get the current value of the receiver's offered window (RCV.WND) More...
 
uint32_t GetSegSize () const override
 Get the segment size. More...
 
uint32_t GetSndBufSize () const override
 Get the send buffer size. More...
 
uint32_t GetSynRetries () const override
 Get the number of connection retries before giving up. More...
 
bool GetTcpNoDelay () const override
 Check if Nagle's algorithm is enabled or not. More...
 
bool IsPacingEnabled () const
 Return true if packets in the current window should be paced. More...
 
bool IsTcpOptionEnabled (uint8_t kind) const
 Return true if the specified option is enabled. More...
 
bool IsValidTcpSegment (const SequenceNumber32 seq, const uint32_t tcpHeaderSize, const uint32_t tcpPayloadSize)
 Checks whether the given TCP segment is valid or not. More...
 
virtual void LastAckTimeout ()
 Timeout at LAST_ACK, close the connection. More...
 
virtual void NewAck (const SequenceNumber32 &seq, bool resetRTO)
 Update buffers w.r.t. More...
 
void NotifyPacingPerformed ()
 Notify Pacing. More...
 
bool OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const
 Check if a sequence number range is within the rx window. More...
 
void PeerClose (Ptr< Packet > p, const TcpHeader &tcpHeader)
 Received a FIN from peer, notify rx buffer. More...
 
virtual void PersistTimeout ()
 Send 1 byte probe to get an updated window size. More...
 
virtual void ProcessAck (const SequenceNumber32 &ackNumber, bool scoreboardUpdated, uint32_t currentDelivered, const SequenceNumber32 &oldHeadSequence)
 Process a received ack. More...
 
void ProcessClosing (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received a packet upon CLOSING. More...
 
void ProcessEstablished (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received a packet upon ESTABLISHED state. More...
 
void ProcessLastAck (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received a packet upon LAST_ACK. More...
 
void ProcessListen (Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
 Received a packet upon LISTEN state. More...
 
uint32_t ProcessOptionSack (const Ptr< const TcpOption > option)
 Read the SACK option. More...
 
void ProcessOptionSackPermitted (const Ptr< const TcpOption > option)
 Read the SACK PERMITTED option. More...
 
void ProcessOptionTimestamp (const Ptr< const TcpOption > option, const SequenceNumber32 &seq)
 Process the timestamp option from other side. More...
 
void ProcessOptionWScale (const Ptr< const TcpOption > option)
 Read and parse the Window scale option. More...
 
void ProcessSynRcvd (Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
 Received a packet upon SYN_RCVD. More...
 
void ProcessSynSent (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received a packet upon SYN_SENT. More...
 
void ProcessWait (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received a packet upon CLOSE_WAIT, FIN_WAIT_1, FIN_WAIT_2. More...
 
void ReadOptions (const TcpHeader &tcpHeader, uint32_t *bytesSacked)
 Read TCP options before Ack processing. More...
 
virtual void ReceivedAck (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Received an ACK packet. More...
 
virtual void ReceivedData (Ptr< Packet > packet, const TcpHeader &tcpHeader)
 Recv of a data, put into buffer, call L7 to get it if necessary. More...
 
virtual void ReTxTimeout ()
 An RTO event happened. More...
 
virtual uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck)
 Extract at most maxSize bytes from the TxBuffer at sequence seq, add the TCP header, and send to TcpL4Protocol. More...
 
virtual void SendEmptyPacket (uint8_t flags)
 Send a empty packet that carries a flag, e.g., ACK. More...
 
uint32_t SendPendingData (bool withAck=false)
 Send as much pending data as possible according to the Tx window. More...
 
void SendRST ()
 Send reset and tear down this socket. More...
 
bool SetAllowBroadcast (bool allowBroadcast) override
 Configure whether broadcast datagram transmissions are allowed. More...
 
void SetConnTimeout (Time timeout) override
 Set the connection timeout. More...
 
void SetDataRetries (uint32_t retries) override
 Set the number of data transmission retries before giving up. More...
 
void SetDelAckMaxCount (uint32_t count) override
 Set the number of packet to fire an ACK before delay timeout. More...
 
void SetDelAckTimeout (Time timeout) override
 Set the time to delay an ACK. More...
 
void SetInitialCwnd (uint32_t cwnd) override
 Set the initial Congestion Window. More...
 
void SetInitialSSThresh (uint32_t threshold) override
 Set the initial Slow Start Threshold. More...
 
void SetPersistTimeout (Time timeout) override
 Set the timeout for persistent connection. More...
 
void SetRcvBufSize (uint32_t size) override
 Set the receive buffer size. More...
 
void SetSegSize (uint32_t size) override
 Set the segment size. More...
 
void SetSndBufSize (uint32_t size) override
 Set the send buffer size. More...
 
void SetSynRetries (uint32_t count) override
 Set the number of connection retries before giving up. More...
 
void SetTcpNoDelay (bool noDelay) override
 Enable/Disable Nagle's algorithm. More...
 
int SetupCallback ()
 Common part of the two Bind(), i.e. More...
 
int SetupEndpoint ()
 Configure the endpoint to a local address. More...
 
int SetupEndpoint6 ()
 Configure the endpoint v6 to a local address. More...
 
void TimeWait ()
 Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state. More...
 
virtual uint32_t UnAckDataCount () const
 Return count of number of unacked bytes. More...
 
void UpdatePacingRate ()
 Dynamically update the pacing rate. More...
 
virtual void UpdateRttHistory (const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
 Update the RTT history, when we send TCP segments. More...
 
void UpdateWindowSize (const TcpHeader &header)
 Update the receiver window (RWND) based on the value of the window field in the header. More...
 
virtual uint32_t Window () const
 Return the max possible number of unacked bytes. More...
 
- Protected Member Functions inherited from ns3::Socket
void DoDispose () override
 Destructor implementation. More...
 
bool IsManualIpTtl () const
 Checks if the socket has a specific IPv4 TTL set. More...
 
bool IsManualIpv6HopLimit () const
 Checks if the socket has a specific IPv6 Hop Limit set. More...
 
bool IsManualIpv6Tclass () const
 Checks if the socket has a specific IPv6 Tclass set. More...
 
void NotifyConnectionFailed ()
 Notify through the callback (if set) that the connection has not been established due to an error. More...
 
bool NotifyConnectionRequest (const Address &from)
 Notify through the callback (if set) that an incoming connection is being requested by a remote host. More...
 
void NotifyConnectionSucceeded ()
 Notify through the callback (if set) that the connection has been established. More...
 
void NotifyDataRecv ()
 Notify through the callback (if set) that some data have been received. More...
 
void NotifyDataSent (uint32_t size)
 Notify through the callback (if set) that some data have been sent. More...
 
void NotifyErrorClose ()
 Notify through the callback (if set) that the connection has been closed due to an error. More...
 
void NotifyNewConnectionCreated (Ptr< Socket > socket, const Address &from)
 Notify through the callback (if set) that a new connection has been created. More...
 
void NotifyNormalClose ()
 Notify through the callback (if set) that the connection has been closed. More...
 
void NotifySend (uint32_t spaceAvailable)
 Notify through the callback (if set) that some data have been sent. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize ()
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate ()
 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 ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Static Protected Member Functions

static uint32_t SafeSubtraction (uint32_t a, uint32_t b)
 Performs a safe subtraction between a and b (a-b) More...
 

Protected Attributes

TracedValue< uint32_t > m_advWnd {0}
 Advertised Window size. More...
 
uint32_t m_bytesAckedNotProcessed {0}
 Bytes acked, but not processed. More...
 
Time m_clockGranularity {Seconds(0.001)}
 Clock Granularity used in RTO calcs. More...
 
bool m_closeNotified {false}
 Told app to close socket. More...
 
bool m_closeOnEmpty {false}
 Close socket upon tx buffer emptied. More...
 
Time m_cnTimeout {Seconds(0.0)}
 Timeout for connection retry. More...
 
Ptr< TcpCongestionOpsm_congestionControl
 Congestion control. More...
 
bool m_connected {false}
 Connection established. More...
 
uint32_t m_dataRetrCount {0}
 Count of remaining data retransmission attempts. More...
 
uint32_t m_dataRetries {0}
 Number of data retransmission attempts. More...
 
uint32_t m_delAckCount {0}
 Delayed ACK counter. More...
 
EventId m_delAckEvent {}
 Delayed ACK timeout event. More...
 
uint32_t m_delAckMaxCount {0}
 Number of packet to fire an ACK before delay timeout. More...
 
Time m_delAckTimeout {Seconds(0.0)}
 Time to delay an ACK. More...
 
uint32_t m_dupAckCount {0}
 Dupack counter. More...
 
TracedValue< SequenceNumber32m_ecnCESeq
 Sequence number of the last received Congestion Experienced. More...
 
TracedValue< SequenceNumber32m_ecnCWRSeq {0}
 Sequence number of the last sent CWR. More...
 
TracedValue< SequenceNumber32m_ecnEchoSeq
 Sequence number of the last received ECN Echo. More...
 
Ipv4EndPointm_endPoint {nullptr}
 the IPv4 endpoint More...
 
Ipv6EndPointm_endPoint6 {nullptr}
 the IPv6 endpoint More...
 
SocketErrno m_errno {ERROR_NOTERROR}
 Socket error code. More...
 
TracedValue< SequenceNumber32m_highRxAckMark {0}
 Highest ack received. More...
 
TracedValue< SequenceNumber32m_highRxMark {0}
 Highest seqno received. More...
 
SequenceNumber32 m_highTxAck {0}
 Highest ack sent. More...
 
std::deque< RttHistorym_history
 List of sent packet. More...
 
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback
 ICMP callback. More...
 
Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback6
 ICMPv6 callback. More...
 
bool m_isFirstPartialAck {true}
 First partial ACK during RECOVERY. More...
 
EventId m_lastAckEvent {}
 Last ACK timeout event. More...
 
bool m_limitedTx {true}
 perform limited transmit More...
 
uint16_t m_maxWinSize {0}
 Maximum window size to advertise. More...
 
Time m_minRto {Time::Max()}
 minimum value of the Retransmit timeout More...
 
double m_msl {0.0}
 Max segment lifetime. More...
 
Ptr< Nodem_node
 the associated node More...
 
bool m_noDelay {false}
 Set to true to disable Nagle's algorithm. More...
 
Timer m_pacingTimer {Timer::CANCEL_ON_DESTROY}
 Pacing Event. More...
 
EventId m_persistEvent {}
 Persist event: Send 1 byte to probe for a non-zero Rx window. More...
 
Time m_persistTimeout {Seconds(0.0)}
 Time between sending 1-byte probes. More...
 
Ptr< TcpRateOpsm_rateOps
 Rate operations. More...
 
uint8_t m_rcvWindShift {0}
 Window shift to apply to outgoing segments. More...
 
SequenceNumber32 m_recover
 Previous highest Tx seqnum for fast recovery (set it to initial seq number) More...
 
bool m_recoverActive {false}
 Whether "m_recover" has been set/activated It is used to avoid comparing with the old m_recover value which was set for handling previous congestion event. More...
 
Ptr< TcpRecoveryOpsm_recoveryOps
 Recovery Algorithm. More...
 
EventId m_retxEvent {}
 Retransmission event. More...
 
uint32_t m_retxThresh {3}
 Fast Retransmit threshold. More...
 
TracedValue< Timem_rto {Seconds(0.0)}
 Retransmit timeout. More...
 
Ptr< RttEstimatorm_rtt
 Round trip time estimator. More...
 
TracedValue< uint32_t > m_rWnd {0}
 Receiver window (RCV.WND in RFC793) More...
 
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > m_rxTrace
 Trace of received packets. More...
 
bool m_sackEnabled {true}
 RFC SACK option enabled. More...
 
EventId m_sendPendingDataEvent {}
 micro-delay event to send pending data More...
 
bool m_shutdownRecv {false}
 Receive no longer allowed. More...
 
bool m_shutdownSend {false}
 Send no longer allowed. More...
 
uint8_t m_sndWindShift {0}
 Window shift to apply to incoming segments. More...
 
TracedValue< TcpStates_tm_state {CLOSED}
 TCP state. More...
 
uint32_t m_synCount {0}
 Count of remaining connection retries. More...
 
uint32_t m_synRetries {0}
 Number of connection attempts. More...
 
Ptr< TcpSocketStatem_tcb
 Congestion control information. More...
 
Ptr< TcpL4Protocolm_tcp
 the associated TCP L4 protocol More...
 
bool m_timestampEnabled {true}
 Timestamp option enabled. More...
 
uint32_t m_timestampToEcho {0}
 Timestamp to echo. More...
 
EventId m_timewaitEvent {}
 TIME_WAIT expiration event: Move this socket to CLOSED state. More...
 
Ptr< TcpTxBufferm_txBuffer
 Tx buffer. More...
 
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > m_txTrace
 Trace of transmitted packets. More...
 
bool m_winScalingEnabled {true}
 Window Scale option enabled (RFC 7323) More...
 
- Protected Attributes inherited from ns3::Socket
Ptr< NetDevicem_boundnetdevice
 the device this socket is bound to (might be null). More...
 
Ipv6Address m_ipv6MulticastGroupAddress
 IPv6 multicast group address. More...
 
bool m_recvPktInfo
 if the socket should add packet info tags to the packet forwarded to L4. More...
 

Related Functions

(Note that these are not member functions.)

class TcpGeneralTest
 TcpGeneralTest friend class (for tests). More...
 

Additional Inherited Members

- Static Public Attributes inherited from ns3::TcpSocket
static const char *const TcpStateName [TcpSocket::LAST_STATE]
 Literal names of TCP states for use in log messages. More...
 

Detailed Description

A base class for implementation of a stream socket using TCP.

This class contains the essential components of TCP, as well as a sockets interface for upper layers to call. This class provides connection orientation and sliding window flow control; congestion control is delegated to subclasses of TcpCongestionOps. Part of TcpSocketBase is modified from the original NS-3 TCP socket implementation (TcpSocketImpl) by Raj Bhattacharjea raj.b.nosp@m.@gat.nosp@m.ech.e.nosp@m.du of Georgia Tech.

For IPv4 packets, the TOS set for the socket is used. The Bind and Connect operations set the TOS for the socket to the value specified in the provided address. A SocketIpTos tag is only added to the packet if the resulting TOS is non-null. Each packet is assigned the priority set for the socket. Setting a TOS for a socket also sets a priority for the socket (according to the Socket::IpTos2Priority function). A SocketPriority tag is only added to the packet if the priority is non-null.

Congestion state machine

The socket maintains two state machines; the TCP one, and another called "Congestion state machine", which keeps track of the phase we are in. Currently, ns-3 manages the states:

  • CA_OPEN
  • CA_DISORDER
  • CA_RECOVERY
  • CA_LOSS
  • CA_CWR

For more information, see the TcpCongState_t documentation.

Congestion control interface

Congestion control, unlike older releases of ns-3, has been split from TcpSocketBase. In particular, each congestion control is now a subclass of the main TcpCongestionOps class. Switching between congestion algorithm is now a matter of setting a pointer into the TcpSocketBase class. The idea and the interfaces are inspired by the Linux operating system, and in particular from the structure tcp_congestion_ops. The reference paper is https://www.sciencedirect.com/science/article/abs/pii/S1569190X15300939.

Transmission Control Block (TCB)

The variables needed to congestion control classes to operate correctly have been moved inside the TcpSocketState class. It contains information on the congestion window, slow start threshold, segment size and the state of the Congestion state machine.

To track the trace inside the TcpSocketState class, a "forward" technique is used, which consists in chaining callbacks from TcpSocketState to TcpSocketBase (see for example cWnd trace source).

Fast retransmit

The fast retransmit enhancement is introduced in RFC 2581 and updated in RFC

  1. It reduces the time a sender waits before retransmitting a lost segment, through the assumption that if it receives a certain number of duplicate ACKs, a segment has been lost and it can be retransmitted. Usually, it is coupled with the Limited Transmit algorithm, defined in RFC 3042. These algorithms are included in this class, and they are implemented inside the ProcessAck method. With the SACK option enabled, the LimitedTransmit algorithm will be always on, as a consequence of how the information in the received SACK block is managed.

The attribute which manages the number of dup ACKs necessary to start the fast retransmit algorithm is named "ReTxThreshold", and by default is 3. The parameter is also used in TcpTxBuffer to determine if a packet is lost (please take a look at TcpTxBuffer documentation to see details) but, right now, it is assumed to be fixed. In future releases this parameter can be made dynamic, to reflect the reordering degree of the network. With SACK, the next sequence to transmit is given by the RFC 6675 algorithm. Without SACK option, the implementation adds "hints" to TcpTxBuffer to make sure it returns, as next transmittable sequence, the first lost (or presumed lost) segment.

Fast recovery

The fast recovery algorithm is introduced RFC 2001, and it avoids to reset cWnd to 1 segment after sensing a loss on the channel. Instead, a new slow start threshold value is asked to the congestion control (for instance, with NewReno the returned amount is half of the previous), and the cWnd is set equal to such value. Ns-3 does not implement any inflation/deflation to the congestion window since it uses an evolved method (borrowed from Linux operating system) to calculate the number of bytes in flight. The fundamental idea is to subtract from the total bytes in flight the lost/sacked amount (the segments that have left the network) and to add the retransmitted count. In this way, congestion window represents the exact number of bytes that should be in flight. The implementation then decides what to transmit, it there is space, between new or already transmitted data portion. If a value of the congestion window with inflation and deflation is needed, there is a traced source named "CongestionWindowInflated". However, the variable behind it is not used in the code, but maintained for backward compatibility.

RTO expiration

When the Retransmission Time Out expires, the TCP faces a significant performance drop. The expiration event is managed in the ReTxTimeout method, which set the cWnd to 1 segment and starts "from scratch" again. The list of sent packet is set as lost entirely, and the transmission is re-started from the SND.UNA sequence number.

Options management

SYN and SYN-ACK options, which are allowed only at the beginning of the connection, are managed in the DoForwardUp and SendEmptyPacket methods. To read all others, we have set up a cycle inside ReadOptions. For adding them, there is no a unique place, since the options (and the information available to build them) are scattered around the code. For instance, the SACK option is built in SendEmptyPacket only under certain conditions.

SACK

The SACK generation/management is delegated to the buffer classes, namely TcpTxBuffer and TcpRxBuffer. In TcpRxBuffer it is managed the creation of the SACK option from the receiver point of view. It must provide an accurate (and efficient) representation of the status of the receiver buffer. On the other side, inside TcpTxBuffer the received options (that contain the SACK block) are processed and a particular data structure, called Scoreboard, is filled. Please take a look at TcpTxBuffer and TcpRxBuffer documentation if you need more information. The reference paper is https://dl.acm.org/citation.cfm?id=3067666.

Definition at line 219 of file tcp-socket-base.h.

Member Typedef Documentation

◆ TcpTxRxTracedCallback

typedef void(* ns3::TcpSocketBase::TcpTxRxTracedCallback) (const Ptr< const Packet > packet, const TcpHeader &header, const Ptr< const TcpSocketBase > socket)

TracedCallback signature for tcp packet transmission or reception events.

Parameters
[in]packetThe packet.
[in]headerThe TcpHeader
[in]socketThis socket

Definition at line 617 of file tcp-socket-base.h.

Constructor & Destructor Documentation

◆ TcpSocketBase() [1/2]

◆ TcpSocketBase() [2/2]

◆ ~TcpSocketBase()

ns3::TcpSocketBase::~TcpSocketBase ( )
override

Definition at line 463 of file tcp-socket-base.cc.

References CancelAllTimers(), m_endPoint, m_endPoint6, m_node, m_tcp, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddOptions()

void ns3::TcpSocketBase::AddOptions ( TcpHeader tcpHeader)
protected

Add options to TcpHeader.

Test each option, and if it is enabled on our side, add it to the header

Parameters
tcpHeaderTcpHeader to add options to

Definition at line 4196 of file tcp-socket-base.cc.

References AddOptionTimestamp(), m_timestampEnabled, and NS_LOG_FUNCTION.

Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddOptionSack()

void ns3::TcpSocketBase::AddOptionSack ( TcpHeader header)
protected

Add the SACK option to the header.

Parameters
headerTcpHeader where the method should add the option

Definition at line 4304 of file tcp-socket-base.cc.

References ns3::TcpHeader::AppendOption(), ns3::Node::GetId(), ns3::TcpHeader::GetMaxOptionLength(), ns3::TcpHeader::GetOptionLength(), m_node, ns3::TcpSocketState::m_rxBuffer, m_tcb, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.

Referenced by SendEmptyPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddOptionSackPermitted()

void ns3::TcpSocketBase::AddOptionSackPermitted ( TcpHeader header)
protected

Add the SACK PERMITTED option to the header.

Parameters
headerTcpHeader where the method should add the option

Definition at line 4293 of file tcp-socket-base.cc.

References ns3::TcpHeader::AppendOption(), ns3::TcpHeader::GetFlags(), ns3::Node::GetId(), m_node, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpHeader::SYN.

Referenced by SendEmptyPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddOptionTimestamp()

void ns3::TcpSocketBase::AddOptionTimestamp ( TcpHeader header)
protected

Add the timestamp option to the header.

Set the timestamp as the lower bits of the Simulator::Now time, and the echo value as the last seen timestamp from the other part.

Parameters
headerTcpHeader to which add the option to

Definition at line 4361 of file tcp-socket-base.cc.

References ns3::TcpHeader::AppendOption(), ns3::Node::GetId(), m_node, m_timestampToEcho, ns3::TcpOptionTS::NowToTsValue(), NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by AddOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddOptionWScale()

void ns3::TcpSocketBase::AddOptionWScale ( TcpHeader header)
protected

Add the window scale option to the header.

Calculate our factor from the rxBuffer max size, and add it to the header.

Parameters
headerTcpHeader where the method should add the window scale option

Definition at line 4253 of file tcp-socket-base.cc.

References ns3::TcpHeader::AppendOption(), CalculateWScale(), ns3::TcpHeader::GetFlags(), ns3::Node::GetId(), m_node, m_rcvWindShift, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpHeader::SYN.

Referenced by SendEmptyPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddSocketTags()

◆ AdvertisedWindowSize()

uint16_t ns3::TcpSocketBase::AdvertisedWindowSize ( bool  scale = true) const
protectedvirtual

The amount of Rx window announced to the peer.

Parameters
scaleindicate if the window should be scaled. True for almost all cases, except when we are sending a SYN
Returns
size of Rx window announced to the peer

Reimplemented in TcpSocketAdvertisedWindowProxy.

Definition at line 3483 of file tcp-socket-base.cc.

References m_advWnd, m_maxWinSize, m_rcvWindShift, ns3::TcpSocketState::m_rxBuffer, m_tcb, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.

Referenced by TcpSocketAdvertisedWindowProxy::AdvertisedWindowSize(), DoForwardUp(), PersistTimeout(), SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().

+ Here is the caller graph for this function:

◆ AvailableWindow()

uint32_t ns3::TcpSocketBase::AvailableWindow ( ) const
protectedvirtual

Return unfilled portion of window.

Returns
unfilled portion of window

Definition at line 3475 of file tcp-socket-base.cc.

References BytesInFlight(), and Window().

Referenced by Send(), and SendPendingData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Bind() [1/2]

int ns3::TcpSocketBase::Bind ( )
overridevirtual

Allocate a local IPv4 endpoint for this socket.

Returns
0 on success, -1 on failure.

Implements ns3::Socket.

Definition at line 536 of file tcp-socket-base.cc.

References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().

Referenced by Connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Bind() [2/2]

◆ Bind6()

int ns3::TcpSocketBase::Bind6 ( )
overridevirtual

Allocate a local IPv6 endpoint for this socket.

Returns
0 on success, -1 on failure.

Implements ns3::Socket.

Definition at line 552 of file tcp-socket-base.cc.

References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint6, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().

Referenced by Connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BindToNetDevice()

void ns3::TcpSocketBase::BindToNetDevice ( Ptr< NetDevice netdevice)
overridevirtual

Bind a socket to specific device.

This method corresponds to using setsockopt() SO_BINDTODEVICE of real network or BSD sockets. If set on a socket, this option will force packets to leave the bound device regardless of the device that IP routing would naturally choose. In the receive direction, only packets received from the bound interface will be delivered.

This option has no particular relationship to binding sockets to an address via Socket::Bind (). It is possible to bind sockets to a specific IP address on the bound interface by calling both Socket::Bind (address) and Socket::BindToNetDevice (device), but it is also possible to bind to mismatching device and address, even if the socket can not receive any packets as a result.

Parameters
netdevicePointer to NetDevice of desired interface

Reimplemented from ns3::Socket.

Definition at line 1007 of file tcp-socket-base.cc.

References ns3::Ipv4EndPoint::BindToNetDevice(), ns3::Ipv6EndPoint::BindToNetDevice(), ns3::Socket::BindToNetDevice(), m_endPoint, m_endPoint6, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ BytesInFlight()

uint32_t ns3::TcpSocketBase::BytesInFlight ( ) const
protectedvirtual

Return total bytes in flight.

Does not count segments lost and SACKed (or dupACKed)

Returns
total bytes in flight

Definition at line 3457 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_bytesInFlight, m_tcb, m_txBuffer, and NS_LOG_DEBUG.

Referenced by AvailableWindow(), EnterCwr(), EnterRecovery(), ProcessAck(), ReceivedAck(), ReTxTimeout(), and SendDataPacket().

+ Here is the caller graph for this function:

◆ CalculateWScale()

uint8_t ns3::TcpSocketBase::CalculateWScale ( ) const
protected

Calculate window scale value based on receive buffer space.

Calculate our factor from the rxBuffer max size

Returns
the Window Scale factor

Definition at line 4228 of file tcp-socket-base.cc.

References ns3::Node::GetId(), m_maxWinSize, m_node, ns3::TcpSocketState::m_rxBuffer, m_tcb, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.

Referenced by AddOptionWScale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CancelAllTimers()

void ns3::TcpSocketBase::CancelAllTimers ( )
protected

Cancel all timer when endpoint is deleted.

Definition at line 3995 of file tcp-socket-base.cc.

References ns3::EventId::Cancel(), ns3::Timer::Cancel(), m_delAckEvent, m_lastAckEvent, m_pacingTimer, m_persistEvent, m_retxEvent, m_sendPendingDataEvent, and m_timewaitEvent.

Referenced by ~TcpSocketBase(), DeallocateEndPoint(), Destroy(), Destroy6(), and TimeWait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckEcnCe()

bool ns3::TcpSocketBase::CheckEcnCe ( uint8_t  tos) const
inline

Checks for CE codepoint.

Parameters
tosthe TOS byte to check
Returns
true if TOS has CE codepoint set; otherwise false

Definition at line 544 of file tcp-socket-base.h.

◆ CheckEcnEct0()

bool ns3::TcpSocketBase::CheckEcnEct0 ( uint8_t  tos) const
inline

Checks for ECT(0) codepoint.

Parameters
tosthe TOS byte to check
Returns
true if TOS has ECT(0) codepoint set; otherwise false

Definition at line 522 of file tcp-socket-base.h.

◆ CheckEcnEct1()

bool ns3::TcpSocketBase::CheckEcnEct1 ( uint8_t  tos) const
inline

Checks for ECT(1) codepoint.

Parameters
tosthe TOS byte to check
Returns
true if TOS has ECT(1) codepoint set; otherwise false

Definition at line 533 of file tcp-socket-base.h.

◆ CheckNoEcn()

bool ns3::TcpSocketBase::CheckNoEcn ( uint8_t  tos) const
inline

Checks if TOS has no ECN codepoints.

Parameters
tosthe TOS byte to check
Returns
true if TOS does not have any ECN codepoints set; otherwise false

Definition at line 511 of file tcp-socket-base.h.

Referenced by AddSocketTags().

+ Here is the caller graph for this function:

◆ ClearEcnBits()

uint8_t ns3::TcpSocketBase::ClearEcnBits ( uint8_t  tos) const
inline

Clears ECN bits from TOS.

Parameters
tosthe TOS byte to modify
Returns
TOS without ECN bits

Definition at line 500 of file tcp-socket-base.h.

◆ Close()

int ns3::TcpSocketBase::Close ( )
overridevirtual

Close a socket.

Returns
zero on success, -1 on failure.

After the Close call, the socket is no longer valid, and cannot safely be used for subsequent operations.

Internal:
First we check to see if there is any unread rx data. Bug 426 claims we should send reset in this case.

Implements ns3::Socket.

Definition at line 771 of file tcp-socket-base.cc.

References DoClose(), m_closeOnEmpty, ns3::TcpSocketState::m_nextTxSequence, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_WARN, SendRST(), and ns3::TcpSocket::TcpStateName.

Referenced by DoPeerClose().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CloseAndNotify()

void ns3::TcpSocketBase::CloseAndNotify ( )
protected

Peacefully close the socket by notifying the upper layer and deallocate end point.

Definition at line 1132 of file tcp-socket-base.cc.

References ns3::EventId::Cancel(), ns3::TcpSocket::CLOSED, DeallocateEndPoint(), ns3::EventId::IsRunning(), m_closeNotified, m_lastAckEvent, m_state, ns3::Socket::NotifyNormalClose(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::TcpSocket::TcpStateName.

Referenced by DoClose(), DoConnect(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and TimeWait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompleteFork()

void ns3::TcpSocketBase::CompleteFork ( Ptr< Packet p,
const TcpHeader tcpHeader,
const Address fromAddress,
const Address toAddress 
)
protectedvirtual

Complete a connection by forking the socket.

This function is called only if a SYN received in LISTEN state. After TcpSocketBase cloned, allocate a new end point to handle the incoming connection and send a SYN+ACK to complete the handshake.

Parameters
pthe packet triggering the fork
tcpHeaderthe TCP header of the triggering packet
fromAddressthe address of the remote host
toAddressthe address the connection is directed to

Reimplemented in ns3::TcpSocketMsgBase.

Definition at line 2967 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::Socket::GetBoundNetDevice(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_dataRetrCount, m_dataRetries, ns3::TcpSocketState::m_ecnState, m_endPoint, m_endPoint6, ns3::TcpSocketState::m_rxBuffer, m_state, m_synCount, m_synRetries, m_tcb, m_tcp, ns3::TcpSocketState::m_useEcn, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::TcpSocketState::Off, SendEmptyPacket(), SetupCallback(), ns3::TcpHeader::SYN, and ns3::TcpSocket::SYN_RCVD.

Referenced by ns3::TcpSocketMsgBase::CompleteFork(), and ProcessListen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Connect()

◆ ConnectionSucceeded()

void ns3::TcpSocketBase::ConnectionSucceeded ( )
protected

Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded()

Definition at line 3021 of file tcp-socket-base.cc.

References GetTxAvailable(), ns3::Socket::NotifyConnectionSucceeded(), and ns3::Socket::NotifySend().

Referenced by ProcessSynSent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeallocateEndPoint()

void ns3::TcpSocketBase::DeallocateEndPoint ( )
protected

Deallocate m_endPoint and m_endPoint6.

Definition at line 2877 of file tcp-socket-base.cc.

References CancelAllTimers(), m_endPoint, m_endPoint6, m_tcp, ns3::Ipv4EndPoint::SetDestroyCallback(), and ns3::Ipv6EndPoint::SetDestroyCallback().

Referenced by CloseAndNotify(), LastAckTimeout(), ReTxTimeout(), SendEmptyPacket(), and SendRST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DelAckTimeout()

void ns3::TcpSocketBase::DelAckTimeout ( )
protectedvirtual

Action upon delay ACK timeout, i.e.

send an ACK

Definition at line 3858 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_EVENT_DELAYED_ACK, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_SENDING_ECE, m_congestionControl, m_delAckCount, ns3::TcpSocketState::m_ecnState, m_tcb, and SendEmptyPacket().

Referenced by ReceivedData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Destroy()

void ns3::TcpSocketBase::Destroy ( )
protected

Kill this socket by zeroing its attributes (IPv4)

This is a callback function configured to m_endpoint in SetupCallback(), invoked when the endpoint is destroyed.

Definition at line 2702 of file tcp-socket-base.cc.

References CancelAllTimers(), ns3::Simulator::GetDelayLeft(), m_endPoint, m_retxEvent, m_tcp, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by SetupCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Destroy6()

void ns3::TcpSocketBase::Destroy6 ( )
protected

Kill this socket by zeroing its attributes (IPv6)

This is a callback function configured to m_endpoint in SetupCallback(), invoked when the endpoint is destroyed.

Definition at line 2718 of file tcp-socket-base.cc.

References CancelAllTimers(), ns3::Simulator::GetDelayLeft(), m_endPoint6, m_retxEvent, m_tcp, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by SetupCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoClose()

int ns3::TcpSocketBase::DoClose ( )
protected

Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state.

Returns
0 on success

Definition at line 1090 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::TcpSocket::CLOSE_WAIT, CloseAndNotify(), ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, m_state, NS_LOG_DEBUG, NS_LOG_FUNCTION, SendEmptyPacket(), SendRST(), ns3::TcpSocket::SYN_RCVD, ns3::TcpSocket::SYN_SENT, and ns3::TcpSocket::TIME_WAIT.

Referenced by Close().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoConnect()

int ns3::TcpSocketBase::DoConnect ( )
protected

◆ DoForwardUp()

void ns3::TcpSocketBase::DoForwardUp ( Ptr< Packet packet,
const Address fromAddress,
const Address toAddress 
)
protectedvirtual

Called by TcpSocketBase::ForwardUp{,6}().

Get a packet from L3. This is the real function to handle the incoming packet from lower layers. This is wrapped by ForwardUp() so that this function can be overloaded by daughter classes.

Parameters
packetthe incoming packet
fromAddressthe address of the sender of packet
toAddressthe address of the receiver of packet (hopefully, us)

Definition at line 1309 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, AddOptions(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::TcpHeader::CWR, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, EstimateRtt(), ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TracedValue< T >::Get(), ns3::TcpHeader::GetAckNumber(), ns3::Simulator::GetDelayLeft(), ns3::TcpHeader::GetDestinationPort(), ns3::TcpHeader::GetFlags(), GetInitialCwnd(), GetInitialSSThresh(), ns3::TcpHeader::GetOption(), GetSegSize(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), ns3::TcpHeader::GetSourcePort(), ns3::TcpHeader::GetWindowSize(), ns3::TcpHeader::HasOption(), ns3::EventId::IsExpired(), ns3::EventId::IsRunning(), ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, ns3::Socket::m_boundnetdevice, m_connected, ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_cWndInfl, ns3::TcpSocketState::m_ecnState, m_highRxAckMark, ns3::TcpSocketState::m_nextTxSequence, m_persistEvent, m_persistTimeout, m_retxEvent, m_rWnd, ns3::TcpSocketState::m_rxBuffer, m_rxTrace, m_sackEnabled, ns3::TcpSocketState::m_ssThresh, m_state, m_tcb, m_tcp, m_timestampEnabled, m_txBuffer, m_txTrace, m_winScalingEnabled, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_LOGIC, PersistTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessListen(), ProcessOptionSackPermitted(), ProcessOptionTimestamp(), ProcessOptionWScale(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpHeader::PSH, ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), ns3::TcpHeader::RST, ns3::TcpOption::SACKPERMITTED, ns3::Simulator::Schedule(), SendPendingData(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::TcpHeader::SYN, ns3::TcpSocket::SYN_RCVD, ns3::TcpSocket::SYN_SENT, ns3::TcpSocket::TcpStateName, ns3::TcpSocket::TIME_WAIT, ns3::TcpOption::TS, UpdateWindowSize(), ns3::TcpHeader::URG, and ns3::TcpOption::WINSCALE.

Referenced by ForwardUp(), and ForwardUp6().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoPeerClose()

◆ DoRetransmit()

void ns3::TcpSocketBase::DoRetransmit ( )
protected

Retransmit the first segment marked as lost, without considering available window nor pacing.

Definition at line 3960 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_nextTxSequence, m_sackEnabled, ns3::TcpSocketState::m_segmentSize, m_tcb, m_txBuffer, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, two-ray-to-three-gpp-ch-calibration::res, and SendDataPacket().

Referenced by ProcessAck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DupAck()

void ns3::TcpSocketBase::DupAck ( uint32_t  currentDelivered)
protected

◆ EnterCwr()

void ns3::TcpSocketBase::EnterCwr ( uint32_t  currentDelivered)
protected

Enter CA_CWR state upon receipt of an ECN Echo.

Parameters
currentDeliveredCurrently (S)ACKed bytes

Definition at line 1615 of file tcp-socket-base.cc.

References BytesInFlight(), ns3::TcpSocketState::CA_CWR, m_congestionControl, ns3::TcpSocketState::m_congState, ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_cWndInfl, m_dupAckCount, ns3::TcpSocketState::m_highTxMark, m_recover, m_recoveryOps, ns3::TcpSocketState::m_ssThresh, m_tcb, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::TcpSocketState::TcpCongStateName, and UnAckDataCount().

Referenced by ReceivedAck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnterRecovery()

void ns3::TcpSocketBase::EnterRecovery ( uint32_t  currentDelivered)
protected

◆ EstimateRtt()

void ns3::TcpSocketBase::EstimateRtt ( const TcpHeader tcpHeader)
protectedvirtual

◆ Fork()

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

Call CopyObject<> to clone me.

Returns
a copy of the socket

Reimplemented in ns3::TcpSocketSmallAcks, ns3::TcpSocketMsgBase, ns3::TcpSocketCongestedRouter, TcpDctcpCongestedRouter, TcpSocketHalfAck, and TcpSocketAdvertisedWindowProxy.

Definition at line 4544 of file tcp-socket-base.cc.

Referenced by ProcessListen().

+ Here is the caller graph for this function:

◆ ForwardIcmp()

void ns3::TcpSocketBase::ForwardIcmp ( Ipv4Address  icmpSource,
uint8_t  icmpTtl,
uint8_t  icmpType,
uint8_t  icmpCode,
uint32_t  icmpInfo 
)
protected

Called by the L3 protocol when it received an ICMP packet to pass on to TCP.

Parameters
icmpSourcethe ICMP source address
icmpTtlthe ICMP Time to Live
icmpTypethe ICMP Type
icmpCodethe ICMP Code
icmpInfothe ICMP Info

Definition at line 1253 of file tcp-socket-base.cc.

References m_icmpCallback, and NS_LOG_FUNCTION.

Referenced by SetupCallback().

+ Here is the caller graph for this function:

◆ ForwardIcmp6()

void ns3::TcpSocketBase::ForwardIcmp6 ( Ipv6Address  icmpSource,
uint8_t  icmpTtl,
uint8_t  icmpType,
uint8_t  icmpCode,
uint32_t  icmpInfo 
)
protected

Called by the L3 protocol when it received an ICMPv6 packet to pass on to TCP.

Parameters
icmpSourcethe ICMP source address
icmpTtlthe ICMP Time to Live
icmpTypethe ICMP Type
icmpCodethe ICMP Code
icmpInfothe ICMP Info

Definition at line 1269 of file tcp-socket-base.cc.

References m_icmpCallback6, and NS_LOG_FUNCTION.

Referenced by SetupCallback().

+ Here is the caller graph for this function:

◆ ForwardUp()

void ns3::TcpSocketBase::ForwardUp ( Ptr< Packet packet,
Ipv4Header  header,
uint16_t  port,
Ptr< Ipv4Interface incomingInterface 
)
protected

◆ ForwardUp6()

void ns3::TcpSocketBase::ForwardUp6 ( Ptr< Packet packet,
Ipv6Header  header,
uint16_t  port,
Ptr< Ipv6Interface incomingInterface 
)
protected

◆ GetAllowBroadcast()

bool ns3::TcpSocketBase::GetAllowBroadcast ( ) const
overrideprotectedvirtual

Query whether broadcast datagram transmissions are allowed.

This method corresponds to using getsockopt() SO_BROADCAST of real network or BSD sockets.

Returns
true if broadcast is allowed, false otherwise

Implements ns3::Socket.

Definition at line 4190 of file tcp-socket-base.cc.

◆ GetClockGranularity()

Time ns3::TcpSocketBase::GetClockGranularity ( ) const

Get the Clock Granularity (used in RTO calcs).

Returns
The Clock Granularity.

Definition at line 4441 of file tcp-socket-base.cc.

References m_clockGranularity.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetConnTimeout()

Time ns3::TcpSocketBase::GetConnTimeout ( ) const
overrideprotectedvirtual

Get the connection timeout.

Returns
the connection timeout

Implements ns3::TcpSocket.

Definition at line 4098 of file tcp-socket-base.cc.

References m_cnTimeout.

◆ GetDataRetries()

uint32_t ns3::TcpSocketBase::GetDataRetries ( ) const
overrideprotectedvirtual

Get the number of data transmission retries before giving up.

Returns
the number of data transmission retries

Implements ns3::TcpSocket.

Definition at line 4124 of file tcp-socket-base.cc.

References m_dataRetries, and NS_LOG_FUNCTION.

◆ GetDelAckMaxCount()

uint32_t ns3::TcpSocketBase::GetDelAckMaxCount ( ) const
overrideprotectedvirtual

Get the number of packet to fire an ACK before delay timeout.

Returns
the number of packet to fire an ACK before delay timeout

Implements ns3::TcpSocket.

Definition at line 4151 of file tcp-socket-base.cc.

References m_delAckMaxCount.

◆ GetDelAckTimeout()

Time ns3::TcpSocketBase::GetDelAckTimeout ( ) const
overrideprotectedvirtual

Get the time to delay an ACK.

Returns
the time to delay an ACK

Implements ns3::TcpSocket.

Definition at line 4138 of file tcp-socket-base.cc.

References m_delAckTimeout.

◆ GetErrno()

Socket::SocketErrno ns3::TcpSocketBase::GetErrno ( ) const
overridevirtual

Get last error number.

Returns
the errno associated to the last call which failed in this socket. Each socket's errno is initialized to zero when the socket is created.

Implements ns3::Socket.

Definition at line 515 of file tcp-socket-base.cc.

References m_errno.

◆ GetHighRxAck()

SequenceNumber32 ns3::TcpSocketBase::GetHighRxAck ( ) const
protected

Get the current value of the receiver's highest (in-sequence) sequence number acked.

Note
This method exists to expose the value to the TcpTxBuffer
Returns
value of receiver's highest sequence number acked.

Definition at line 4671 of file tcp-socket-base.cc.

References ns3::TracedValue< T >::Get(), and m_highRxAckMark.

+ Here is the call graph for this function:

◆ GetInitialCwnd()

uint32_t ns3::TcpSocketBase::GetInitialCwnd ( ) const
overrideprotectedvirtual

Get the initial Congestion Window.

Returns
the initial congestion window (in segments)

Implements ns3::TcpSocket.

Definition at line 668 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_initialCWnd, and m_tcb.

Referenced by DoForwardUp(), and IsPacingEnabled().

+ Here is the caller graph for this function:

◆ GetInitialSSThresh()

uint32_t ns3::TcpSocketBase::GetInitialSSThresh ( ) const
overrideprotectedvirtual

Get the initial Slow Start Threshold.

Returns
the Slow Start Threshold (in bytes)

Implements ns3::TcpSocket.

Definition at line 652 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_initialSsThresh, and m_tcb.

Referenced by DoForwardUp().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::TcpSocketBase::GetInstanceTypeId ( void  ) const
overridevirtual

Get the instance TypeId.

Returns
the instance TypeId

Reimplemented from ns3::Object.

Definition at line 262 of file tcp-socket-base.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetMinRto()

Time ns3::TcpSocketBase::GetMinRto ( ) const

Get the Minimum RTO.

Returns
The minimum RTO.

Definition at line 4428 of file tcp-socket-base.cc.

References m_minRto.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetNode()

Ptr< Node > ns3::TcpSocketBase::GetNode ( ) const
overridevirtual

Return the node this socket is associated with.

Returns
the node

Implements ns3::Socket.

Definition at line 529 of file tcp-socket-base.cc.

References m_node.

◆ GetPeerName()

int ns3::TcpSocketBase::GetPeerName ( Address address) const
overridevirtual

Get the peer address of a connected socket.

Parameters
addressthe address this socket is connected to.
Returns
0 if success, -1 otherwise

Implements ns3::Socket.

Definition at line 979 of file tcp-socket-base.cc.

References first::address, ns3::Socket::ERROR_NOTCONN, ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), m_endPoint, m_endPoint6, m_errno, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetPersistTimeout()

Time ns3::TcpSocketBase::GetPersistTimeout ( ) const
overrideprotectedvirtual

Get the timeout for persistent connection.

When the timeout expires, send 1-byte data to probe for the window size at the receiver when the local knowledge tells that the receiver has zero window size

Returns
the persistent timeout

Implements ns3::TcpSocket.

Definition at line 4177 of file tcp-socket-base.cc.

References m_persistTimeout.

◆ GetRcvBufSize()

uint32_t ns3::TcpSocketBase::GetRcvBufSize ( ) const
overrideprotectedvirtual

Get the receive buffer size.

Returns
the buffer size (in bytes)

Implements ns3::TcpSocket.

Definition at line 4069 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_rxBuffer, and m_tcb.

Referenced by SetRcvBufSize().

+ Here is the caller graph for this function:

◆ GetRetxThresh()

uint32_t ns3::TcpSocketBase::GetRetxThresh ( ) const
inline

Get the retransmission threshold (dup ack threshold for a fast retransmit)

Returns
the threshold

Definition at line 320 of file tcp-socket-base.h.

References m_retxThresh.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetRWnd()

uint32_t ns3::TcpSocketBase::GetRWnd ( ) const
protected

Get the current value of the receiver's offered window (RCV.WND)

Note
This method exists to expose the value to the TcpTxBuffer
Returns
value of receiver's offered window

Definition at line 4665 of file tcp-socket-base.cc.

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

Referenced by TcpSocketBase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRxAvailable()

uint32_t ns3::TcpSocketBase::GetRxAvailable ( ) const
overridevirtual

Return number of bytes which can be returned from one or multiple calls to Recv.

Must be possible to call this method from the Recv callback.

Returns
the number of bytes which can be returned from one or multiple Recv calls.

Implements ns3::Socket.

Definition at line 950 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_rxBuffer, m_tcb, and NS_LOG_FUNCTION.

◆ GetRxBuffer()

Ptr< TcpRxBuffer > ns3::TcpSocketBase::GetRxBuffer ( ) const

Get a pointer to the Rx buffer.

Returns
a pointer to the rx buffer

Definition at line 4453 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_rxBuffer, and m_tcb.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetSegSize()

uint32_t ns3::TcpSocketBase::GetSegSize ( ) const
overrideprotectedvirtual

Get the segment size.

Returns
the segment size (in bytes)

Implements ns3::TcpSocket.

Definition at line 4085 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_segmentSize, and m_tcb.

Referenced by DoForwardUp().

+ Here is the caller graph for this function:

◆ GetSndBufSize()

uint32_t ns3::TcpSocketBase::GetSndBufSize ( ) const
overrideprotectedvirtual

Get the send buffer size.

Returns
the buffer size (in bytes)

Implements ns3::TcpSocket.

Definition at line 4036 of file tcp-socket-base.cc.

References m_txBuffer.

◆ GetSocketType()

Socket::SocketType ns3::TcpSocketBase::GetSocketType ( ) const
overridevirtual
Returns
the socket type, analogous to getsockopt (SO_TYPE)

Implements ns3::Socket.

Definition at line 522 of file tcp-socket-base.cc.

References ns3::Socket::NS3_SOCK_STREAM.

◆ GetSockName()

int ns3::TcpSocketBase::GetSockName ( Address address) const
overridevirtual

Get socket address.

Parameters
addressthe address name this socket is associated with.
Returns
0 if success, -1 otherwise

Implements ns3::Socket.

Definition at line 958 of file tcp-socket-base.cc.

References first::address, ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv4Address::GetZero(), m_endPoint, m_endPoint6, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetSynRetries()

uint32_t ns3::TcpSocketBase::GetSynRetries ( ) const
overrideprotectedvirtual

Get the number of connection retries before giving up.

Returns
the number of connection retries

Implements ns3::TcpSocket.

Definition at line 4111 of file tcp-socket-base.cc.

References m_synRetries.

◆ GetTcpNoDelay()

bool ns3::TcpSocketBase::GetTcpNoDelay ( ) const
overrideprotectedvirtual

Check if Nagle's algorithm is enabled or not.

Returns
true if Nagle's algorithm is DISABLED

Implements ns3::TcpSocket.

Definition at line 4164 of file tcp-socket-base.cc.

References m_noDelay.

◆ GetTxAvailable()

uint32_t ns3::TcpSocketBase::GetTxAvailable ( ) const
overridevirtual

Returns the number of bytes which can be sent in a single call to Send.

For datagram sockets, this returns the number of bytes that can be passed atomically through the underlying protocol.

For stream sockets, this returns the available space in bytes left in the transmit buffer.

Returns
The number of bytes which can be sent in a single Send call.

Implements ns3::Socket.

Definition at line 942 of file tcp-socket-base.cc.

References m_txBuffer, and NS_LOG_FUNCTION.

Referenced by ConnectionSucceeded(), NewAck(), ProcessSynRcvd(), and SendPendingData().

+ Here is the caller graph for this function:

◆ GetTxBuffer()

Ptr< TcpTxBuffer > ns3::TcpSocketBase::GetTxBuffer ( ) const

Get a pointer to the Tx buffer.

Returns
a pointer to the tx buffer

Definition at line 4447 of file tcp-socket-base.cc.

References m_txBuffer.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetTypeId()

◆ IsPacingEnabled()

bool ns3::TcpSocketBase::IsPacingEnabled ( ) const
protected

Return true if packets in the current window should be paced.

Returns
true if pacing is currently enabled

Definition at line 4569 of file tcp-socket-base.cc.

References GetInitialCwnd(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), ns3::TcpSocketState::m_highTxMark, ns3::TcpSocketState::m_paceInitialWindow, ns3::TcpSocketState::m_pacing, ns3::TcpSocketState::m_segmentSize, and m_tcb.

Referenced by SendDataPacket(), and SendPendingData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsTcpOptionEnabled()

bool ns3::TcpSocketBase::IsTcpOptionEnabled ( uint8_t  kind) const
protected

Return true if the specified option is enabled.

Parameters
kindkind of TCP option
Returns
true if the option is enabled

Definition at line 1574 of file tcp-socket-base.cc.

References m_sackEnabled, m_timestampEnabled, m_winScalingEnabled, NS_LOG_FUNCTION, ns3::TcpOption::SACK, ns3::TcpOption::SACKPERMITTED, ns3::TcpOption::TS, and ns3::TcpOption::WINSCALE.

◆ IsValidTcpSegment()

bool ns3::TcpSocketBase::IsValidTcpSegment ( const SequenceNumber32  seq,
const uint32_t  tcpHeaderSize,
const uint32_t  tcpPayloadSize 
)
protected

Checks whether the given TCP segment is valid or not.

Parameters
seqthe sequence number of packet's TCP header
tcpHeaderSizethe size of packet's TCP header
tcpPayloadSizethe size of TCP payload
Returns
true if the TCP segment is valid

Definition at line 1285 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, NS_LOG_ERROR, NS_LOG_WARN, OutOfRange(), SendEmptyPacket(), and ns3::TcpSocket::TcpStateName.

Referenced by ForwardUp(), and ForwardUp6().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LastAckTimeout()

void ns3::TcpSocketBase::LastAckTimeout ( )
protectedvirtual

Timeout at LAST_ACK, close the connection.

Definition at line 3875 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::EventId::Cancel(), DeallocateEndPoint(), ns3::TcpHeader::FIN, ns3::TcpSocket::LAST_ACK, m_clockGranularity, m_dataRetrCount, m_lastAckEvent, m_rtt, m_state, ns3::Max(), ns3::Socket::NotifyErrorClose(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and SendEmptyPacket().

Referenced by DoPeerClose().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Listen()

int ns3::TcpSocketBase::Listen ( )
overridevirtual

Listen for incoming connections.

Returns
0 on success, -1 on error (in which case errno is set).

Implements ns3::Socket.

Definition at line 753 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSED, ns3::Socket::ERROR_INVAL, ns3::TcpSocket::LISTEN, m_errno, m_state, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

◆ MarkEcnCe()

uint8_t ns3::TcpSocketBase::MarkEcnCe ( uint8_t  tos) const
inline

Mark CE codepoint.

Parameters
tosthe TOS byte to modify
Returns
TOS with CE codepoint set

Definition at line 489 of file tcp-socket-base.h.

Referenced by ns3::TcpSocketCongestedRouter::SendDataPacket().

+ Here is the caller graph for this function:

◆ MarkEcnCodePoint()

uint8_t ns3::TcpSocketBase::MarkEcnCodePoint ( const uint8_t  tos,
const TcpSocketState::EcnCodePoint_t  codePoint 
) const
inline

mark ECN code point

Parameters
tosthe TOS byte to modify
codePointthe codepoint to use
Returns
TOS with specified ECN code point

Definition at line 556 of file tcp-socket-base.h.

Referenced by AddSocketTags(), and PersistTimeout().

+ Here is the caller graph for this function:

◆ MarkEcnEct0()

uint8_t ns3::TcpSocketBase::MarkEcnEct0 ( uint8_t  tos) const
inline

Mark ECT(0) codepoint.

Parameters
tosthe TOS byte to modify
Returns
TOS with ECT(0) codepoint set

Definition at line 467 of file tcp-socket-base.h.

Referenced by ns3::TcpSocketCongestedRouter::SendDataPacket().

+ Here is the caller graph for this function:

◆ MarkEcnEct1()

uint8_t ns3::TcpSocketBase::MarkEcnEct1 ( uint8_t  tos) const
inline

Mark ECT(1) codepoint.

Parameters
tosthe TOS byte to modify
Returns
TOS with ECT(1) codepoint set

Definition at line 478 of file tcp-socket-base.h.

◆ NewAck()

void ns3::TcpSocketBase::NewAck ( const SequenceNumber32 seq,
bool  resetRTO 
)
protectedvirtual

◆ NotifyPacingPerformed()

void ns3::TcpSocketBase::NotifyPacingPerformed ( )
protected

Notify Pacing.

Definition at line 4561 of file tcp-socket-base.cc.

References m_connected, NS_LOG_FUNCTION, NS_LOG_INFO, and SendPendingData().

Referenced by TcpSocketBase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OutOfRange()

bool ns3::TcpSocketBase::OutOfRange ( SequenceNumber32  head,
SequenceNumber32  tail 
) const
protected

Check if a sequence number range is within the rx window.

Parameters
headstart of the Sequence window
tailend of the Sequence window
Returns
true if it is in range

Definition at line 1153 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::CLOSING, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, ns3::TcpSocket::SYN_RCVD, and ns3::TcpSocket::SYN_SENT.

Referenced by IsValidTcpSegment().

+ Here is the caller graph for this function:

◆ PeerClose()

void ns3::TcpSocketBase::PeerClose ( Ptr< Packet p,
const TcpHeader tcpHeader 
)
protected

Received a FIN from peer, notify rx buffer.

Parameters
pthe packet
tcpHeaderthe packet's TCP header

Definition at line 2622 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSING, DoPeerClose(), ns3::TcpSocket::FIN_WAIT_1, ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ReceivedData().

Referenced by ProcessEstablished(), and ProcessSynRcvd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PersistTimeout()

◆ ProcessAck()

void ns3::TcpSocketBase::ProcessAck ( const SequenceNumber32 ackNumber,
bool  scoreboardUpdated,
uint32_t  currentDelivered,
const SequenceNumber32 oldHeadSequence 
)
protectedvirtual

◆ ProcessClosing()

void ns3::TcpSocketBase::ProcessClosing ( Ptr< Packet packet,
const TcpHeader tcpHeader 
)
protected

Received a packet upon CLOSING.

Parameters
packetthe packet
tcpHeaderthe packet's TCP header

Definition at line 2552 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpSocketState::m_rxBuffer, m_tcb, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), TimeWait(), and ns3::TcpHeader::URG.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessEstablished()

void ns3::TcpSocketBase::ProcessEstablished ( Ptr< Packet packet,
const TcpHeader tcpHeader 
)
protected

◆ ProcessLastAck()

void ns3::TcpSocketBase::ProcessLastAck ( Ptr< Packet packet,
const TcpHeader tcpHeader 
)
protected

Received a packet upon LAST_ACK.

Parameters
packetthe packet
tcpHeaderthe packet's TCP header

Definition at line 2585 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpSocketState::m_rxBuffer, m_tcb, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ReceivedData(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), and ns3::TcpHeader::URG.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessListen()

void ns3::TcpSocketBase::ProcessListen ( Ptr< Packet packet,
const TcpHeader tcpHeader,
const Address fromAddress,
const Address toAddress 
)
protected

Received a packet upon LISTEN state.

Parameters
packetthe packet
tcpHeaderthe packet's TCP header
fromAddressthe source address
toAddressthe destination address

Definition at line 2229 of file tcp-socket-base.cc.

References CompleteFork(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, Fork(), ns3::TcpHeader::GetFlags(), ns3::Socket::NotifyConnectionRequest(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ns3::Simulator::ScheduleNow(), ns3::TcpHeader::SYN, and ns3::TcpHeader::URG.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOptionSack()

uint32_t ns3::TcpSocketBase::ProcessOptionSack ( const Ptr< const TcpOption option)
protected

Read the SACK option.

Parameters
optionSACK option from the header
Returns
the number of bytes sacked by this option

Definition at line 4273 of file tcp-socket-base.cc.

References m_rateOps, m_txBuffer, ns3::MakeCallback(), NS_LOG_FUNCTION, and ns3::TcpRateOps::SkbDelivered().

Referenced by ReadOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOptionSackPermitted()

void ns3::TcpSocketBase::ProcessOptionSackPermitted ( const Ptr< const TcpOption option)
protected

Read the SACK PERMITTED option.

Currently this is a placeholder, since no operations should be done on such option.

Parameters
optionSACK PERMITTED option from the header

Definition at line 4282 of file tcp-socket-base.cc.

References ns3::Node::GetId(), m_node, m_sackEnabled, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOptionTimestamp()

void ns3::TcpSocketBase::ProcessOptionTimestamp ( const Ptr< const TcpOption option,
const SequenceNumber32 seq 
)
protected

Process the timestamp option from other side.

Get the timestamp and the echo, then save timestamp (which will be the echo value in our out-packets) and save the echoed timestamp, to utilize later to calculate RTT.

See also
EstimateRtt
Parameters
optionOption from the segment
seqSequence number of the segment

Definition at line 4333 of file tcp-socket-base.cc.

References ns3::Node::GetId(), m_highTxAck, m_node, ns3::TcpSocketState::m_rcvTimestampEchoReply, ns3::TcpSocketState::m_rcvTimestampValue, ns3::TcpSocketState::m_rxBuffer, m_tcb, m_timestampToEcho, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOptionWScale()

void ns3::TcpSocketBase::ProcessOptionWScale ( const Ptr< const TcpOption option)
protected

Read and parse the Window scale option.

Read the window scale option (encoded logarithmically) and save it. Per RFC 1323, the value can't exceed 14.

Parameters
optionWindow scale option read from the header

Definition at line 4207 of file tcp-socket-base.cc.

References ns3::Node::GetId(), m_node, m_sndWindShift, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessSynRcvd()

void ns3::TcpSocketBase::ProcessSynRcvd ( Ptr< Packet packet,
const TcpHeader tcpHeader,
const Address fromAddress,
const Address toAddress 
)
protected

Received a packet upon SYN_RCVD.

Parameters
packetthe packet
tcpHeaderthe packet's TCP header
fromAddressthe source address
toAddressthe destination address

Definition at line 2364 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_OPEN, ns3::EventId::Cancel(), CloseAndNotify(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), GetTxAvailable(), m_congestionControl, ns3::TcpSocketState::m_congState, m_connected, m_delAckCount, m_delAckMaxCount, ns3::TcpSocketState::m_ecnState, m_endPoint, m_endPoint6, ns3::TcpSocketState::m_highTxMark, ns3::TcpSocketState::m_nextTxSequence, m_retxEvent, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, m_txBuffer, ns3::TcpSocketState::m_useEcn, ns3::Socket::NotifyNewConnectionCreated(), ns3::Socket::NotifySend(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpSocketState::Off, PeerClose(), ns3::TcpHeader::PSH, ReceivedAck(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), ns3::Ipv4EndPoint::SetPeer(), ns3::Ipv6EndPoint::SetPeer(), ns3::TcpHeader::SYN, UpdatePacingRate(), and ns3::TcpHeader::URG.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessSynSent()

◆ ProcessWait()

◆ ReadOptions()

void ns3::TcpSocketBase::ReadOptions ( const TcpHeader tcpHeader,
uint32_t *  bytesSacked 
)
protected

Read TCP options before Ack processing.

Timestamp and Window scale are managed in other pieces of code.

Parameters
tcpHeaderHeader of the segment
[out]bytesSackedNumber of bytes SACKed, or 0

Definition at line 1594 of file tcp-socket-base.cc.

References ns3::TcpHeader::GetOptionList(), NS_LOG_FUNCTION, ProcessOptionSack(), and ns3::TcpOption::SACK.

Referenced by ReceivedAck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceivedAck()

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

Received an ACK packet.

Parameters
packetthe packet
tcpHeaderthe packet's TCP header

Reimplemented in ns3::TcpSocketMsgBase.

Definition at line 1809 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, BytesInFlight(), ns3::TcpSocketState::CA_CWR, ns3::TcpSocketState::CA_EVENT_COMPLETE_CWR, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_ECE_RCVD, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, EnterCwr(), ns3::TcpRateOps::GenerateSample(), ns3::TracedValue< T >::Get(), ns3::TcpHeader::GetAckNumber(), ns3::TcpRateOps::GetConnectionRate(), ns3::TcpHeader::GetFlags(), ns3::Packet::GetSize(), ns3::TcpSocketState::m_bytesInFlight, m_congestionControl, ns3::TcpSocketState::m_congState, m_connected, ns3::TcpSocketState::m_cWnd, ns3::TcpRateOps::TcpRateConnection::m_delivered, m_ecnEchoSeq, ns3::TcpSocketState::m_ecnState, ns3::TcpSocketState::m_isRetransDataAcked, ns3::TcpSocketState::m_lastAckedSackedBytes, ns3::TcpSocketState::m_minRtt, m_rateOps, m_recover, m_recoveryOps, ns3::TcpSocketState::m_segmentSize, ns3::TcpSocketState::m_ssThresh, m_tcb, m_txBuffer, ns3::MakeCallback(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ProcessAck(), ReadOptions(), ReceivedData(), SendPendingData(), ns3::TcpRateOps::SkbDelivered(), and ns3::TcpSocketState::TcpCongStateName.

Referenced by ProcessEstablished(), ProcessSynRcvd(), ProcessWait(), and ns3::TcpSocketMsgBase::ReceivedAck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceivedData()

◆ Recv()

Ptr< Packet > ns3::TcpSocketBase::Recv ( uint32_t  maxSize,
uint32_t  flags 
)
overridevirtual

Read data from the socket.

This function matches closely in semantics to the recv() function call in the standard C library (libc): ssize_t recv (int s, void *buf, size_t len, int flags); except that the receive I/O is asynchronous. This is the primary Recv method at this low-level API and must be implemented by subclasses.

This method is normally used only on a connected socket. In a typical blocking sockets model, this call would block until at least one byte is returned or the connection closes. In ns-3 at this API, the call returns immediately in such a case and returns 0 if nothing is available to be read. However, an application can set a callback, ns3::SetRecvCallback, to be notified of data being available to be read (when it conceptually unblocks); this is an asynchronous I/O model for recv().

This variant of Recv() uses class ns3::Packet to encapsulate data, rather than providing a raw pointer and length field. This allows an ns-3 application to attach tags if desired (such as a flow ID) and may allow the simulator to avoid some data copies. Despite the appearance of receiving Packets on a stream socket, just think of it as a fancy byte buffer with streaming semantics.

The semantics depend on the type of socket. For a datagram socket, each Recv() returns the data from at most one Send(), and order is not necessarily preserved. For a stream socket, the bytes are delivered in order, and on-the-wire packet boundaries are not preserved.

The flags argument is formed by or'ing one or more of the values: MSG_OOB process out-of-band data MSG_PEEK peek at incoming message None of these flags are supported for now.

Some variants of Recv() are supported as additional API, including RecvFrom(), overloaded Recv() without arguments, and variants that use raw character buffers.

Parameters
maxSizereader will accept packet up to maxSize
flagsSocket control flags
Returns
Ptr<Packet> of the next in-sequence packet. Returns 0 if the socket cannot return a next in-sequence packet conforming to the maxSize and flags.
See also
SetRecvCallback

Implements ns3::Socket.

Definition at line 901 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.

◆ RecvFrom()

Ptr< Packet > ns3::TcpSocketBase::RecvFrom ( uint32_t  maxSize,
uint32_t  flags,
Address fromAddress 
)
overridevirtual

Read a single packet from the socket and retrieve the sender address.

Calls Recv(maxSize, flags) with maxSize implicitly set to maximum sized integer, and flags set to zero.

This method has similar semantics to Recv () but subclasses may want to provide checks on socket state, so the implementation is pushed to subclasses.

Parameters
maxSizereader will accept packet up to maxSize
flagsSocket control flags
fromAddressoutput parameter that will return the address of the sender of the received packet, if any. Remains untouched if no packet is received.
Returns
Ptr<Packet> of the next in-sequence packet. Returns 0 if the socket cannot return a next in-sequence packet.

Implements ns3::Socket.

Definition at line 915 of file tcp-socket-base.cc.

References ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Packet::GetSize(), ns3::Ipv4Address::GetZero(), m_endPoint, m_endPoint6, NS_LOG_FUNCTION, and ns3::Socket::Recv().

+ Here is the call graph for this function:

◆ ReTxTimeout()

void ns3::TcpSocketBase::ReTxTimeout ( )
protectedvirtual

◆ SafeSubtraction()

uint32_t ns3::TcpSocketBase::SafeSubtraction ( uint32_t  a,
uint32_t  b 
)
staticprotected

Performs a safe subtraction between a and b (a-b)

Safe is used to indicate that, if b>a, the results returned is 0.

Parameters
afirst number
bsecond number
Returns
0 if b>0, (a-b) otherwise

Definition at line 4550 of file tcp-socket-base.cc.

Referenced by ProcessAck().

+ Here is the caller graph for this function:

◆ Send()

int ns3::TcpSocketBase::Send ( Ptr< Packet p,
uint32_t  flags 
)
overridevirtual

Send data (or dummy data) to the remote host.

This function matches closely in semantics to the send() function call in the standard C library (libc): ssize_t send (int s, const void *msg, size_t len, int flags); except that the send I/O is asynchronous. This is the primary Send method at this low-level API and must be implemented by subclasses.

In a typical blocking sockets model, this call would block upon lack of space to hold the message to be sent. In ns-3 at this API, the call returns immediately in such a case, but the callback registered with SetSendCallback() is invoked when the socket has space (when it conceptually unblocks); this is an asynchronous I/O model for send().

This variant of Send() uses class ns3::Packet to encapsulate data, rather than providing a raw pointer and length field. This allows an ns-3 application to attach tags if desired (such as a flow ID) and may allow the simulator to avoid some data copies. Despite the appearance of sending Packets on a stream socket, just think of it as a fancy byte buffer with streaming semantics.

If either the message buffer within the Packet is too long to pass atomically through the underlying protocol (for datagram sockets), or the message buffer cannot entirely fit in the transmit buffer (for stream sockets), -1 is returned and SocketErrno is set to ERROR_MSGSIZE. If the packet does not fit, the caller can split the Packet (based on information obtained from GetTxAvailable) and reattempt to send the data.

The flags argument is formed by or'ing one or more of the values: MSG_OOB process out-of-band data MSG_DONTROUTE bypass routing, use direct interface These flags are unsupported as of ns-3.1.

Parameters
pns3::Packet to send
flagsSocket control flags
Returns
the number of bytes accepted for transmission if no error occurs, and -1 otherwise.
See also
SetSendCallback

Implements ns3::Socket.

Definition at line 843 of file tcp-socket-base.cc.

References AvailableWindow(), ns3::TcpRateOps::CalculateAppLimited(), ns3::TcpSocket::CLOSE_WAIT, ns3::Socket::ERROR_MSGSIZE, ns3::Socket::ERROR_NOTCONN, ns3::Socket::ERROR_SHUTDOWN, ns3::TcpSocket::ESTABLISHED, ns3::Packet::GetSize(), ns3::EventId::IsRunning(), ns3::TcpSocketState::m_bytesInFlight, m_connected, ns3::TcpSocketState::m_cWnd, m_errno, ns3::TcpSocketState::m_nextTxSequence, m_rateOps, ns3::TcpSocketState::m_segmentSize, m_sendPendingDataEvent, m_shutdownSend, m_state, m_tcb, m_txBuffer, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), SendPendingData(), ns3::TcpSocket::SYN_SENT, and ns3::TcpSocket::TcpStateName.

Referenced by SendTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendDataPacket()

uint32_t ns3::TcpSocketBase::SendDataPacket ( SequenceNumber32  seq,
uint32_t  maxSize,
bool  withAck 
)
protectedvirtual

Extract at most maxSize bytes from the TxBuffer at sequence seq, add the TCP header, and send to TcpL4Protocol.

Parameters
seqthe sequence number
maxSizethe maximum data block to be transmitted (in bytes)
withAckforces an ACK to be sent
Returns
the number of bytes sent

Reimplemented in ns3::TcpSocketCongestedRouter, and TcpDctcpCongestedRouter.

Definition at line 3119 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, AddOptions(), AddSocketTags(), AdvertisedWindowSize(), BytesInFlight(), ns3::TcpSocketState::CA_CWR, ns3::TcpSocketState::CA_RECOVERY, ns3::EventId::Cancel(), ns3::TcpSocket::CLOSE_WAIT, ns3::TcpHeader::CWR, ns3::TcpSocketState::ECN_CWR_SENT, ns3::TcpSocketState::ECN_ECE_RCVD, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TracedValue< T >::Get(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::TcpTxItem::GetPacketCopy(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Time::GetSeconds(), ns3::Packet::GetSize(), ns3::EventId::IsExpired(), ns3::Timer::IsExpired(), IsPacingEnabled(), ns3::TcpTxItem::IsRetrans(), ns3::TcpSocket::LAST_ACK, ns3::Socket::m_boundnetdevice, m_closeOnEmpty, ns3::TcpSocketState::m_congState, m_delAckCount, m_delAckEvent, m_ecnCWRSeq, m_ecnEchoSeq, ns3::TcpSocketState::m_ecnState, m_endPoint, m_endPoint6, m_highRxAckMark, ns3::TcpSocketState::m_highTxMark, ns3::TcpSocketState::m_pacingRate, m_pacingTimer, m_rateOps, m_recoveryOps, m_retxEvent, m_rto, m_rWnd, ns3::TcpSocketState::m_rxBuffer, m_state, m_tcb, m_tcp, m_txBuffer, m_txTrace, max, ns3::Socket::NotifyDataSent(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ReTxTimeout(), ns3::Timer::Schedule(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::TcpRateOps::SkbSent(), and UpdateRttHistory().

Referenced by DoRetransmit(), EnterRecovery(), and SendPendingData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendEmptyPacket()

void ns3::TcpSocketBase::SendEmptyPacket ( uint8_t  flags)
protectedvirtual

Send a empty packet that carries a flag, e.g., ACK.

Parameters
flagsthe packet's flags

Reimplemented in ns3::TcpSocketSmallAcks.

Definition at line 2733 of file tcp-socket-base.cc.

References ns3::TcpHeader::ACK, AddOptions(), AddOptionSack(), AddOptionSackPermitted(), AddOptionWScale(), AddSocketTags(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, DeallocateEndPoint(), ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TracedValue< T >::Get(), ns3::TcpHeader::GetAckNumber(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Time::GetSeconds(), ns3::EventId::IsExpired(), ns3::TcpSocket::LAST_ACK, ns3::Socket::m_boundnetdevice, m_clockGranularity, m_cnTimeout, m_delAckCount, m_delAckEvent, m_endPoint, m_endPoint6, m_highTxAck, m_minRto, ns3::TcpSocketState::m_nextTxSequence, m_retxEvent, m_rto, m_rtt, ns3::TcpSocketState::m_rxBuffer, m_sackEnabled, m_state, m_synCount, m_synRetries, m_tcb, m_tcp, m_txTrace, m_winScalingEnabled, ns3::Max(), ns3::Socket::NotifyConnectionFailed(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Simulator::Schedule(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::TcpHeader::SYN, and UpdateRttHistory().

Referenced by TcpSocketBase(), CompleteFork(), DelAckTimeout(), DoClose(), DoConnect(), DoPeerClose(), IsValidTcpSegment(), LastAckTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedData(), ReTxTimeout(), SendRST(), SetRcvBufSize(), and ShutdownSend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendPendingData()

◆ SendRST()

void ns3::TcpSocketBase::SendRST ( )
protected

Send reset and tear down this socket.

Definition at line 2867 of file tcp-socket-base.cc.

References DeallocateEndPoint(), ns3::Socket::NotifyErrorClose(), NS_LOG_FUNCTION, ns3::TcpHeader::RST, and SendEmptyPacket().

Referenced by Close(), DoClose(), DoConnect(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), and ProcessWait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendTo()

int ns3::TcpSocketBase::SendTo ( Ptr< Packet p,
uint32_t  flags,
const Address toAddress 
)
overridevirtual

Send data to a specified peer.

This method has similar semantics to Send () but subclasses may want to provide checks on socket state, so the implementation is pushed to subclasses.

Parameters
ppacket to send
flagsSocket control flags
toAddressIP Address of remote host
Returns
-1 in case of error or the number of bytes copied in the internal buffer and accepted for transmission.

Implements ns3::Socket.

Definition at line 893 of file tcp-socket-base.cc.

References Send().

+ Here is the call graph for this function:

◆ SetAllowBroadcast()

bool ns3::TcpSocketBase::SetAllowBroadcast ( bool  allowBroadcast)
overrideprotectedvirtual

Configure whether broadcast datagram transmissions are allowed.

This method corresponds to using setsockopt() SO_BROADCAST of real network or BSD sockets. If set on a socket, this option will enable or disable packets to be transmitted to broadcast destination addresses.

Parameters
allowBroadcastWhether broadcast is allowed
Returns
true if operation succeeds

Implements ns3::Socket.

Definition at line 4183 of file tcp-socket-base.cc.

◆ SetClockGranularity()

void ns3::TcpSocketBase::SetClockGranularity ( Time  clockGranularity)

Sets the Clock Granularity (used in RTO calcs).

Parameters
clockGranularityThe Clock Granularity

Definition at line 4434 of file tcp-socket-base.cc.

References m_clockGranularity, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetCongestionControlAlgorithm()

void ns3::TcpSocketBase::SetCongestionControlAlgorithm ( Ptr< TcpCongestionOps algo)

Install a congestion control algorithm on this socket.

Parameters
algoAlgorithm to be installed

Definition at line 4529 of file tcp-socket-base.cc.

References m_congestionControl, m_tcb, and NS_LOG_FUNCTION.

◆ SetConnTimeout()

void ns3::TcpSocketBase::SetConnTimeout ( Time  timeout)
overrideprotectedvirtual

Set the connection timeout.

Parameters
timeoutthe connection timeout

Implements ns3::TcpSocket.

Definition at line 4091 of file tcp-socket-base.cc.

References m_cnTimeout, NS_LOG_FUNCTION, and timeout.

◆ SetDataRetries()

void ns3::TcpSocketBase::SetDataRetries ( uint32_t  retries)
overrideprotectedvirtual

Set the number of data transmission retries before giving up.

Parameters
retriesthe number of data transmission retries

Implements ns3::TcpSocket.

Definition at line 4117 of file tcp-socket-base.cc.

References m_dataRetries, and NS_LOG_FUNCTION.

◆ SetDelAckMaxCount()

void ns3::TcpSocketBase::SetDelAckMaxCount ( uint32_t  count)
overrideprotectedvirtual

Set the number of packet to fire an ACK before delay timeout.

Parameters
countthe umber of packet to fire an ACK before delay timeout

Implements ns3::TcpSocket.

Definition at line 4144 of file tcp-socket-base.cc.

References m_delAckMaxCount, and NS_LOG_FUNCTION.

◆ SetDelAckTimeout()

void ns3::TcpSocketBase::SetDelAckTimeout ( Time  timeout)
overrideprotectedvirtual

Set the time to delay an ACK.

Parameters
timeoutthe time to delay an ACK

Implements ns3::TcpSocket.

Definition at line 4131 of file tcp-socket-base.cc.

References m_delAckTimeout, NS_LOG_FUNCTION, and timeout.

◆ SetInitialCwnd()

void ns3::TcpSocketBase::SetInitialCwnd ( uint32_t  cwnd)
overrideprotectedvirtual

Set the initial Congestion Window.

Parameters
cwndthe initial congestion window (in segments)

Implements ns3::TcpSocket.

Definition at line 658 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSED, ns3::TcpSocketState::m_initialCWnd, m_state, m_tcb, and NS_ABORT_MSG_UNLESS.

◆ SetInitialSSThresh()

void ns3::TcpSocketBase::SetInitialSSThresh ( uint32_t  threshold)
overrideprotectedvirtual

Set the initial Slow Start Threshold.

Parameters
thresholdthe Slow Start Threshold (in bytes)

Implements ns3::TcpSocket.

Definition at line 642 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSED, ns3::TcpSocketState::m_initialSsThresh, m_state, m_tcb, and NS_ABORT_MSG_UNLESS.

◆ SetMinRto()

void ns3::TcpSocketBase::SetMinRto ( Time  minRto)

Sets the Minimum RTO.

Parameters
minRtoThe minimum RTO.

Definition at line 4421 of file tcp-socket-base.cc.

References m_minRto, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetNode()

void ns3::TcpSocketBase::SetNode ( Ptr< Node node)
virtual

Set the associated node.

Parameters
nodethe node

Definition at line 494 of file tcp-socket-base.cc.

References m_node.

◆ SetPaceInitialWindow()

void ns3::TcpSocketBase::SetPaceInitialWindow ( bool  paceWindow)

Enable or disable pacing of the initial window.

Parameters
paceWindowBoolean to enable or disable pacing of the initial window

Definition at line 4651 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_paceInitialWindow, m_tcb, and NS_LOG_FUNCTION.

◆ SetPacingStatus()

void ns3::TcpSocketBase::SetPacingStatus ( bool  pacing)

Enable or disable pacing.

Parameters
pacingBoolean to enable or disable pacing

Definition at line 4644 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_pacing, m_tcb, and NS_LOG_FUNCTION.

◆ SetPersistTimeout()

void ns3::TcpSocketBase::SetPersistTimeout ( Time  timeout)
overrideprotectedvirtual

Set the timeout for persistent connection.

When the timeout expires, send 1-byte data to probe for the window size at the receiver when the local knowledge tells that the receiver has zero window size

Parameters
timeoutthe persistent timeout

Implements ns3::TcpSocket.

Definition at line 4170 of file tcp-socket-base.cc.

References m_persistTimeout, NS_LOG_FUNCTION, and timeout.

◆ SetRcvBufSize()

void ns3::TcpSocketBase::SetRcvBufSize ( uint32_t  size)
overrideprotectedvirtual

◆ SetRecoveryAlgorithm()

void ns3::TcpSocketBase::SetRecoveryAlgorithm ( Ptr< TcpRecoveryOps recovery)

Install a recovery algorithm on this socket.

Parameters
recoveryAlgorithm to be installed

Definition at line 4537 of file tcp-socket-base.cc.

References m_recoveryOps, and NS_LOG_FUNCTION.

◆ SetRetxThresh()

void ns3::TcpSocketBase::SetRetxThresh ( uint32_t  retxThresh)

Set the retransmission threshold (dup ack threshold for a fast retransmit)

Parameters
retxThreshthe threshold

Definition at line 4459 of file tcp-socket-base.cc.

References m_retxThresh, and m_txBuffer.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetRtt()

void ns3::TcpSocketBase::SetRtt ( Ptr< RttEstimator rtt)
virtual

Set the associated RTT estimator.

Parameters
rttthe RTT estimator

Definition at line 508 of file tcp-socket-base.cc.

References m_rtt.

◆ SetSegSize()

void ns3::TcpSocketBase::SetSegSize ( uint32_t  size)
overrideprotectedvirtual

Set the segment size.

Parameters
sizethe segment size (in bytes)

Implements ns3::TcpSocket.

Definition at line 4075 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSED, ns3::TcpSocketState::m_segmentSize, m_state, m_tcb, m_txBuffer, NS_ABORT_MSG_UNLESS, and NS_LOG_FUNCTION.

◆ SetSndBufSize()

void ns3::TcpSocketBase::SetSndBufSize ( uint32_t  size)
overrideprotectedvirtual

Set the send buffer size.

Parameters
sizethe buffer size (in bytes)

Implements ns3::TcpSocket.

Definition at line 4029 of file tcp-socket-base.cc.

References m_txBuffer, and NS_LOG_FUNCTION.

◆ SetSynRetries()

void ns3::TcpSocketBase::SetSynRetries ( uint32_t  count)
overrideprotectedvirtual

Set the number of connection retries before giving up.

Parameters
countthe number of connection retries

Implements ns3::TcpSocket.

Definition at line 4104 of file tcp-socket-base.cc.

References m_synRetries, and NS_LOG_FUNCTION.

◆ SetTcp()

void ns3::TcpSocketBase::SetTcp ( Ptr< TcpL4Protocol tcp)
virtual

Set the associated TCP L4 protocol.

Parameters
tcpthe TCP L4 protocol

Definition at line 501 of file tcp-socket-base.cc.

References m_tcp.

◆ SetTcpNoDelay()

void ns3::TcpSocketBase::SetTcpNoDelay ( bool  noDelay)
overrideprotectedvirtual

Enable/Disable Nagle's algorithm.

Parameters
noDelaytrue to DISABLE Nagle's algorithm

Implements ns3::TcpSocket.

Definition at line 4157 of file tcp-socket-base.cc.

References m_noDelay, and NS_LOG_FUNCTION.

◆ SetupCallback()

int ns3::TcpSocketBase::SetupCallback ( )
protected

Common part of the two Bind(), i.e.

set callback and remembering local addr:port

Returns
0 on success, -1 on failure

Definition at line 1024 of file tcp-socket-base.cc.

References Destroy(), Destroy6(), ForwardIcmp(), ForwardIcmp6(), ForwardUp(), ForwardUp6(), m_endPoint, m_endPoint6, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::Ipv4EndPoint::SetDestroyCallback(), ns3::Ipv6EndPoint::SetDestroyCallback(), ns3::Ipv4EndPoint::SetIcmpCallback(), ns3::Ipv6EndPoint::SetIcmpCallback(), ns3::Ipv4EndPoint::SetRxCallback(), and ns3::Ipv6EndPoint::SetRxCallback().

Referenced by Bind(), Bind6(), and CompleteFork().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupEndpoint()

int ns3::TcpSocketBase::SetupEndpoint ( )
protected

Configure the endpoint to a local address.

Called by Connect() if Bind() didn't specify one.

Returns
0 on success

Definition at line 2904 of file tcp-socket-base.cc.

References ns3::Object::GetObject(), ns3::Ipv4EndPoint::GetPeerAddress(), nsclick-simple-lan::ipv4, ns3::Socket::m_boundnetdevice, m_endPoint, m_errno, m_node, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv4Header::SetDestination(), and ns3::Ipv4EndPoint::SetLocalAddress().

Referenced by Connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupEndpoint6()

int ns3::TcpSocketBase::SetupEndpoint6 ( )
protected

Configure the endpoint v6 to a local address.

Called by Connect() if Bind() didn't specify one.

Returns
0 on success

Definition at line 2934 of file tcp-socket-base.cc.

References ns3::Object::GetObject(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Socket::m_boundnetdevice, m_endPoint6, m_errno, m_node, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6Header::SetDestination(), and ns3::Ipv6EndPoint::SetLocalAddress().

Referenced by Connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetUseEcn()

void ns3::TcpSocketBase::SetUseEcn ( TcpSocketState::UseEcn_t  useEcn)

Set ECN mode of use on the socket.

Parameters
useEcnMode of ECN to use.

Definition at line 4658 of file tcp-socket-base.cc.

References m_tcb, ns3::TcpSocketState::m_useEcn, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ ShutdownRecv()

int ns3::TcpSocketBase::ShutdownRecv ( )
overridevirtual
Returns
zero on success, -1 on failure.

Do not allow any further Recv calls. This method is typically implemented for Tcp sockets by a half close.

Implements ns3::Socket.

Definition at line 833 of file tcp-socket-base.cc.

References m_shutdownRecv, and NS_LOG_FUNCTION.

◆ ShutdownSend()

int ns3::TcpSocketBase::ShutdownSend ( )
overridevirtual
Returns
zero on success, -1 on failure.

Do not allow any further Send calls. This method is typically implemented for Tcp sockets by a half close.

Implements ns3::Socket.

Definition at line 799 of file tcp-socket-base.cc.

References ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::LAST_ACK, m_closeOnEmpty, m_shutdownSend, m_state, m_txBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and SendEmptyPacket().

+ Here is the call graph for this function:

◆ TimeWait()

void ns3::TcpSocketBase::TimeWait ( )
protected

Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state.

Definition at line 4008 of file tcp-socket-base.cc.

References CancelAllTimers(), CloseAndNotify(), m_closeNotified, m_msl, m_state, m_timewaitEvent, ns3::Socket::NotifyNormalClose(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::TcpSocket::TcpStateName, and ns3::TcpSocket::TIME_WAIT.

Referenced by ProcessClosing(), and ProcessWait().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnAckDataCount()

uint32_t ns3::TcpSocketBase::UnAckDataCount ( ) const
protectedvirtual

Return count of number of unacked bytes.

The difference between SND.UNA and HighTx

Returns
count of number of unacked bytes

Definition at line 3451 of file tcp-socket-base.cc.

References ns3::TcpSocketState::m_highTxMark, m_tcb, and m_txBuffer.

Referenced by EnterCwr(), EnterRecovery(), and SendPendingData().

+ Here is the caller graph for this function:

◆ UpdateBytesInFlight()

void ns3::TcpSocketBase::UpdateBytesInFlight ( uint32_t  oldValue,
uint32_t  newValue 
) const

Callback function to hook to TcpSocketState bytes inflight.

Parameters
oldValueold bytesInFlight value
newValuenew bytesInFlight value

Definition at line 4517 of file tcp-socket-base.cc.

References m_bytesInFlightTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateCongState()

void ns3::TcpSocketBase::UpdateCongState ( TcpSocketState::TcpCongState_t  oldValue,
TcpSocketState::TcpCongState_t  newValue 
) const

Callback function to hook to TcpSocketState congestion state.

Parameters
oldValueold congestion state value
newValuenew congestion state value

Definition at line 4490 of file tcp-socket-base.cc.

References m_congStateTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateCwnd()

void ns3::TcpSocketBase::UpdateCwnd ( uint32_t  oldValue,
uint32_t  newValue 
) const

Callback function to hook to TcpSocketState congestion window.

Parameters
oldValueold cWnd value
newValuenew cWnd value

Definition at line 4472 of file tcp-socket-base.cc.

References m_cWndTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateCwndInfl()

void ns3::TcpSocketBase::UpdateCwndInfl ( uint32_t  oldValue,
uint32_t  newValue 
) const

Callback function to hook to TcpSocketState inflated congestion window.

Parameters
oldValueold cWndInfl value
newValuenew cWndInfl value

Definition at line 4478 of file tcp-socket-base.cc.

References m_cWndInflTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateEcnState()

void ns3::TcpSocketBase::UpdateEcnState ( TcpSocketState::EcnState_t  oldValue,
TcpSocketState::EcnState_t  newValue 
) const

Callback function to hook to EcnState state.

Parameters
oldValueold ecn state value
newValuenew ecn state value

Definition at line 4497 of file tcp-socket-base.cc.

References m_ecnStateTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateHighTxMark()

void ns3::TcpSocketBase::UpdateHighTxMark ( SequenceNumber32  oldValue,
SequenceNumber32  newValue 
) const

Callback function to hook to TcpSocketState high tx mark.

Parameters
oldValueold high tx mark
newValuenew high tx mark

Definition at line 4511 of file tcp-socket-base.cc.

References m_highTxMarkTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateNextTxSequence()

void ns3::TcpSocketBase::UpdateNextTxSequence ( SequenceNumber32  oldValue,
SequenceNumber32  newValue 
) const

Callback function to hook to TcpSocketState next tx sequence.

Parameters
oldValueold nextTxSeq value
newValuenew nextTxSeq value

Definition at line 4504 of file tcp-socket-base.cc.

References m_nextTxSequenceTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdatePacingRate()

◆ UpdatePacingRateTrace()

void ns3::TcpSocketBase::UpdatePacingRateTrace ( DataRate  oldValue,
DataRate  newValue 
) const

Callback function to hook to TcpSocketState pacing rate.

Parameters
oldValueold pacing rate value
newValuenew pacing rate value

Definition at line 4466 of file tcp-socket-base.cc.

References m_pacingRateTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateRtt()

void ns3::TcpSocketBase::UpdateRtt ( Time  oldValue,
Time  newValue 
) const

Callback function to hook to TcpSocketState rtt.

Parameters
oldValueold rtt value
newValuenew rtt value

Definition at line 4523 of file tcp-socket-base.cc.

References m_lastRttTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateRttHistory()

void ns3::TcpSocketBase::UpdateRttHistory ( const SequenceNumber32 seq,
uint32_t  sz,
bool  isRetransmission 
)
protectedvirtual

Update the RTT history, when we send TCP segments.

Parameters
seqThe sequence number of the TCP segment
szThe segment's size
isRetransmissionWhether or not the segment is a retransmission

Reimplemented in ns3::TcpSocketMsgBase.

Definition at line 3265 of file tcp-socket-base.cc.

References m_history, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketMsgBase::UpdateRttHistory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateSsThresh()

void ns3::TcpSocketBase::UpdateSsThresh ( uint32_t  oldValue,
uint32_t  newValue 
) const

Callback function to hook to TcpSocketState slow start threshold.

Parameters
oldValueold ssTh value
newValuenew ssTh value

Definition at line 4484 of file tcp-socket-base.cc.

References m_ssThTrace.

Referenced by TcpSocketBase().

+ Here is the caller graph for this function:

◆ UpdateWindowSize()

void ns3::TcpSocketBase::UpdateWindowSize ( const TcpHeader header)
protected

Update the receiver window (RWND) based on the value of the window field in the header.

This method suppresses updates unless one of the following three conditions holds: 1) segment contains new data (advancing the right edge of the receive buffer), 2) segment does not contain new data but the segment acks new data (highest sequence number acked advances), or 3) the advertised window is larger than the current send window

Parameters
headerTcpHeader from which to extract the new window value

Definition at line 4376 of file tcp-socket-base.cc.

References ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::GetWindowSize(), m_highRxAckMark, m_highRxMark, m_rWnd, m_sndWindShift, m_state, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.

Referenced by DoForwardUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Window()

uint32_t ns3::TcpSocketBase::Window ( ) const
protectedvirtual

Return the max possible number of unacked bytes.

Returns
the max possible number of unacked bytes

Definition at line 3469 of file tcp-socket-base.cc.

References ns3::TracedValue< T >::Get(), ns3::TcpSocketState::m_cWnd, m_rWnd, m_tcb, and min.

Referenced by AvailableWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TcpGeneralTest

friend class TcpGeneralTest
friend

TcpGeneralTest friend class (for tests).

Definition at line 239 of file tcp-socket-base.h.

Member Data Documentation

◆ m_advWnd

TracedValue<uint32_t> ns3::TcpSocketBase::m_advWnd {0}
protected

Advertised Window size.

Definition at line 1342 of file tcp-socket-base.h.

Referenced by AdvertisedWindowSize(), and GetTypeId().

◆ m_bytesAckedNotProcessed

uint32_t ns3::TcpSocketBase::m_bytesAckedNotProcessed {0}
protected

Bytes acked, but not processed.

Definition at line 1339 of file tcp-socket-base.h.

Referenced by ProcessAck().

◆ m_bytesInFlightTrace

TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_bytesInFlightTrace

Callback pointer for bytesInFlight trace chaining.

Definition at line 368 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateBytesInFlight().

◆ m_clockGranularity

Time ns3::TcpSocketBase::m_clockGranularity {Seconds(0.001)}
protected

◆ m_closeNotified

bool ns3::TcpSocketBase::m_closeNotified {false}
protected

Told app to close socket.

Definition at line 1330 of file tcp-socket-base.h.

Referenced by CloseAndNotify(), DoPeerClose(), ReceivedData(), and TimeWait().

◆ m_closeOnEmpty

bool ns3::TcpSocketBase::m_closeOnEmpty {false}
protected

◆ m_cnTimeout

Time ns3::TcpSocketBase::m_cnTimeout {Seconds(0.0)}
protected

Timeout for connection retry.

Definition at line 1305 of file tcp-socket-base.h.

Referenced by GetConnTimeout(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetConnTimeout().

◆ m_congestionControl

◆ m_congStateTrace

Callback pointer for congestion state trace chaining.

Definition at line 348 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateCongState().

◆ m_connected

bool ns3::TcpSocketBase::m_connected {false}
protected

◆ m_cWndInflTrace

TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_cWndInflTrace

Callback pointer for cWndInfl trace chaining.

Definition at line 338 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateCwndInfl().

◆ m_cWndTrace

TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_cWndTrace

Callback pointer for cWnd trace chaining.

Definition at line 333 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateCwnd().

◆ m_dataRetrCount

uint32_t ns3::TcpSocketBase::m_dataRetrCount {0}
protected

Count of remaining data retransmission attempts.

Definition at line 1296 of file tcp-socket-base.h.

Referenced by CompleteFork(), Connect(), DoPeerClose(), LastAckTimeout(), NewAck(), and ReTxTimeout().

◆ m_dataRetries

uint32_t ns3::TcpSocketBase::m_dataRetries {0}
protected

Number of data retransmission attempts.

Definition at line 1297 of file tcp-socket-base.h.

Referenced by CompleteFork(), Connect(), DoPeerClose(), GetDataRetries(), NewAck(), and SetDataRetries().

◆ m_delAckCount

◆ m_delAckEvent

◆ m_delAckMaxCount

uint32_t ns3::TcpSocketBase::m_delAckMaxCount {0}
protected

Number of packet to fire an ACK before delay timeout.

Definition at line 1288 of file tcp-socket-base.h.

Referenced by GetDelAckMaxCount(), ProcessSynRcvd(), ProcessSynSent(), ReceivedData(), and SetDelAckMaxCount().

◆ m_delAckTimeout

Time ns3::TcpSocketBase::m_delAckTimeout {Seconds(0.0)}
protected

Time to delay an ACK.

Definition at line 1303 of file tcp-socket-base.h.

Referenced by GetDelAckTimeout(), ReceivedData(), and SetDelAckTimeout().

◆ m_dupAckCount

uint32_t ns3::TcpSocketBase::m_dupAckCount {0}
protected

Dupack counter.

Definition at line 1286 of file tcp-socket-base.h.

Referenced by DupAck(), EnterCwr(), EnterRecovery(), ProcessAck(), and ReTxTimeout().

◆ m_ecnCESeq

TracedValue<SequenceNumber32> ns3::TcpSocketBase::m_ecnCESeq
protected
Initial value:
{
0}

Sequence number of the last received Congestion Experienced.

Definition at line 1391 of file tcp-socket-base.h.

Referenced by ForwardUp(), ForwardUp6(), and GetTypeId().

◆ m_ecnCWRSeq

TracedValue<SequenceNumber32> ns3::TcpSocketBase::m_ecnCWRSeq {0}
protected

Sequence number of the last sent CWR.

Definition at line 1393 of file tcp-socket-base.h.

Referenced by GetTypeId(), SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), and ns3::TcpSocketCongestedRouter::SendDataPacket().

◆ m_ecnEchoSeq

TracedValue<SequenceNumber32> ns3::TcpSocketBase::m_ecnEchoSeq
protected
Initial value:
{
0}

Sequence number of the last received ECN Echo.

Definition at line 1389 of file tcp-socket-base.h.

Referenced by GetTypeId(), ReceivedAck(), SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), and ns3::TcpSocketCongestedRouter::SendDataPacket().

◆ m_ecnStateTrace

Callback pointer for ECN state trace chaining.

Definition at line 353 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateEcnState().

◆ m_endPoint

◆ m_endPoint6

◆ m_errno

SocketErrno ns3::TcpSocketBase::m_errno {ERROR_NOTERROR}
mutableprotected

Socket error code.

Definition at line 1328 of file tcp-socket-base.h.

Referenced by Bind(), Bind6(), Connect(), GetErrno(), GetPeerName(), Listen(), Send(), SetupEndpoint(), and SetupEndpoint6().

◆ m_highRxAckMark

TracedValue<SequenceNumber32> ns3::TcpSocketBase::m_highRxAckMark {0}
protected

Highest ack received.

Definition at line 1344 of file tcp-socket-base.h.

Referenced by DoForwardUp(), DupAck(), EnterRecovery(), GetHighRxAck(), GetTypeId(), SendDataPacket(), and UpdateWindowSize().

◆ m_highRxMark

TracedValue<SequenceNumber32> ns3::TcpSocketBase::m_highRxMark {0}
protected

Highest seqno received.

Definition at line 1343 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateWindowSize().

◆ m_highTxAck

SequenceNumber32 ns3::TcpSocketBase::m_highTxAck {0}
protected

Highest ack sent.

Definition at line 1340 of file tcp-socket-base.h.

Referenced by ProcessOptionTimestamp(), and SendEmptyPacket().

◆ m_highTxMarkTrace

TracedCallback<SequenceNumber32, SequenceNumber32> ns3::TcpSocketBase::m_highTxMarkTrace

Callback pointer for high tx mark chaining.

Definition at line 358 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateHighTxMark().

◆ m_history

std::deque<RttHistory> ns3::TcpSocketBase::m_history
protected

List of sent packet.

Definition at line 1308 of file tcp-socket-base.h.

Referenced by EstimateRtt(), ReTxTimeout(), and UpdateRttHistory().

◆ m_icmpCallback

Callback<void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t> ns3::TcpSocketBase::m_icmpCallback
protected

ICMP callback.

Definition at line 1316 of file tcp-socket-base.h.

Referenced by ForwardIcmp(), and GetTypeId().

◆ m_icmpCallback6

Callback<void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t> ns3::TcpSocketBase::m_icmpCallback6
protected

ICMPv6 callback.

Definition at line 1318 of file tcp-socket-base.h.

Referenced by ForwardIcmp6(), and GetTypeId().

◆ m_isFirstPartialAck

bool ns3::TcpSocketBase::m_isFirstPartialAck {true}
protected

First partial ACK during RECOVERY.

Definition at line 1372 of file tcp-socket-base.h.

Referenced by ProcessAck().

◆ m_lastAckEvent

EventId ns3::TcpSocketBase::m_lastAckEvent {}
protected

Last ACK timeout event.

Definition at line 1280 of file tcp-socket-base.h.

Referenced by CancelAllTimers(), CloseAndNotify(), DoPeerClose(), and LastAckTimeout().

◆ m_lastRttTrace

TracedCallback<Time, Time> ns3::TcpSocketBase::m_lastRttTrace

Callback pointer for RTT trace chaining.

Definition at line 373 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateRtt().

◆ m_limitedTx

bool ns3::TcpSocketBase::m_limitedTx {true}
protected

perform limited transmit

Definition at line 1363 of file tcp-socket-base.h.

Referenced by DupAck(), GetTypeId(), and SendPendingData().

◆ m_maxWinSize

uint16_t ns3::TcpSocketBase::m_maxWinSize {0}
protected

Maximum window size to advertise.

Definition at line 1338 of file tcp-socket-base.h.

Referenced by AdvertisedWindowSize(), CalculateWScale(), and GetTypeId().

◆ m_minRto

Time ns3::TcpSocketBase::m_minRto {Time::Max()}
protected

minimum value of the Retransmit timeout

Definition at line 1301 of file tcp-socket-base.h.

Referenced by EstimateRtt(), GetMinRto(), NewAck(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetMinRto().

◆ m_msl

double ns3::TcpSocketBase::m_msl {0.0}
protected

Max segment lifetime.

Definition at line 1335 of file tcp-socket-base.h.

Referenced by GetTypeId(), and TimeWait().

◆ m_nextTxSequenceTrace

TracedCallback<SequenceNumber32, SequenceNumber32> ns3::TcpSocketBase::m_nextTxSequenceTrace

Callback pointer for next tx sequence chaining.

Definition at line 363 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateNextTxSequence().

◆ m_node

◆ m_noDelay

bool ns3::TcpSocketBase::m_noDelay {false}
protected

Set to true to disable Nagle's algorithm.

Definition at line 1291 of file tcp-socket-base.h.

Referenced by GetTcpNoDelay(), SendPendingData(), and SetTcpNoDelay().

◆ m_pacingRateTrace

TracedCallback<DataRate, DataRate> ns3::TcpSocketBase::m_pacingRateTrace

Callback pointer for pacing rate trace chaining.

Definition at line 328 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdatePacingRateTrace().

◆ m_pacingTimer

Timer ns3::TcpSocketBase::m_pacingTimer {Timer::CANCEL_ON_DESTROY}
protected

◆ m_persistEvent

EventId ns3::TcpSocketBase::m_persistEvent {}
protected

Persist event: Send 1 byte to probe for a non-zero Rx window.

Definition at line 1282 of file tcp-socket-base.h.

Referenced by CancelAllTimers(), DoForwardUp(), and PersistTimeout().

◆ m_persistTimeout

Time ns3::TcpSocketBase::m_persistTimeout {Seconds(0.0)}
protected

Time between sending 1-byte probes.

Definition at line 1304 of file tcp-socket-base.h.

Referenced by DoForwardUp(), GetPersistTimeout(), PersistTimeout(), and SetPersistTimeout().

◆ m_rateOps

Ptr<TcpRateOps> ns3::TcpSocketBase::m_rateOps
protected

Rate operations.

Definition at line 1369 of file tcp-socket-base.h.

Referenced by TcpSocketBase(), ProcessOptionSack(), ReceivedAck(), Send(), and SendDataPacket().

◆ m_rcvWindShift

uint8_t ns3::TcpSocketBase::m_rcvWindShift {0}
protected

Window shift to apply to outgoing segments.

Definition at line 1349 of file tcp-socket-base.h.

Referenced by AddOptionWScale(), and AdvertisedWindowSize().

◆ m_recover

SequenceNumber32 ns3::TcpSocketBase::m_recover
protected
Initial value:
{
0}

Previous highest Tx seqnum for fast recovery (set it to initial seq number)

Definition at line 1357 of file tcp-socket-base.h.

Referenced by DupAck(), EnterCwr(), EnterRecovery(), ProcessAck(), ReceivedAck(), and ReTxTimeout().

◆ m_recoverActive

bool ns3::TcpSocketBase::m_recoverActive {false}
protected

Whether "m_recover" has been set/activated It is used to avoid comparing with the old m_recover value which was set for handling previous congestion event.

Definition at line 1359 of file tcp-socket-base.h.

Referenced by DupAck(), EnterRecovery(), ProcessAck(), and ReTxTimeout().

◆ m_recoveryOps

Ptr<TcpRecoveryOps> ns3::TcpSocketBase::m_recoveryOps
protected

◆ m_retxEvent

◆ m_retxThresh

uint32_t ns3::TcpSocketBase::m_retxThresh {3}
protected

Fast Retransmit threshold.

Definition at line 1362 of file tcp-socket-base.h.

Referenced by DupAck(), GetRetxThresh(), and SetRetxThresh().

◆ m_rto

◆ m_rtt

Ptr<RttEstimator> ns3::TcpSocketBase::m_rtt
protected

◆ m_rWnd

TracedValue<uint32_t> ns3::TcpSocketBase::m_rWnd {0}
protected

Receiver window (RCV.WND in RFC793)

Definition at line 1341 of file tcp-socket-base.h.

Referenced by DoForwardUp(), GetRWnd(), GetTypeId(), SendDataPacket(), SendPendingData(), UpdateWindowSize(), and Window().

◆ m_rxTrace

TracedCallback<Ptr<const Packet>, const TcpHeader&, Ptr<const TcpSocketBase> > ns3::TcpSocketBase::m_rxTrace
protected

Trace of received packets.

Definition at line 1383 of file tcp-socket-base.h.

Referenced by DoForwardUp(), and GetTypeId().

◆ m_sackEnabled

bool ns3::TcpSocketBase::m_sackEnabled {true}
protected

◆ m_sendPendingDataEvent

EventId ns3::TcpSocketBase::m_sendPendingDataEvent {}
protected

micro-delay event to send pending data

Definition at line 1354 of file tcp-socket-base.h.

Referenced by CancelAllTimers(), and Send().

◆ m_shutdownRecv

bool ns3::TcpSocketBase::m_shutdownRecv {false}
protected

Receive no longer allowed.

Definition at line 1333 of file tcp-socket-base.h.

Referenced by ProcessWait(), ReceivedData(), and ShutdownRecv().

◆ m_shutdownSend

bool ns3::TcpSocketBase::m_shutdownSend {false}
protected

Send no longer allowed.

Definition at line 1332 of file tcp-socket-base.h.

Referenced by DoPeerClose(), Send(), SendPendingData(), and ShutdownSend().

◆ m_sndWindShift

uint8_t ns3::TcpSocketBase::m_sndWindShift {0}
protected

Window shift to apply to incoming segments.

Definition at line 1350 of file tcp-socket-base.h.

Referenced by ProcessOptionWScale(), and UpdateWindowSize().

◆ m_ssThTrace

TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_ssThTrace

Callback pointer for ssTh trace chaining.

Definition at line 343 of file tcp-socket-base.h.

Referenced by GetTypeId(), and UpdateSsThresh().

◆ m_state

◆ m_synCount

uint32_t ns3::TcpSocketBase::m_synCount {0}
protected

Count of remaining connection retries.

Definition at line 1294 of file tcp-socket-base.h.

Referenced by CompleteFork(), Connect(), ProcessSynSent(), ReTxTimeout(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().

◆ m_synRetries

uint32_t ns3::TcpSocketBase::m_synRetries {0}
protected

◆ m_tcb

◆ m_tcp

◆ m_timestampEnabled

bool ns3::TcpSocketBase::m_timestampEnabled {true}
protected

Timestamp option enabled.

Definition at line 1351 of file tcp-socket-base.h.

Referenced by AddOptions(), DoForwardUp(), EstimateRtt(), GetTypeId(), and IsTcpOptionEnabled().

◆ m_timestampToEcho

uint32_t ns3::TcpSocketBase::m_timestampToEcho {0}
protected

Timestamp to echo.

Definition at line 1352 of file tcp-socket-base.h.

Referenced by AddOptionTimestamp(), and ProcessOptionTimestamp().

◆ m_timewaitEvent

EventId ns3::TcpSocketBase::m_timewaitEvent {}
protected

TIME_WAIT expiration event: Move this socket to CLOSED state.

Definition at line 1283 of file tcp-socket-base.h.

Referenced by CancelAllTimers(), and TimeWait().

◆ m_txBuffer

◆ m_txTrace

◆ m_winScalingEnabled

bool ns3::TcpSocketBase::m_winScalingEnabled {true}
protected

Window Scale option enabled (RFC 7323)

Definition at line 1348 of file tcp-socket-base.h.

Referenced by DoForwardUp(), GetTypeId(), IsTcpOptionEnabled(), and SendEmptyPacket().


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