A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 Member Functions

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

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::TcpSocketBase.

Protected Member Functions

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

Protected Attributes

bool m_closeNotified
bool m_closeOnEmpty
uint32_t m_cnCount
uint32_t m_cnRetries
Time m_cnTimeout
bool m_connected
uint32_t m_delAckCount
EventId m_delAckEvent
uint32_t m_delAckMaxCount
Time m_delAckTimeout
uint32_t m_dupAckCount
Ipv4EndPointm_endPoint
Ipv6EndPointm_endPoint6
enum SocketErrno m_errno
TracedValue< SequenceNumber32m_highTxMark
EventId m_lastAckEvent
TracedValue< Timem_lastRtt
uint16_t m_maxWinSize
double m_msl
TracedValue< SequenceNumber32m_nextTxSequence
Ptr< Nodem_node
bool m_noDelay
EventId m_persistEvent
Time m_persistTimeout
EventId m_retxEvent
TracedValue< Timem_rto
Ptr< RttEstimatorm_rtt
TracedValue< uint32_t > m_rWnd
TcpRxBuffer m_rxBuffer
uint32_t m_segmentSize
bool m_shutdownRecv
bool m_shutdownSend
TracedValue< TcpStates_tm_state
Ptr< TcpL4Protocolm_tcp
EventId m_timewaitEvent
TcpTxBuffer m_txBuffer

Additional Inherited Members

- Public Types inherited from ns3::Socket
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
}
enum  SocketType { NS3_SOCK_STREAM, NS3_SOCK_SEQPACKET, NS3_SOCK_DGRAM, NS3_SOCK_RAW }
- Static Public Attributes inherited from ns3::TcpSocket
static const char *const TcpStateName [LAST_STATE] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "LAST_ACK", "FIN_WAIT_1", "FIN_WAIT_2", "CLOSING", "TIME_WAIT" }

Detailed Description

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 serves as a base for other TCP functions where the sliding window mechanism is handled here. This class provides connection orientation and sliding window flow control. Part of this class 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.

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

Constructor & Destructor Documentation

ns3::TcpSocketBase::TcpSocketBase ( void  )

Create an unbound TCP socket

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

References NS_LOG_FUNCTION.

ns3::TcpSocketBase::TcpSocketBase ( const TcpSocketBase sock)

Clone a TCP socket, for use upon receiving a connection request in LISTEN state

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

References ns3::RttEstimator::Copy(), m_rtt, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), and ns3::Socket::SetSendCallback().

+ Here is the call graph for this function:

ns3::TcpSocketBase::~TcpSocketBase ( void  )
virtual

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

References CancelAllTimers(), ns3::TcpL4Protocol::DeAllocate(), 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

void ns3::TcpSocketBase::AddOptions ( TcpHeader )
protectedvirtual

Placeholder function for future extension that changes the TCP header

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

Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), and SendEmptyPacket().

+ Here is the caller graph for this function:

uint16_t ns3::TcpSocketBase::AdvertisedWindowSize ( void  )
protectedvirtual

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

References m_maxWinSize, m_rxBuffer, ns3::TcpRxBuffer::MaxBufferSize(), and ns3::TcpRxBuffer::Size().

Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), and SendEmptyPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, UnAckDataCount(), and Window().

Referenced by SendPendingData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::TcpSocketBase::Bind ( void  )
virtual

Inherit from Socket class: Bind socket to an end-point in TcpL4Protocol

Implements ns3::Socket.

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

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

Referenced by BindToNetDevice(), and Connect().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::TcpSocketBase::Bind6 ( void  )
virtual

Allocate a local IPv6 endpoint for this socket.

Returns
0 on success, -1 on failure.

Implements ns3::Socket.

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

References ns3::TcpL4Protocol::Allocate6(), ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint6, m_errno, ns3::TcpL4Protocol::m_sockets, 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:

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

Inherit from Socket class: Bind this socket to the specified NetDevice

Reimplemented from ns3::Socket.

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

References Bind(), ns3::Ipv4EndPoint::BindToNetDevice(), m_endPoint, m_endPoint6, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

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

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

References ns3::TracedValue< T >::Get(), ns3::TcpTxBuffer::HeadSequence(), m_highTxMark, m_txBuffer, and NS_LOG_FUNCTION.

Referenced by ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpNewReno::NewAck(), ns3::TcpNewReno::Retransmit(), and ns3::TcpReno::Retransmit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::CancelAllTimers ( void  )
protected

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

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::TcpSocketBase::Close ( void  )
virtual

Inherit from Socket class: Kill this socket and signal the peer (if any)

Implements ns3::Socket.

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

References DoClose(), m_closeOnEmpty, m_nextTxSequence, m_rxBuffer, m_state, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, SendRST(), ns3::TcpRxBuffer::Size(), ns3::TcpTxBuffer::SizeFromSequence(), and ns3::TcpSocket::TcpStateName.

Referenced by DoPeerClose().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::CloseAndNotify ( void  )
protected

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

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

References CancelAllTimers(), ns3::CLOSED, DeallocateEndPoint(), m_closeNotified, m_state, ns3::Socket::NotifyNormalClose(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::TcpSocket::TcpStateName, and ns3::TIME_WAIT.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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.

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

References ns3::TcpHeader::ACK, ns3::TcpL4Protocol::Allocate(), ns3::TcpL4Protocol::Allocate6(), ns3::InetSocketAddress::ConvertFrom(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::TcpHeader::GetSequenceNumber(), ns3::InetSocketAddress::IsMatchingType(), ns3::Inet6SocketAddress::IsMatchingType(), m_cnCount, m_cnRetries, m_endPoint, m_endPoint6, m_rxBuffer, ns3::TcpL4Protocol::m_sockets, m_state, m_tcp, NS_LOG_INFO, SendEmptyPacket(), ns3::TcpRxBuffer::SetNextRxSequence(), SetupCallback(), ns3::TcpHeader::SYN, and ns3::SYN_RCVD.

Referenced by ProcessListen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::ConnectionSucceeded ( void  )
protected

Definition at line 1707 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:

void ns3::TcpSocketBase::DeallocateEndPoint ( void  )
protected

Deallocate the end point and cancel all the timers

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

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

Referenced by CloseAndNotify(), and SendRST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::DelAckTimeout ( void  )
protectedvirtual

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

References ns3::TcpHeader::ACK, m_delAckCount, and SendEmptyPacket().

Referenced by ReceivedData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::Destroy ( void  )
protected

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

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

References CancelAllTimers(), ns3::Simulator::GetDelayLeft(), m_endPoint, m_retxEvent, ns3::TcpL4Protocol::m_sockets, 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:

void ns3::TcpSocketBase::Destroy6 ( void  )
protected

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

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

References CancelAllTimers(), ns3::Simulator::GetDelayLeft(), m_endPoint6, m_retxEvent, ns3::TcpL4Protocol::m_sockets, 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:

int ns3::TcpSocketBase::DoClose ( void  )
protected

Do the action to close the socket. Usually send a packet with appropriate flags depended on the current m_state.

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

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

Referenced by Close().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::TcpSocketBase::DoConnect ( void  )
protected

Perform the real connection tasks: Send SYN if allowed, RST if invalid

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

References ns3::CLOSE_WAIT, CloseAndNotify(), ns3::CLOSED, ns3::LAST_ACK, ns3::LISTEN, m_state, NS_LOG_FUNCTION, NS_LOG_INFO, SendEmptyPacket(), SendRST(), ns3::TcpHeader::SYN, ns3::SYN_SENT, ns3::TcpSocket::TcpStateName, and ns3::TIME_WAIT.

Referenced by Connect().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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.

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

References ns3::TcpHeader::ACK, AddOptions(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::CLOSE_WAIT, ns3::CLOSED, ns3::CLOSING, ns3::ESTABLISHED, EstimateRtt(), ns3::FIN_WAIT_1, ns3::FIN_WAIT_2, ns3::TracedValue< T >::Get(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Packet::GetSize(), ns3::Ipv4Header::GetSource(), ns3::LAST_ACK, ns3::LISTEN, ns3::Socket::m_boundnetdevice, m_endPoint, m_nextTxSequence, m_persistEvent, m_rWnd, m_rxBuffer, m_state, m_tcp, ns3::TcpRxBuffer::MaxRxSequence(), ns3::TcpRxBuffer::NextRxSequence(), NS_LOG_LOGIC, OutOfRange(), port, ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessListen(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpHeader::PSH, ReadOptions(), ns3::Packet::RemoveHeader(), ns3::TcpHeader::RST, SendEmptyPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::SYN_RCVD, ns3::SYN_SENT, ns3::TcpSocket::TcpStateName, ns3::TIME_WAIT, and ns3::TcpHeader::URG.

Referenced by ForwardUp(), and ForwardUp6().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::DoPeerClose ( void  )
protected
virtual void ns3::TcpSocketBase::DupAck ( const TcpHeader t,
uint32_t  count 
)
protectedpure virtual

Implemented in ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.

Referenced by ReceivedAck().

+ Here is the caller graph for this function:

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

Called by ForwardUp() to estimate RTT

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

References ns3::RttEstimator::AckSeq(), ns3::TcpHeader::GetAckNumber(), m_lastRtt, and m_rtt.

Referenced by DoForwardUp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual Ptr<TcpSocketBase> ns3::TcpSocketBase::Fork ( void  )
protectedpure virtual

Implemented in ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.

Referenced by ProcessListen().

+ Here is the caller graph for this function:

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

Function called by the L3 protocol when it received a packet to pass on to the TCP. This function is registered as the "RxCallback" function in SetupCallback(), which invoked by Bind(), and CompleteFork()

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

References DoForwardUp().

Referenced by SetupCallback().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::ForwardUp6 ( Ptr< Packet packet,
Ipv6Address  saddr,
Ipv6Address  daddr,
uint16_t  port 
)
protected

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

References DoForwardUp().

Referenced by SetupCallback().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::TcpSocketBase::GetAllowBroadcast ( void  ) const
protectedvirtual

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 2275 of file tcp-socket-base.cc.

uint32_t ns3::TcpSocketBase::GetConnCount ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_cnRetries.

Time ns3::TcpSocketBase::GetConnTimeout ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_cnTimeout.

uint32_t ns3::TcpSocketBase::GetDelAckMaxCount ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_delAckMaxCount.

Time ns3::TcpSocketBase::GetDelAckTimeout ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_delAckTimeout.

enum Socket::SocketErrno ns3::TcpSocketBase::GetErrno ( void  ) const
virtual

Inherit from Socket class: Returns error code

Implements ns3::Socket.

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

References m_errno.

virtual uint32_t ns3::TcpSocketBase::GetInitialCwnd ( void  ) const
protectedpure virtual
Ptr< Node > ns3::TcpSocketBase::GetNode ( void  ) const
virtual

Inherit from Socket class: Returns associated node

Implements ns3::Socket.

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

References m_node, and NS_LOG_FUNCTION_NOARGS.

Time ns3::TcpSocketBase::GetPersistTimeout ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_persistTimeout.

uint32_t ns3::TcpSocketBase::GetRcvBufSize ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_rxBuffer, and ns3::TcpRxBuffer::MaxBufferSize().

+ Here is the call graph for this function:

uint32_t ns3::TcpSocketBase::GetRxAvailable ( void  ) const
virtual

Inherit from Socket class: Get the max number of bytes an app can read

Implements ns3::Socket.

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

References ns3::TcpRxBuffer::Available(), m_rxBuffer, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

uint32_t ns3::TcpSocketBase::GetSegSize ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_segmentSize.

uint32_t ns3::TcpSocketBase::GetSndBufSize ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_txBuffer, and ns3::TcpTxBuffer::MaxBufferSize().

+ Here is the call graph for this function:

enum Socket::SocketType ns3::TcpSocketBase::GetSocketType ( void  ) const
virtual

Inherit from Socket class: Returns socket type, NS3_SOCK_STREAM

Implements ns3::Socket.

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

References ns3::Socket::NS3_SOCK_STREAM.

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

Inherit from Socket class: Return local address:port

Implements ns3::Socket.

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

References 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:

virtual uint32_t ns3::TcpSocketBase::GetSSThresh ( void  ) const
protectedpure virtual
bool ns3::TcpSocketBase::GetTcpNoDelay ( void  ) const
protectedvirtual

Implements ns3::TcpSocket.

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

References m_noDelay.

uint32_t ns3::TcpSocketBase::GetTxAvailable ( void  ) const
virtual

Inherit from Socket class: Get the max number of bytes an app can send

Implements ns3::Socket.

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

References ns3::TcpTxBuffer::Available(), m_txBuffer, and NS_LOG_FUNCTION.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

This method returns the TypeId associated to ns3::TcpSocketBase.

Attributes defined for this type:

  • MaxSegLifetime: Maximum segment lifetime in seconds, use for TIME_WAIT state transition to CLOSED state
    • Set with class: ns3::DoubleValue
    • Underlying type: double 0:1.79769e+308
    • Initial value: 120
    • Flags: construct write read
  • MaxWindowSize: Max size of advertised window

Attributes defined in parent class ns3::TcpSocket:

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

TraceSources defined for this type:

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

Reimplemented from ns3::TcpSocket.

Reimplemented in ns3::TcpTahoe, ns3::TcpRfc793, ns3::TcpReno, and ns3::TcpNewReno.

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

References m_highTxMark, m_lastRtt, m_maxWinSize, m_msl, m_nextTxSequence, m_rto, m_rWnd, m_state, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::TcpSocketBase::LastAckTimeout ( void  )
protectedvirtual

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

References ns3::EventId::Cancel(), CloseAndNotify(), ns3::LAST_ACK, m_closeNotified, m_lastAckEvent, m_state, and NS_LOG_FUNCTION.

Referenced by DoPeerClose().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Implements ns3::Socket.

Reimplemented in ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.

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

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

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

Tell if a sequence number range is out side the range that my rx buffer can accpet

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

References ns3::CLOSE_WAIT, ns3::CLOSING, ns3::LAST_ACK, ns3::LISTEN, m_rxBuffer, m_state, ns3::TcpRxBuffer::MaxRxSequence(), ns3::TcpRxBuffer::NextRxSequence(), ns3::SYN_RCVD, and ns3::SYN_SENT.

Referenced by DoForwardUp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Peer sent me a FIN. Remember its sequence in rx buffer.

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

References ns3::CLOSING, DoPeerClose(), ns3::FIN_WAIT_1, ns3::TcpRxBuffer::Finished(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), m_rxBuffer, m_state, ns3::TcpRxBuffer::MaxRxSequence(), ns3::TcpRxBuffer::NextRxSequence(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ReceivedData(), and ns3::TcpRxBuffer::SetFinSequence().

Referenced by ProcessEstablished(), and ProcessSynRcvd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Received a packet upon ESTABLISHED state. This function is mimicking the role of tcp_rcv_established() in tcp_input.c in Linux kernel.

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

References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpRxBuffer::Finished(), ns3::TcpHeader::GetFlags(), m_rxBuffer, NS_LOG_FUNCTION, NS_LOG_LOGIC, PeerClose(), ns3::TcpHeader::PSH, ReceivedAck(), ReceivedData(), ns3::TcpHeader::RST, SendRST(), 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:

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

Received a packet upon LISTEN state.

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

References CompleteFork(), 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:

void ns3::TcpSocketBase::ReadOptions ( const TcpHeader )
protectedvirtual

Placeholder function for future extension that reads more from the TCP header

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

Referenced by DoForwardUp().

+ Here is the caller graph for this function:

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

Process the newly received ACK

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

References ns3::TcpHeader::ACK, DupAck(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::Packet::GetSize(), ns3::TcpTxBuffer::HeadSequence(), m_dupAckCount, m_nextTxSequence, m_txBuffer, NewAck(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ReceivedData().

Referenced by ProcessEstablished(), ProcessSynRcvd(), and ProcessWait().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Inherit from Socket class: Return data to upper-layer application. Parameter flags is not used. Data is returned as a packet of size no larger than maxSize

Implements ns3::Socket.

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

References ns3::Packet::AddPacketTag(), ns3::CLOSE_WAIT, ns3::TcpRxBuffer::Extract(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Packet::GetSize(), m_endPoint, m_endPoint6, m_rxBuffer, m_state, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, ns3::SocketAddressTag::SetAddress(), and ns3::TcpRxBuffer::Size().

+ Here is the call graph for this function:

Ptr< Packet > ns3::TcpSocketBase::RecvFrom ( uint32_t  maxSize,
uint32_t  flags,
Address fromAddress 
)
virtual
void ns3::TcpSocketBase::Retransmit ( void  )
protectedvirtual

Reimplemented in ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.

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

References DoRetransmit(), ns3::TcpTxBuffer::HeadSequence(), ns3::RttEstimator::IncreaseMultiplier(), m_dupAckCount, m_nextTxSequence, m_rtt, and m_txBuffer.

Referenced by ReTxTimeout().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::ReTxTimeout ( void  )
protectedvirtual

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

References ns3::CLOSED, ns3::ESTABLISHED, ns3::TcpTxBuffer::HeadSequence(), m_highTxMark, m_state, m_txBuffer, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, Retransmit(), and ns3::TIME_WAIT.

Referenced by NewAck(), and SendDataPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Inherit from Socket class: Send a packet. Parameter flags is not used. Packet has no TCP header. Invoked by upper-layer application

Implements ns3::Socket.

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

References ns3::TcpTxBuffer::Add(), ns3::CLOSE_WAIT, ns3::Socket::ERROR_MSGSIZE, ns3::Socket::ERROR_NOTCONN, ns3::ESTABLISHED, ns3::Packet::GetSize(), m_connected, m_errno, m_state, m_txBuffer, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, NS_LOG_LOGIC, SendPendingData(), ns3::TcpTxBuffer::Size(), ns3::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:

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

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

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

References ns3::TcpHeader::ACK, AddOptions(), AdvertisedWindowSize(), ns3::CLOSE_WAIT, ns3::TcpTxBuffer::CopyFromSequence(), ns3::ESTABLISHED, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, ns3::TracedValue< T >::Get(), 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::Packet::GetSize(), ns3::EventId::IsExpired(), ns3::LAST_ACK, ns3::Socket::m_boundnetdevice, m_closeOnEmpty, m_endPoint, m_endPoint6, m_highTxMark, m_nextTxSequence, m_retxEvent, m_rto, m_rtt, m_rxBuffer, m_state, m_tcp, m_txBuffer, ns3::TcpRxBuffer::NextRxSequence(), ns3::Socket::NotifyDataSent(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::RttEstimator::RetransmitTimeout(), ReTxTimeout(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::TcpL4Protocol::SendPacket(), ns3::RttEstimator::SentSeq(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), and ns3::TcpTxBuffer::SizeFromSequence().

Referenced by DoRetransmit(), ns3::TcpNewReno::DupAck(), and SendPendingData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::TcpSocketBase::SendPendingData ( bool  withAck = false)
protected

Send as much pending data as possible according to the Tx window. Note that this function did not implement the PSH flag

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

References AvailableWindow(), ns3::Socket::ERROR_SHUTDOWN, ns3::TcpTxBuffer::HeadSequence(), m_endPoint, m_endPoint6, m_errno, m_nextTxSequence, m_noDelay, m_rWnd, m_segmentSize, m_shutdownSend, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, SendDataPacket(), ns3::TcpTxBuffer::Size(), ns3::TcpTxBuffer::SizeFromSequence(), UnAckDataCount(), and visualizer.higcontainer::w.

Referenced by ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), NewAck(), ProcessSynSent(), and Send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::TcpSocketBase::SendRST ( void  )
protected

This function closes the endpoint completely. Called upon RST_TX action.

Definition at line 1569 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:

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

Inherit from Socket class: In TcpSocketBase, it is same as Send() call

Implements ns3::Socket.

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

References Send().

+ Here is the call graph for this function:

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

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 2268 of file tcp-socket-base.cc.

void ns3::TcpSocketBase::SetConnCount ( uint32_t  count)
protectedvirtual

Implements ns3::TcpSocket.

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

References m_cnRetries.

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

Implements ns3::TcpSocket.

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

References m_cnTimeout, and timeout.

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

Implements ns3::TcpSocket.

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

References m_delAckMaxCount.

Referenced by ns3::TcpRfc793::TcpRfc793().

+ Here is the caller graph for this function:

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

Implements ns3::TcpSocket.

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

References m_delAckTimeout, and timeout.

virtual void ns3::TcpSocketBase::SetInitialCwnd ( uint32_t  cwnd)
protectedpure virtual
void ns3::TcpSocketBase::SetNode ( Ptr< Node node)
virtual

Associate a node with this TCP socket

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

References m_node.

Referenced by ns3::TcpL4Protocol::CreateSocket().

+ Here is the caller graph for this function:

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

Implements ns3::TcpSocket.

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

References m_persistTimeout, and timeout.

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

Implements ns3::TcpSocket.

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

References m_rxBuffer, and ns3::TcpRxBuffer::SetMaxBufferSize().

+ Here is the call graph for this function:

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

Set an RTT estimator with this socket

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

References m_rtt.

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

Implements ns3::TcpSocket.

Reimplemented in ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.

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

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

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

Below are the attribute get/set functions

Implements ns3::TcpSocket.

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

References m_txBuffer, and ns3::TcpTxBuffer::SetMaxBufferSize().

+ Here is the call graph for this function:

virtual void ns3::TcpSocketBase::SetSSThresh ( uint32_t  threshold)
protectedpure virtual
void ns3::TcpSocketBase::SetTcp ( Ptr< TcpL4Protocol tcp)
virtual

Associate the L4 protocol (e.g. mux/demux) with this socket

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

References m_tcp.

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

Implements ns3::TcpSocket.

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

References m_noDelay.

int ns3::TcpSocketBase::SetupCallback ( void  )
protected

Clean up after Bind. Set up callback functions in the end-point.

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

References Destroy(), Destroy6(), ForwardUp(), ForwardUp6(), m_endPoint, m_endPoint6, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::Ipv4EndPoint::SetDestroyCallback(), ns3::Ipv6EndPoint::SetDestroyCallback(), 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:

int ns3::TcpSocketBase::SetupEndpoint ( void  )
protected

Configure the endpoint to a local address. Called by Connect() if Bind() didn't specify one.

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

References ns3::Object::GetObject(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv4::GetRoutingProtocol(), ns3::Ipv4Route::GetSource(), 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::Ipv4RoutingProtocol::RouteOutput(), 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:

int ns3::TcpSocketBase::SetupEndpoint6 ( void  )
protected
int ns3::TcpSocketBase::ShutdownRecv ( void  )
virtual

Inherit from Socket class: Signal a termination of receive

Implements ns3::Socket.

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

References m_shutdownRecv, and NS_LOG_FUNCTION.

int ns3::TcpSocketBase::ShutdownSend ( void  )
virtual

Inherit from Socket class: Signal a termination of send

Implements ns3::Socket.

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

References m_shutdownSend, and NS_LOG_FUNCTION.

void ns3::TcpSocketBase::TimeWait ( void  )
protected

Move TCP to Time_Wait state and schedule a transition to Closed state

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

References CancelAllTimers(), CloseAndNotify(), m_msl, m_state, m_timewaitEvent, NS_LOG_INFO, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::TcpSocket::TcpStateName, and ns3::TIME_WAIT.

Referenced by ProcessClosing(), and ProcessWait().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References ns3::TracedValue< T >::Get(), ns3::TcpTxBuffer::HeadSequence(), m_nextTxSequence, m_txBuffer, and NS_LOG_FUNCTION.

Referenced by AvailableWindow(), and SendPendingData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented in ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.

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

References m_rWnd, and NS_LOG_FUNCTION.

Referenced by AvailableWindow().

+ Here is the caller graph for this function:

Member Data Documentation

bool ns3::TcpSocketBase::m_closeNotified
protected

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

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

bool ns3::TcpSocketBase::m_closeOnEmpty
protected

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

Referenced by Close(), and SendDataPacket().

uint32_t ns3::TcpSocketBase::m_cnCount
protected
uint32_t ns3::TcpSocketBase::m_cnRetries
protected
Time ns3::TcpSocketBase::m_cnTimeout
protected

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

Referenced by GetConnTimeout(), SendEmptyPacket(), and SetConnTimeout().

bool ns3::TcpSocketBase::m_connected
protected
uint32_t ns3::TcpSocketBase::m_delAckCount
protected
EventId ns3::TcpSocketBase::m_delAckEvent
protected

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

Referenced by CancelAllTimers(), ReceivedData(), and SendEmptyPacket().

uint32_t ns3::TcpSocketBase::m_delAckMaxCount
protected
Time ns3::TcpSocketBase::m_delAckTimeout
protected

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

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

uint32_t ns3::TcpSocketBase::m_dupAckCount
protected

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

Referenced by ReceivedAck(), and Retransmit().

enum SocketErrno ns3::TcpSocketBase::m_errno
protected
EventId ns3::TcpSocketBase::m_lastAckEvent
protected

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

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

TracedValue<Time> ns3::TcpSocketBase::m_lastRtt
protected

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

Referenced by EstimateRtt(), and GetTypeId().

uint16_t ns3::TcpSocketBase::m_maxWinSize
protected

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

Referenced by AdvertisedWindowSize(), and GetTypeId().

double ns3::TcpSocketBase::m_msl
protected

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

Referenced by GetTypeId(), and TimeWait().

Ptr<Node> ns3::TcpSocketBase::m_node
protected

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

Referenced by GetNode(), SetNode(), SetupEndpoint(), SetupEndpoint6(), and ~TcpSocketBase().

bool ns3::TcpSocketBase::m_noDelay
protected

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

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

EventId ns3::TcpSocketBase::m_persistEvent
protected

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

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

Time ns3::TcpSocketBase::m_persistTimeout
protected

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

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

EventId ns3::TcpSocketBase::m_retxEvent
protected
TracedValue<Time> ns3::TcpSocketBase::m_rto
protected

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

Referenced by GetTypeId(), NewAck(), SendDataPacket(), and SendEmptyPacket().

TracedValue<uint32_t> ns3::TcpSocketBase::m_rWnd
protected
bool ns3::TcpSocketBase::m_shutdownRecv
protected

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

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

bool ns3::TcpSocketBase::m_shutdownSend
protected

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

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

EventId ns3::TcpSocketBase::m_timewaitEvent
protected

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

Referenced by CancelAllTimers(), and TimeWait().


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