A base class for implementation of a stream socket using TCP. More...
#include <tcp-socket-base.h>
Public Member Functions | |
TcpSocketBase (void) | |
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... | |
virtual | ~TcpSocketBase (void) |
virtual int | Bind (void) |
Allocate a local IPv4 endpoint for this socket. More... | |
virtual int | Bind (const Address &address) |
Allocate a local endpoint for this socket. More... | |
virtual int | Bind6 (void) |
Allocate a local IPv6 endpoint for this socket. More... | |
virtual void | BindToNetDevice (Ptr< NetDevice > netdevice) |
Bind a socket to specific device. More... | |
virtual int | Close (void) |
Close a socket. More... | |
virtual int | Connect (const Address &address) |
Initiate a connection to a remote host. More... | |
Time | GetClockGranularity (void) const |
Get the Clock Granularity (used in RTO calcs). More... | |
virtual enum SocketErrno | GetErrno (void) const |
Get last error number. More... | |
Time | GetMinRto (void) const |
Get the Minimum RTO. More... | |
virtual Ptr< Node > | GetNode (void) const |
Return the node this socket is associated with. More... | |
virtual uint32_t | GetRxAvailable (void) const |
Return number of bytes which can be returned from one or multiple calls to Recv. More... | |
Ptr< TcpRxBuffer > | GetRxBuffer (void) const |
Get a pointer to the Rx buffer. More... | |
virtual enum SocketType | GetSocketType (void) const |
virtual int | GetSockName (Address &address) const |
Get socket address. More... | |
virtual uint32_t | GetTxAvailable (void) const |
Returns the number of bytes which can be sent in a single call to Send. More... | |
Ptr< TcpTxBuffer > | GetTxBuffer (void) const |
Get a pointer to the Tx buffer. More... | |
virtual int | Listen (void) |
Listen for incoming connections. More... | |
virtual Ptr< Packet > | Recv (uint32_t maxSize, uint32_t flags) |
Read data from the socket. More... | |
virtual Ptr< Packet > | RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress) |
Read a single packet from the socket and retrieve the sender address. More... | |
virtual int | Send (Ptr< Packet > p, uint32_t flags) |
Send data (or dummy data) to the remote host. More... | |
virtual int | SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress) |
Send data to a specified peer. More... | |
void | SetClockGranularity (Time clockGranularity) |
Sets the Clock Granularity (used in RTO calcs). More... | |
void | SetMinRto (Time minRto) |
Sets the Minimum RTO. More... | |
virtual void | SetNode (Ptr< Node > node) |
Set the associated node. 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... | |
virtual int | ShutdownRecv (void) |
virtual int | ShutdownSend (void) |
![]() | |
TcpSocket (void) | |
virtual | ~TcpSocket (void) |
![]() | |
Socket (void) | |
virtual | ~Socket (void) |
Ptr< NetDevice > | GetBoundNetDevice () |
Returns socket's bound netdevice, if any. More... | |
uint8_t | GetIpTos (void) const |
Query the value of IP Type of Service of this socket. More... | |
virtual uint8_t | GetIpTtl (void) const |
Query the value of IP Time to Live field of this socket. More... | |
virtual uint8_t | GetIpv6HopLimit (void) const |
Query the value of IP Hop Limit field of this socket. More... | |
uint8_t | GetIpv6Tclass (void) const |
Query the value of IPv6 Traffic Class field of this socket. More... | |
bool | IsIpRecvTos (void) const |
Ask if the socket is currently passing information about IP Type of Service up the stack. More... | |
bool | IsIpRecvTtl (void) const |
Ask if the socket is currently passing information about IP_TTL up the stack. More... | |
bool | IsIpv6RecvHopLimit (void) const |
Ask if the socket is currently passing information about IPv6 Hop Limit up the stack. More... | |
bool | IsIpv6RecvTclass (void) 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< Packet > | Recv (void) |
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< Packet > | RecvFrom (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 (Ptr< Packet > p) |
Send data (or dummy data) to the remote host. More... | |
int | Send (const uint8_t *buf, uint32_t size, uint32_t flags) |
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 | SetRecvCallback (Callback< void, Ptr< Socket > >) |
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... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static Ptr< Socket > | CreateSocket (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 (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | AddOptions (TcpHeader &tcpHeader) |
Add options to TcpHeader. 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... | |
virtual uint16_t | AdvertisedWindowSize (void) |
The amount of Rx window announced to the peer. More... | |
virtual uint32_t | AvailableWindow (void) |
Return unfilled portion of window. More... | |
virtual uint32_t | BytesInFlight (void) |
Return total bytes in flight. More... | |
uint8_t | CalculateWScale () const |
Calculate window scale value based on receive buffer space. More... | |
void | CancelAllTimers (void) |
Cancel all timer when endpoint is deleted. More... | |
void | CloseAndNotify (void) |
Peacefully close the socket by notifying the upper layer and deallocate end point. More... | |
void | CompleteFork (Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) |
Complete a connection by forking the socket. More... | |
void | ConnectionSucceeded (void) |
Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded() More... | |
void | DeallocateEndPoint (void) |
Deallocate m_endPoint and m_endPoint6. More... | |
virtual void | DelAckTimeout (void) |
Action upon delay ACK timeout, i.e. More... | |
void | Destroy (void) |
Kill this socket by zeroing its attributes (IPv4) More... | |
void | Destroy6 (void) |
Kill this socket by zeroing its attributes (IPv6) More... | |
int | DoClose (void) |
Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state. More... | |
int | DoConnect (void) |
Perform the real connection tasks: Send SYN if allowed, RST if invalid. More... | |
virtual void | DoForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface) |
Called by TcpSocketBase::ForwardUp(). More... | |
virtual void | DoForwardUp (Ptr< Packet > packet, Ipv6Header header, uint16_t port) |
Called by TcpSocketBase::ForwardUp6(). More... | |
void | DoPeerClose (void) |
FIN is in sequence, notify app and respond with a FIN. More... | |
virtual void | DoRetransmit (void) |
Retransmit the oldest packet. More... | |
virtual void | DupAck (const TcpHeader &tcpHeader, uint32_t count)=0 |
Received dupack (duplicate ACK) More... | |
virtual void | EstimateRtt (const TcpHeader &tcpHeader) |
Take into account the packet for RTT estimation. More... | |
virtual Ptr< TcpSocketBase > | Fork (void)=0 |
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... | |
virtual bool | GetAllowBroadcast (void) const |
Query whether broadcast datagram transmissions are allowed. More... | |
virtual uint32_t | GetConnCount (void) const |
Get the number of connection retries before giving up. More... | |
virtual Time | GetConnTimeout (void) const |
Get the connection timeout. More... | |
virtual uint32_t | GetDelAckMaxCount (void) const |
Get the number of packet to fire an ACK before delay timeout. More... | |
virtual Time | GetDelAckTimeout (void) const |
Get the time to delay an ACK. More... | |
virtual uint32_t | GetInitialCwnd (void) const =0 |
Get the initial Congestion Window. More... | |
virtual uint32_t | GetInitialSSThresh (void) const =0 |
Get the initial Slow Start Threshold. More... | |
virtual Time | GetPersistTimeout (void) const |
Get the timout for persistent connection. More... | |
virtual uint32_t | GetRcvBufSize (void) const |
Get the receive buffer size. More... | |
virtual uint32_t | GetSegSize (void) const |
Get the segment size. More... | |
virtual uint32_t | GetSndBufSize (void) const |
Get the send buffer size. More... | |
virtual bool | GetTcpNoDelay (void) const |
Check if Nagle's algorithm is enabled or not. More... | |
virtual void | LastAckTimeout (void) |
Timeout at LAST_ACK, close the connection. More... | |
virtual void | NewAck (SequenceNumber32 const &seq) |
Update buffers w.r.t. 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 (void) |
Send 1 byte probe to get an updated window size. 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... | |
void | ProcessOptionTimestamp (const Ptr< const TcpOption > option) |
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... | |
virtual void | ReadOptions (const TcpHeader &tcpHeader) |
Read TCP options from incoming packets. 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 | Retransmit (void) |
Halving cwnd and call DoRetransmit() More... | |
virtual void | ReTxTimeout (void) |
Call Retransmit() upon RTO event. More... | |
virtual void | ScaleSsThresh (uint8_t scaleFactor)=0 |
Scale the initial SsThresh value to the correct one. More... | |
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... | |
void | SendEmptyPacket (uint8_t flags) |
Send a empty packet that carries a flag, e.g. More... | |
bool | SendPendingData (bool withAck=false) |
Send as much pending data as possible according to the Tx window. More... | |
void | SendRST (void) |
Send reset and tear down this socket. More... | |
virtual bool | SetAllowBroadcast (bool allowBroadcast) |
Configure whether broadcast datagram transmissions are allowed. More... | |
virtual void | SetConnCount (uint32_t count) |
Set the number of connection retries before giving up. More... | |
virtual void | SetConnTimeout (Time timeout) |
Set the connection timeout. More... | |
virtual void | SetDelAckMaxCount (uint32_t count) |
Set the number of packet to fire an ACK before delay timeout. More... | |
virtual void | SetDelAckTimeout (Time timeout) |
Set the time to delay an ACK. More... | |
virtual void | SetInitialCwnd (uint32_t cwnd)=0 |
Set the initial Congestion Window. More... | |
virtual void | SetInitialSSThresh (uint32_t threshold)=0 |
Set the initial Slow Start Threshold. More... | |
virtual void | SetPersistTimeout (Time timeout) |
Set the timout for persistent connection. More... | |
virtual void | SetRcvBufSize (uint32_t size) |
Set the receive buffer size. More... | |
virtual void | SetSegSize (uint32_t size) |
Set the segment size. More... | |
virtual void | SetSndBufSize (uint32_t size) |
Set the send buffer size. More... | |
virtual void | SetTcpNoDelay (bool noDelay) |
Enable/Disable Nagle's algorithm. More... | |
int | SetupCallback (void) |
Common part of the two Bind(), i.e. More... | |
int | SetupEndpoint (void) |
Configure the endpoint to a local address. More... | |
int | SetupEndpoint6 (void) |
Configure the endpoint v6 to a local address. More... | |
void | TimeWait (void) |
Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state. More... | |
virtual uint32_t | UnAckDataCount (void) |
Return count of number of unacked bytes. 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 (void)=0 |
Return the max possible number of unacked bytes. More... | |
![]() | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
bool | IsManualIpTos (void) const |
Checks if the socket has a specific IPv4 ToS set. More... | |
bool | IsManualIpTtl (void) const |
Checks if the socket has a specific IPv4 TTL set. More... | |
bool | IsManualIpv6HopLimit (void) const |
Checks if the socket has a specific IPv6 Hop Limit set. More... | |
bool | IsManualIpv6Tclass (void) const |
Checks if the socket has a specific IPv6 Tclass set. More... | |
void | NotifyConnectionFailed (void) |
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 (void) |
Notify through the callback (if set) that the connection has been established. More... | |
void | NotifyDataRecv (void) |
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 (void) |
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 (void) |
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... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Protected Attributes | |
Time | m_clockGranularity |
Clock Granularity used in RTO calcs. More... | |
bool | m_closeNotified |
Told app to close socket. More... | |
bool | m_closeOnEmpty |
Close socket upon tx buffer emptied. More... | |
uint32_t | m_cnCount |
Count of remaining connection retries. More... | |
uint32_t | m_cnRetries |
Number of connection retries before giving up. More... | |
Time | m_cnTimeout |
Timeout for connection retry. More... | |
bool | m_connected |
Connection established. More... | |
uint32_t | m_delAckCount |
Delayed ACK counter. More... | |
EventId | m_delAckEvent |
Delayed ACK timeout event. More... | |
uint32_t | m_delAckMaxCount |
Number of packet to fire an ACK before delay timeout. More... | |
Time | m_delAckTimeout |
Time to delay an ACK. More... | |
uint32_t | m_dupAckCount |
Dupack counter. More... | |
Ipv4EndPoint * | m_endPoint |
the IPv4 endpoint More... | |
Ipv6EndPoint * | m_endPoint6 |
the IPv6 endpoint More... | |
enum SocketErrno | m_errno |
Socket error code. More... | |
TracedValue< SequenceNumber32 > | m_highRxAckMark |
Highest ack received. More... | |
TracedValue< SequenceNumber32 > | m_highRxMark |
Highest seqno received. More... | |
TracedValue< SequenceNumber32 > | m_highTxMark |
Highest seqno ever sent, regardless of ReTx. More... | |
RttHistory_t | m_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... | |
EventId | m_lastAckEvent |
Last ACK timeout event. More... | |
TracedValue< Time > | m_lastRtt |
Last RTT sample collected. More... | |
uint16_t | m_maxWinSize |
Maximum window size to advertise. More... | |
Time | m_minRto |
minimum value of the Retransmit timeout More... | |
double | m_msl |
Max segment lifetime. More... | |
TracedValue< SequenceNumber32 > | m_nextTxSequence |
Next seqnum to be sent (SND.NXT), ReTx pushes it back. More... | |
Ptr< Node > | m_node |
the associated node More... | |
bool | m_noDelay |
Set to true to disable Nagle's algorithm. More... | |
EventId | m_persistEvent |
Persist event: Send 1 byte to probe for a non-zero Rx window. More... | |
Time | m_persistTimeout |
Time between sending 1-byte probes. More... | |
uint8_t | m_rcvScaleFactor |
Received Window Scale (i.e., the one of the peer) More... | |
EventId | m_retxEvent |
Retransmission event. More... | |
TracedValue< Time > | m_rto |
Retransmit timeout. More... | |
Ptr< RttEstimator > | m_rtt |
Round trip time estimator. More... | |
TracedValue< uint32_t > | m_rWnd |
Receiver window (RCV.WND in RFC793) More... | |
Ptr< TcpRxBuffer > | m_rxBuffer |
Rx buffer (reordering buffer) More... | |
uint32_t | m_segmentSize |
Segment size. More... | |
EventId | m_sendPendingDataEvent |
micro-delay event to send pending data More... | |
bool | m_shutdownRecv |
Receive no longer allowed. More... | |
bool | m_shutdownSend |
Send no longer allowed. More... | |
uint8_t | m_sndScaleFactor |
Sent Window Scale (i.e., the one of the node) More... | |
TracedValue< TcpStates_t > | m_state |
TCP state. More... | |
Ptr< TcpL4Protocol > | m_tcp |
the associated TCP L4 protocol More... | |
bool | m_timestampEnabled |
Timestamp option enabled. More... | |
uint32_t | m_timestampToEcho |
Timestamp to echo. More... | |
EventId | m_timewaitEvent |
TIME_WAIT expiration event: Move this socket to CLOSED state. More... | |
Ptr< TcpTxBuffer > | m_txBuffer |
Tx buffer. More... | |
bool | m_winScalingEnabled |
Window Scale option enabled. More... | |
![]() | |
Ptr< NetDevice > | m_boundnetdevice |
the device this socket is bound to (might be null). More... | |
bool | m_recvPktInfo |
if the socket should add packet info tags to the packet forwarded to L4. More... | |
Additional Inherited Members | |
![]() | |
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 | SocketType { NS3_SOCK_STREAM, NS3_SOCK_SEQPACKET, NS3_SOCK_DGRAM, NS3_SOCK_RAW } |
Enumeration of the possible socket types. More... | |
![]() | |
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" } |
Literal names of TCP states for use in log messages. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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 of Georgia Tech. @gat ech.e du
ns3::TcpSocketBase is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 728 bytes (on a 64-bit architecture).
Definition at line 91 of file tcp-socket-base.h.
ns3::TcpSocketBase::TcpSocketBase | ( | void | ) |
Create an unbound TCP socket.
Definition at line 157 of file tcp-socket-base.cc.
References m_rxBuffer, m_txBuffer, and NS_LOG_FUNCTION.
ns3::TcpSocketBase::TcpSocketBase | ( | const TcpSocketBase & | sock | ) |
Clone a TCP socket, for use upon receiving a connection request in LISTEN state.
sock | the original Tcp Socket |
Definition at line 193 of file tcp-socket-base.cc.
References ns3::Object::CopyObject, m_rtt, m_rxBuffer, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), and ns3::Socket::SetSendCallback().
|
virtual |
Definition at line 250 of file tcp-socket-base.cc.
References CancelAllTimers(), m_endPoint, m_endPoint6, m_node, m_tcp, NS_ASSERT, and NS_LOG_FUNCTION.
|
protectedvirtual |
Add options to TcpHeader.
Test each option, and if it is enabled on our side, add it to the header
tcpHeader | TcpHeader to add options to |
Definition at line 2640 of file tcp-socket-base.cc.
References AddOptionTimestamp(), AddOptionWScale(), ns3::TcpHeader::GetFlags(), m_timestampEnabled, m_winScalingEnabled, NS_LOG_FUNCTION, and ns3::TcpHeader::SYN.
Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), and SendEmptyPacket().
|
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.
header | TcpHeader to which add the option to |
Definition at line 2734 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().
|
protected |
Add the window scale option to the header.
Calculate our factor from the rxBuffer max size, and add it to the header.
header | TcpHeader where the method should add the window scale option |
Definition at line 2702 of file tcp-socket-base.cc.
References ns3::TcpHeader::AppendOption(), CalculateWScale(), ns3::TcpHeader::GetFlags(), ns3::Node::GetId(), m_node, m_sndScaleFactor, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpHeader::SYN.
Referenced by AddOptions().
|
protectedvirtual |
The amount of Rx window announced to the peer.
Definition at line 2153 of file tcp-socket-base.cc.
References m_maxWinSize, m_rxBuffer, m_sndScaleFactor, NS_LOG_WARN, and visualizer.higcontainer::w.
Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), and SendEmptyPacket().
|
protectedvirtual |
Return unfilled portion of window.
Definition at line 2143 of file tcp-socket-base.cc.
References NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, UnAckDataCount(), and Window().
Referenced by SendPendingData().
|
virtual |
Allocate a local IPv4 endpoint for this socket.
Implements ns3::Socket.
Definition at line 324 of file tcp-socket-base.cc.
References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().
Referenced by BindToNetDevice(), and Connect().
|
virtual |
Allocate a local endpoint for this socket.
address | the address to try to allocate |
Implements ns3::Socket.
Definition at line 361 of file tcp-socket-base.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::Socket::ERROR_ADDRINUSE, ns3::Socket::ERROR_ADDRNOTAVAIL, ns3::Socket::ERROR_INVAL, ns3::Ipv4Address::GetAny(), ns3::Ipv6Address::GetAny(), ns3::InetSocketAddress::GetIpv4(), ns3::Inet6SocketAddress::GetIpv6(), ns3::InetSocketAddress::GetPort(), ns3::Inet6SocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), ns3::Inet6SocketAddress::IsMatchingType(), m_endPoint, m_endPoint6, m_errno, m_tcp, NS_LOG_FUNCTION, NS_LOG_LOGIC, port, and SetupCallback().
|
virtual |
Allocate a local IPv6 endpoint for this socket.
Implements ns3::Socket.
Definition at line 342 of file tcp-socket-base.cc.
References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint6, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().
Referenced by BindToNetDevice(), and Connect().
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.
netdevice | Pointer to Netdevice of desired interface |
Reimplemented from ns3::Socket.
Definition at line 730 of file tcp-socket-base.cc.
References Bind(), Bind6(), ns3::Ipv4EndPoint::BindToNetDevice(), ns3::Ipv6EndPoint::BindToNetDevice(), ns3::Socket::BindToNetDevice(), m_endPoint, m_endPoint6, NS_ASSERT, and NS_LOG_FUNCTION.
|
protectedvirtual |
Return total bytes in flight.
Definition at line 2136 of file tcp-socket-base.cc.
References ns3::TracedValue< T >::Get(), 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().
|
protected |
Calculate window scale value based on receive buffer space.
Calculate our factor from the rxBuffer max size
Definition at line 2678 of file tcp-socket-base.cc.
References ns3::Node::GetId(), m_maxWinSize, m_node, m_rxBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
Referenced by AddOptionWScale().
|
protected |
Cancel all timer when endpoint is deleted.
Definition at line 2463 of file tcp-socket-base.cc.
References ns3::EventId::Cancel(), m_delAckEvent, m_lastAckEvent, m_persistEvent, m_retxEvent, m_sendPendingDataEvent, and m_timewaitEvent.
Referenced by DeallocateEndPoint(), Destroy(), Destroy6(), TimeWait(), and ~TcpSocketBase().
|
virtual |
Close a socket.
After the Close call, the socket is no longer valid, and cannot safely be used for subsequent operations.
Implements ns3::Socket.
Definition at line 524 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(), and ns3::TcpSocket::TcpStateName.
Referenced by DoPeerClose().
|
protected |
Peacefully close the socket by notifying the upper layer and deallocate end point.
Definition at line 852 of file tcp-socket-base.cc.
References ns3::CLOSED, DeallocateEndPoint(), m_closeNotified, m_state, ns3::Socket::NotifyNormalClose(), NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpSocket::TcpStateName.
Referenced by DoClose(), DoConnect(), LastAckTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), SendEmptyPacket(), and TimeWait().
|
protected |
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.
p | the packet triggering the fork |
tcpHeader | the TCP header of the triggering packet |
fromAddress | the address of the remote host |
toAddress | the address the connection is directed to |
Definition at line 1888 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, 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, m_state, m_tcp, NS_LOG_INFO, SendEmptyPacket(), SetupCallback(), ns3::TcpHeader::SYN, and ns3::SYN_RCVD.
Referenced by ProcessListen().
|
virtual |
Initiate a connection to a remote host.
address | Address of remote. |
Implements ns3::Socket.
Reimplemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Definition at line 435 of file tcp-socket-base.cc.
References Bind(), Bind6(), ns3::InetSocketAddress::ConvertFrom(), ns3::Inet6SocketAddress::ConvertFrom(), DoConnect(), ns3::Socket::ERROR_INVAL, ns3::InetSocketAddress::GetIpv4(), ns3::Ipv6Address::GetIpv4MappedAddress(), ns3::Inet6SocketAddress::GetIpv6(), ns3::InetSocketAddress::GetPort(), ns3::Inet6SocketAddress::GetPort(), ns3::Ipv6Address::IsIpv4MappedAddress(), ns3::InetSocketAddress::IsMatchingType(), ns3::Inet6SocketAddress::IsMatchingType(), m_cnCount, m_cnRetries, m_endPoint, m_endPoint6, m_errno, m_rtt, NS_ASSERT, NS_LOG_FUNCTION, ns3::Ipv4EndPoint::SetPeer(), ns3::Ipv6EndPoint::SetPeer(), SetupEndpoint(), and SetupEndpoint6().
Referenced by ns3::TcpNewReno::Connect(), ns3::TcpReno::Connect(), ns3::TcpTahoe::Connect(), and ns3::TcpWestwood::Connect().
|
protected |
Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded()
Definition at line 1922 of file tcp-socket-base.cc.
References GetTxAvailable(), ns3::Socket::NotifyConnectionSucceeded(), and ns3::Socket::NotifySend().
Referenced by ProcessSynSent().
|
protected |
Deallocate m_endPoint and m_endPoint6.
Definition at line 1793 of file tcp-socket-base.cc.
References CancelAllTimers(), m_endPoint, m_endPoint6, m_tcp, ns3::Ipv4EndPoint::SetDestroyCallback(), and ns3::Ipv6EndPoint::SetDestroyCallback().
Referenced by CloseAndNotify(), and SendRST().
|
protectedvirtual |
Action upon delay ACK timeout, i.e.
send an ACK
Definition at line 2357 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, m_delAckCount, and SendEmptyPacket().
Referenced by ReceivedData().
|
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 1623 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().
|
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 1644 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().
|
protected |
Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state.
Definition at line 810 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().
|
protected |
Perform the real connection tasks: Send SYN if allowed, RST if invalid.
Definition at line 787 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().
|
protectedvirtual |
Called by TcpSocketBase::ForwardUp().
packet | the incoming packet |
header | the packet's IPv4 header |
port | the remote port |
incomingInterface | the incoming interface |
Definition at line 933 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::EventId::IsRunning(), ns3::LAST_ACK, ns3::LISTEN, ns3::Socket::m_boundnetdevice, m_endPoint, m_nextTxSequence, m_persistEvent, m_rWnd, m_rxBuffer, m_state, m_tcp, NS_LOG_ERROR, NS_LOG_LOGIC, OutOfRange(), port, ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessListen(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpHeader::PSH, ReadOptions(), ns3::Packet::RemoveHeader(), ns3::TcpHeader::RST, SendEmptyPacket(), 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, UpdateWindowSize(), and ns3::TcpHeader::URG.
Referenced by ForwardUp(), and ForwardUp6().
|
protectedvirtual |
Called by TcpSocketBase::ForwardUp6().
packet | the incoming packet |
header | the packet's IPv6 header |
port | the remote port |
Definition at line 1040 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::Ipv6Header::GetDestinationAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Packet::GetSize(), ns3::Ipv6Header::GetSourceAddress(), ns3::EventId::IsRunning(), ns3::LAST_ACK, ns3::LISTEN, ns3::Socket::m_boundnetdevice, m_endPoint6, m_nextTxSequence, m_persistEvent, m_rWnd, m_rxBuffer, m_state, m_tcp, NS_LOG_ERROR, NS_LOG_LOGIC, OutOfRange(), port, ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessListen(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpHeader::PSH, ReadOptions(), ns3::Packet::RemoveHeader(), ns3::TcpHeader::RST, SendEmptyPacket(), 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, UpdateWindowSize(), and ns3::TcpHeader::URG.
|
protected |
FIN is in sequence, notify app and respond with a FIN.
Definition at line 1584 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, Close(), ns3::CLOSE_WAIT, ns3::ESTABLISHED, ns3::LAST_ACK, LastAckTimeout(), m_clockGranularity, m_closeNotified, m_lastAckEvent, m_rtt, m_shutdownSend, m_state, ns3::Max(), ns3::Socket::NotifyNormalClose(), NS_ASSERT, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Simulator::Schedule(), SendEmptyPacket(), ns3::SYN_RCVD, and ns3::TcpSocket::TcpStateName.
Referenced by PeerClose(), and ReceivedData().
|
protectedvirtual |
Retransmit the oldest packet.
Definition at line 2429 of file tcp-socket-base.cc.
References ns3::CLOSING, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, m_cnCount, m_nextTxSequence, m_segmentSize, m_state, m_txBuffer, ns3::Socket::NotifyConnectionFailed(), NS_LOG_FUNCTION, NS_LOG_LOGIC, SendDataPacket(), SendEmptyPacket(), ns3::TcpHeader::SYN, and ns3::SYN_SENT.
Referenced by ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpTahoe::DupAck(), ns3::TcpWestwood::DupAck(), ns3::TcpNewReno::NewAck(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpWestwood::Retransmit(), and Retransmit().
|
protectedpure virtual |
Received dupack (duplicate ACK)
tcpHeader | the packet's TCP header |
count | counter of duplicate ACKs |
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
Referenced by ReceivedAck().
|
protectedvirtual |
Take into account the packet for RTT estimation.
Estimate the RTT.
tcpHeader | the packet's TCP header |
Called by ForwardUp() to estimate RTT.
tcpHeader | TCP header for the incoming packet |
Reimplemented in ns3::TcpWestwood.
Definition at line 2233 of file tcp-socket-base.cc.
References ns3::RttHistory::count, ns3::TcpOptionTS::ElapsedTimeFromTsValue(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetOption(), ns3::TcpHeader::HasOption(), ns3::Time::IsZero(), m_clockGranularity, m_history, m_lastRtt, m_minRto, m_rto, m_rtt, m_timestampEnabled, ns3::Max(), ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::RttHistory::retx, ns3::RttHistory::seq, ns3::RttHistory::time, and ns3::TcpOption::TS.
Referenced by DoForwardUp(), and ns3::TcpWestwood::EstimateRtt().
|
protectedpure virtual |
Call CopyObject<> to clone me.
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
Referenced by ProcessListen().
|
protected |
Called by the L3 protocol when it received an ICMP packet to pass on to TCP.
icmpSource | the ICMP source address |
icmpTtl | the ICMP Time to Live |
icmpType | the ICMP Type |
icmpCode | the ICMP Code |
icmpInfo | the ICMP Info |
Definition at line 904 of file tcp-socket-base.cc.
References m_icmpCallback, and NS_LOG_FUNCTION.
Referenced by SetupCallback().
|
protected |
Called by the L3 protocol when it received an ICMPv6 packet to pass on to TCP.
icmpSource | the ICMP source address |
icmpTtl | the ICMP Time to Live |
icmpType | the ICMP Type |
icmpCode | the ICMP Code |
icmpInfo | the ICMP Info |
Definition at line 917 of file tcp-socket-base.cc.
References m_icmpCallback6, and NS_LOG_FUNCTION.
Referenced by SetupCallback().
|
protected |
Called by the L3 protocol when it received a packet to pass on to TCP.
packet | the incoming packet |
header | the packet's IPv4 header |
port | the remote port |
incomingInterface | the incoming interface |
Definition at line 891 of file tcp-socket-base.cc.
References DoForwardUp().
Referenced by SetupCallback().
|
protected |
Called by the L3 protocol when it received a packet to pass on to TCP.
packet | the incoming packet |
header | the packet's IPv6 header |
port | the remote port |
incomingInterface | the incoming interface |
Definition at line 898 of file tcp-socket-base.cc.
References DoForwardUp().
Referenced by SetupCallback().
|
protectedvirtual |
Query whether broadcast datagram transmissions are allowed.
This method corresponds to using getsockopt() SO_BROADCAST of real network or BSD sockets.
Implements ns3::Socket.
Definition at line 2605 of file tcp-socket-base.cc.
Time ns3::TcpSocketBase::GetClockGranularity | ( | void | ) | const |
Get the Clock Granularity (used in RTO calcs).
Definition at line 2813 of file tcp-socket-base.cc.
References m_clockGranularity.
Referenced by GetTypeId().
|
protectedvirtual |
Get the number of connection retries before giving up.
Implements ns3::TcpSocket.
Definition at line 2544 of file tcp-socket-base.cc.
References m_cnRetries.
|
protectedvirtual |
Get the connection timeout.
Implements ns3::TcpSocket.
Definition at line 2532 of file tcp-socket-base.cc.
References m_cnTimeout.
|
protectedvirtual |
Get the number of packet to fire an ACK before delay timeout.
Implements ns3::TcpSocket.
Definition at line 2568 of file tcp-socket-base.cc.
References m_delAckMaxCount.
|
protectedvirtual |
Get the time to delay an ACK.
Implements ns3::TcpSocket.
Definition at line 2556 of file tcp-socket-base.cc.
References m_delAckTimeout.
|
virtual |
Get last error number.
Implements ns3::Socket.
Definition at line 302 of file tcp-socket-base.cc.
References m_errno.
|
protectedpure virtual |
Get the initial Congestion Window.
Implements ns3::TcpSocket.
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
|
protectedpure virtual |
Get the initial Slow Start Threshold.
Implements ns3::TcpSocket.
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
Time ns3::TcpSocketBase::GetMinRto | ( | void | ) | const |
Get the Minimum RTO.
Definition at line 2800 of file tcp-socket-base.cc.
References m_minRto.
Referenced by GetTypeId().
Return the node this socket is associated with.
Implements ns3::Socket.
Definition at line 316 of file tcp-socket-base.cc.
References m_node, and NS_LOG_FUNCTION_NOARGS.
|
protectedvirtual |
Get the timout for persistent connection.
When the timout 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
Implements ns3::TcpSocket.
Definition at line 2592 of file tcp-socket-base.cc.
References m_persistTimeout.
|
protectedvirtual |
Get the receive buffer size.
Implements ns3::TcpSocket.
Definition at line 2507 of file tcp-socket-base.cc.
References m_rxBuffer.
|
virtual |
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.
Implements ns3::Socket.
Definition at line 700 of file tcp-socket-base.cc.
References m_rxBuffer, and NS_LOG_FUNCTION.
Ptr< TcpRxBuffer > ns3::TcpSocketBase::GetRxBuffer | ( | void | ) | const |
Get a pointer to the Rx buffer.
Definition at line 2825 of file tcp-socket-base.cc.
References m_rxBuffer.
Referenced by GetTypeId().
|
protectedvirtual |
Get the segment size.
Implements ns3::TcpSocket.
Definition at line 2520 of file tcp-socket-base.cc.
References m_segmentSize.
|
protectedvirtual |
Get the send buffer size.
Implements ns3::TcpSocket.
Definition at line 2495 of file tcp-socket-base.cc.
References m_txBuffer.
|
virtual |
Implements ns3::Socket.
Definition at line 309 of file tcp-socket-base.cc.
References ns3::Socket::NS3_SOCK_STREAM.
|
virtual |
Get socket address.
address | the address name this socket is associated with. |
Implements ns3::Socket.
Definition at line 708 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.
|
protectedvirtual |
Check if Nagle's algorithm is enabled or not.
Implements ns3::TcpSocket.
Definition at line 2580 of file tcp-socket-base.cc.
References m_noDelay.
|
virtual |
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.
Implements ns3::Socket.
Definition at line 692 of file tcp-socket-base.cc.
References m_txBuffer, and NS_LOG_FUNCTION.
Referenced by ConnectionSucceeded(), NewAck(), and ProcessSynRcvd().
Ptr< TcpTxBuffer > ns3::TcpSocketBase::GetTxBuffer | ( | void | ) | const |
Get a pointer to the Tx buffer.
Definition at line 2819 of file tcp-socket-base.cc.
References m_txBuffer.
Referenced by GetTypeId().
|
static |
Get the type ID.
Get the type ID.
Definition at line 64 of file tcp-socket-base.cc.
References GetClockGranularity(), GetMinRto(), GetRxBuffer(), GetTxBuffer(), m_highRxAckMark, m_highRxMark, m_highTxMark, m_icmpCallback, m_icmpCallback6, m_lastRtt, m_maxWinSize, m_msl, m_nextTxSequence, m_rto, m_rWnd, m_state, m_timestampEnabled, m_winScalingEnabled, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeCallbackAccessor(), ns3::MakeCallbackChecker(), ns3::MakeDoubleAccessor(), ns3::MakePointerAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MilliSeconds(), ns3::Seconds(), SetClockGranularity(), SetMinRto(), and ns3::TypeId::SetParent().
|
protectedvirtual |
Timeout at LAST_ACK, close the connection.
Definition at line 2364 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().
|
virtual |
Listen for incoming connections.
Implements ns3::Socket.
Reimplemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Definition at line 507 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.
Referenced by ns3::TcpNewReno::Listen(), ns3::TcpReno::Listen(), ns3::TcpTahoe::Listen(), and ns3::TcpWestwood::Listen().
|
protectedvirtual |
Update buffers w.r.t.
ACK
seq | the sequence number |
Reimplemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Definition at line 2281 of file tcp-socket-base.cc.
References ns3::EventId::Cancel(), ns3::CLOSING, ns3::FIN_WAIT_1, ns3::TracedValue< T >::Get(), ns3::Simulator::GetDelayLeft(), GetTxAvailable(), ns3::EventId::IsExpired(), ns3::EventId::IsRunning(), m_clockGranularity, m_connected, m_minRto, m_nextTxSequence, m_persistEvent, m_persistTimeout, m_retxEvent, m_rto, m_rtt, m_rWnd, m_sendPendingDataEvent, m_state, m_txBuffer, ns3::Max(), ns3::Socket::NotifySend(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, PersistTimeout(), ReTxTimeout(), ns3::Simulator::Schedule(), SendPendingData(), ns3::SYN_RCVD, and ns3::TimeStep().
Referenced by ns3::TcpNewReno::NewAck(), ns3::TcpReno::NewAck(), ns3::TcpTahoe::NewAck(), ns3::TcpWestwood::NewAck(), and ReceivedAck().
|
protected |
Check if a sequence number range is within the rx window.
head | start of the Sequence window |
tail | end of the Sequence window |
Definition at line 871 of file tcp-socket-base.cc.
References ns3::CLOSE_WAIT, ns3::CLOSING, ns3::LAST_ACK, ns3::LISTEN, m_rxBuffer, m_state, ns3::SYN_RCVD, and ns3::SYN_SENT.
Referenced by DoForwardUp().
Received a FIN from peer, notify rx buffer.
p | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1547 of file tcp-socket-base.cc.
References ns3::CLOSING, DoPeerClose(), ns3::FIN_WAIT_1, ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), m_rxBuffer, m_state, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and ReceivedData().
Referenced by ProcessEstablished(), and ProcessSynRcvd().
|
protectedvirtual |
Send 1 byte probe to get an updated window size.
Definition at line 2383 of file tcp-socket-base.cc.
References AddOptions(), AdvertisedWindowSize(), 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::Socket::m_boundnetdevice, m_endPoint, m_endPoint6, m_nextTxSequence, m_persistEvent, m_persistTimeout, m_rxBuffer, m_tcp, m_txBuffer, ns3::Simulator::Now(), NS_LOG_LOGIC, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), and ns3::TcpHeader::SetWindowSize().
Referenced by NewAck().
|
protected |
Received a packet upon CLOSING.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1479 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_rxBuffer, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), TimeWait(), and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Received a packet upon ESTABLISHED state.
This function is mimicking the role of tcp_rcv_established() in tcp_input.c in Linux kernel.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1148 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, 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().
|
protected |
Received a packet upon LAST_ACK.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1511 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_rxBuffer, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ReceivedData(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Received a packet upon LISTEN state.
packet | the packet |
tcpHeader | the packet's TCP header |
fromAddress | the source address |
toAddress | the destination address |
Definition at line 1230 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().
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.
option | Option from the packet |
Definition at line 2722 of file tcp-socket-base.cc.
References ns3::Node::GetId(), m_node, m_timestampToEcho, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by ReadOptions().
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.
option | Window scale option read from the header |
Definition at line 2657 of file tcp-socket-base.cc.
References ns3::Node::GetId(), m_node, m_rcvScaleFactor, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
Referenced by ReadOptions().
|
protected |
Received a packet upon SYN_RCVD.
packet | the packet |
tcpHeader | the packet's TCP header |
fromAddress | the source address |
toAddress | the destination address |
Definition at line 1318 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::EventId::Cancel(), CloseAndNotify(), ns3::InetSocketAddress::ConvertFrom(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), GetTxAvailable(), m_connected, m_delAckCount, m_delAckMaxCount, m_endPoint, m_endPoint6, m_highTxMark, m_nextTxSequence, m_retxEvent, m_rxBuffer, m_state, m_txBuffer, ns3::Socket::NotifyNewConnectionCreated(), ns3::Socket::NotifySend(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PeerClose(), ns3::TcpHeader::PSH, ReceivedAck(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), ns3::Ipv4EndPoint::SetPeer(), ns3::Ipv6EndPoint::SetPeer(), ns3::TcpHeader::SYN, and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Received a packet upon SYN_SENT.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1260 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::EventId::Cancel(), CloseAndNotify(), ConnectionSucceeded(), ns3::ESTABLISHED, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_cnCount, m_cnRetries, m_connected, m_delAckCount, m_delAckMaxCount, m_highTxMark, m_nextTxSequence, m_retxEvent, m_rxBuffer, m_state, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ReceivedData(), ns3::TcpHeader::RST, ns3::Simulator::ScheduleNow(), SendEmptyPacket(), SendPendingData(), SendRST(), ns3::TcpHeader::SYN, ns3::SYN_RCVD, and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Received a packet upon CLOSE_WAIT, FIN_WAIT_1, FIN_WAIT_2.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 1408 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::CLOSING, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, ns3::FIN_WAIT_2, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), m_highTxMark, m_rxBuffer, m_shutdownRecv, m_state, m_txBuffer, ns3::Socket::NotifyDataRecv(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ReceivedAck(), ReceivedData(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), ns3::TcpHeader::SYN, TimeWait(), and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protectedvirtual |
Read TCP options from incoming packets.
This method sequentially checks each kind of option, and if it is present in the header, starts its processing.
To deal with hosts which don't have the option enabled (or implemented) we disable all options, and then re-enable them if in the packet there is the option itself.
tcpHeader | the packet's TCP header |
Definition at line 2611 of file tcp-socket-base.cc.
References ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetOption(), ns3::TcpHeader::HasOption(), m_sndScaleFactor, m_timestampEnabled, m_winScalingEnabled, NS_LOG_FUNCTION, ProcessOptionTimestamp(), ProcessOptionWScale(), ScaleSsThresh(), ns3::TcpHeader::SYN, ns3::TcpOption::TS, and ns3::TcpOption::WINSCALE.
Referenced by DoForwardUp().
|
protectedvirtual |
Received an ACK packet.
packet | the packet |
tcpHeader | the packet's TCP header |
Reimplemented in ns3::TcpWestwood.
Definition at line 1193 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, DupAck(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::Packet::GetSize(), m_dupAckCount, m_nextTxSequence, m_txBuffer, NewAck(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ReceivedData().
Referenced by ProcessEstablished(), ProcessSynRcvd(), ProcessWait(), and ns3::TcpWestwood::ReceivedAck().
|
protectedvirtual |
Recv of a data, put into buffer, call L7 to get it if necessary.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 2170 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::EventId::Cancel(), DelAckTimeout(), DoPeerClose(), ns3::TcpHeader::FIN, ns3::TcpHeader::GetAckNumber(), ns3::Simulator::GetDelayLeft(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), ns3::EventId::IsExpired(), m_closeNotified, m_delAckCount, m_delAckEvent, m_delAckMaxCount, m_delAckTimeout, m_rxBuffer, m_shutdownRecv, ns3::Socket::NotifyDataRecv(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Simulator::Schedule(), and SendEmptyPacket().
Referenced by PeerClose(), ProcessEstablished(), ProcessLastAck(), ProcessSynSent(), ProcessWait(), and ReceivedAck().
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.
maxSize | reader will accept packet up to maxSize |
flags | Socket control flags |
Implements ns3::Socket.
Definition at line 640 of file tcp-socket-base.cc.
References ns3::Packet::AddPacketTag(), ns3::CLOSE_WAIT, 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, and ns3::SocketAddressTag::SetAddress().
|
virtual |
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.
maxSize | reader will accept packet up to maxSize |
flags | Socket control flags |
fromAddress | output parameter that will return the address of the sender of the received packet, if any. Remains untouched if no packet is received. |
Implements ns3::Socket.
Definition at line 667 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().
|
protectedvirtual |
Halving cwnd and call DoRetransmit()
Reimplemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Definition at line 2421 of file tcp-socket-base.cc.
References DoRetransmit(), m_dupAckCount, m_nextTxSequence, and m_txBuffer.
Referenced by ReTxTimeout().
|
protectedvirtual |
Call Retransmit() upon RTO event.
Definition at line 2338 of file tcp-socket-base.cc.
References ns3::CLOSED, m_highTxMark, m_state, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, Retransmit(), and ns3::TIME_WAIT.
Referenced by NewAck(), and SendDataPacket().
|
protectedpure virtual |
Scale the initial SsThresh value to the correct one.
Set the initial SsThresh to the largest possible advertised window according to the sender scale factor.
scaleFactor | the sender scale factor |
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
Referenced by ReadOptions().
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.
p | ns3::Packet to send |
flags | Socket control flags |
Implements ns3::Socket.
Definition at line 595 of file tcp-socket-base.cc.
References ns3::CLOSE_WAIT, ns3::Socket::ERROR_MSGSIZE, ns3::Socket::ERROR_NOTCONN, ns3::Socket::ERROR_SHUTDOWN, ns3::ESTABLISHED, ns3::Packet::GetSize(), ns3::EventId::IsRunning(), m_connected, m_errno, m_sendPendingDataEvent, m_shutdownSend, m_state, m_txBuffer, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), SendPendingData(), ns3::SYN_SENT, ns3::TcpSocket::TcpStateName, and ns3::TimeStep().
Referenced by SendTo().
|
protected |
Extract at most maxSize bytes from the TxBuffer at sequence seq, add the TCP header, and send to TcpL4Protocol.
seq | the sequence number |
maxSize | the maximum data block to be transmitted (in bytes) |
withAck | forces an ACK to be sent |
Definition at line 1938 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, AddOptions(), ns3::Packet::AddPacketTag(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::CLOSE_WAIT, ns3::ESTABLISHED, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, ns3::Time::FromDouble(), ns3::TracedValue< T >::Get(), ns3::Socket::GetIpTos(), ns3::Socket::GetIpTtl(), ns3::Socket::GetIpv6HopLimit(), ns3::Socket::GetIpv6Tclass(), 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::Socket::IsManualIpTos(), ns3::Socket::IsManualIpTtl(), ns3::Socket::IsManualIpv6HopLimit(), ns3::Socket::IsManualIpv6Tclass(), ns3::LAST_ACK, ns3::Socket::m_boundnetdevice, m_closeOnEmpty, m_delAckCount, m_delAckEvent, m_endPoint, m_endPoint6, m_highTxMark, m_history, m_retxEvent, m_rto, m_rxBuffer, m_state, m_tcp, m_txBuffer, ns3::Min(), ns3::Socket::NotifyDataSent(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ReTxTimeout(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::SocketIpv6HopLimitTag::SetHopLimit(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::SocketIpv6TclassTag::SetTclass(), ns3::SocketIpTosTag::SetTos(), ns3::SocketIpTtlTag::SetTtl(), and ns3::TcpHeader::SetWindowSize().
Referenced by DoRetransmit(), ns3::TcpNewReno::DupAck(), and SendPendingData().
|
protected |
Send a empty packet that carries a flag, e.g.
ACK
flags | the packet's flags |
Definition at line 1664 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, AddOptions(), ns3::Packet::AddPacketTag(), AdvertisedWindowSize(), ns3::EventId::Cancel(), CloseAndNotify(), ns3::CLOSING, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, ns3::TracedValue< T >::Get(), ns3::Socket::GetIpTos(), ns3::Socket::GetIpTtl(), ns3::Socket::GetIpv6HopLimit(), ns3::Socket::GetIpv6Tclass(), 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::EventId::IsExpired(), ns3::Socket::IsManualIpTos(), ns3::Socket::IsManualIpTtl(), ns3::Socket::IsManualIpv6HopLimit(), ns3::Socket::IsManualIpv6Tclass(), ns3::LAST_ACK, ns3::Socket::m_boundnetdevice, m_clockGranularity, m_cnCount, m_cnRetries, m_cnTimeout, m_delAckCount, m_delAckEvent, m_endPoint, m_endPoint6, m_minRto, m_nextTxSequence, m_retxEvent, m_rto, m_rtt, m_rxBuffer, m_state, m_tcp, ns3::Max(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Simulator::Schedule(), ns3::SocketIpv6HopLimitTag::SetHopLimit(), ns3::SocketIpv6TclassTag::SetTclass(), ns3::SocketIpTosTag::SetTos(), ns3::SocketIpTtlTag::SetTtl(), and ns3::TcpHeader::SYN.
Referenced by CompleteFork(), DelAckTimeout(), DoClose(), DoConnect(), DoForwardUp(), DoPeerClose(), DoRetransmit(), ProcessClosing(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedData(), SendRST(), and ShutdownSend().
|
protected |
Send as much pending data as possible according to the Tx window.
Note that this function did not implement the PSH flag.
withAck | forces an ACK to be sent |
Definition at line 2081 of file tcp-socket-base.cc.
References AvailableWindow(), m_endPoint, m_endPoint6, m_nextTxSequence, m_noDelay, m_rWnd, m_segmentSize, m_shutdownSend, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, SendDataPacket(), UnAckDataCount(), and visualizer.higcontainer::w.
Referenced by ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpWestwood::DupAck(), NewAck(), ProcessSynSent(), and Send().
|
protected |
Send reset and tear down this socket.
Definition at line 1783 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().
|
virtual |
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.
Implements ns3::Socket.
Definition at line 632 of file tcp-socket-base.cc.
References Send().
|
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.
allowBroadcast | Whether broadcast is allowed |
Implements ns3::Socket.
Definition at line 2598 of file tcp-socket-base.cc.
void ns3::TcpSocketBase::SetClockGranularity | ( | Time | clockGranularity | ) |
Sets the Clock Granularity (used in RTO calcs).
clockGranularity | The Clock Granularity |
Definition at line 2806 of file tcp-socket-base.cc.
References m_clockGranularity, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
protectedvirtual |
Set the number of connection retries before giving up.
count | the number of connection retries |
Implements ns3::TcpSocket.
Definition at line 2538 of file tcp-socket-base.cc.
References m_cnRetries.
|
protectedvirtual |
Set the connection timeout.
timeout | the connection timeout |
Implements ns3::TcpSocket.
Definition at line 2526 of file tcp-socket-base.cc.
References m_cnTimeout, and timeout.
|
protectedvirtual |
Set the number of packet to fire an ACK before delay timeout.
count | the umber of packet to fire an ACK before delay timeout |
Implements ns3::TcpSocket.
Definition at line 2562 of file tcp-socket-base.cc.
References m_delAckMaxCount.
Referenced by ns3::TcpRfc793::TcpRfc793().
|
protectedvirtual |
Set the time to delay an ACK.
timeout | the time to delay an ACK |
Implements ns3::TcpSocket.
Definition at line 2550 of file tcp-socket-base.cc.
References m_delAckTimeout, and timeout.
|
protectedpure virtual |
Set the initial Congestion Window.
cwnd | the initial congestion window (in bytes) |
Implements ns3::TcpSocket.
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
|
protectedpure virtual |
Set the initial Slow Start Threshold.
threshold | the Slow Start Threshold (in bytes) |
Implements ns3::TcpSocket.
Implemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, ns3::TcpNewReno, and ns3::TcpRfc793.
void ns3::TcpSocketBase::SetMinRto | ( | Time | minRto | ) |
Sets the Minimum RTO.
minRto | The minimum RTO. |
Definition at line 2793 of file tcp-socket-base.cc.
References m_minRto, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Set the associated node.
node | the node |
Definition at line 281 of file tcp-socket-base.cc.
References m_node.
Referenced by ns3::TcpL4Protocol::CreateSocket().
|
protectedvirtual |
Set the timout for persistent connection.
When the timout 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
timeout | the persistent timout |
Implements ns3::TcpSocket.
Definition at line 2586 of file tcp-socket-base.cc.
References m_persistTimeout, and timeout.
|
protectedvirtual |
Set the receive buffer size.
size | the buffer size (in bytes) |
Implements ns3::TcpSocket.
Definition at line 2501 of file tcp-socket-base.cc.
References m_rxBuffer.
|
virtual |
Set the associated RTT estimator.
rtt | the RTT estimator |
Definition at line 295 of file tcp-socket-base.cc.
References m_rtt.
|
protectedvirtual |
Set the segment size.
size | the segment size (in bytes) |
Implements ns3::TcpSocket.
Reimplemented in ns3::TcpWestwood, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Definition at line 2513 of file tcp-socket-base.cc.
References ns3::CLOSED, m_segmentSize, m_state, and NS_ABORT_MSG_UNLESS.
|
protectedvirtual |
Set the send buffer size.
size | the buffer size (in bytes) |
Implements ns3::TcpSocket.
Definition at line 2489 of file tcp-socket-base.cc.
References m_txBuffer.
|
virtual |
Set the associated TCP L4 protocol.
tcp | the TCP L4 protocol |
Definition at line 288 of file tcp-socket-base.cc.
References m_tcp.
|
protectedvirtual |
Enable/Disable Nagle's algorithm.
noDelay | true to DISABLE Nagle's algorithm |
Implements ns3::TcpSocket.
Definition at line 2574 of file tcp-socket-base.cc.
References m_noDelay.
|
protected |
Common part of the two Bind(), i.e.
set callback and remembering local addr:port
Definition at line 761 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().
|
protected |
Configure the endpoint to a local address.
Called by Connect() if Bind() didn't specify one.
Definition at line 1825 of file tcp-socket-base.cc.
References ns3::Object::GetObject(), ns3::Ipv4EndPoint::GetPeerAddress(), 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::Ipv4Header::SetDestination(), and ns3::Ipv4EndPoint::SetLocalAddress().
Referenced by Connect().
|
protected |
Configure the endpoint v6 to a local address.
Called by Connect() if Bind() didn't specify one.
Definition at line 1855 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::SetDestinationAddress(), and ns3::Ipv6EndPoint::SetLocalAddress().
Referenced by Connect().
|
virtual |
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 585 of file tcp-socket-base.cc.
References m_shutdownRecv, and NS_LOG_FUNCTION.
|
virtual |
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 551 of file tcp-socket-base.cc.
References ns3::CLOSE_WAIT, ns3::ESTABLISHED, ns3::TcpHeader::FIN, ns3::FIN_WAIT_1, ns3::LAST_ACK, m_closeOnEmpty, m_shutdownSend, m_state, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, and SendEmptyPacket().
|
protected |
Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state.
Definition at line 2475 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().
|
protectedvirtual |
Return count of number of unacked bytes.
Definition at line 2129 of file tcp-socket-base.cc.
References ns3::TracedValue< T >::Get(), m_nextTxSequence, m_txBuffer, and NS_LOG_FUNCTION.
Referenced by AvailableWindow(), and SendPendingData().
|
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
header | TcpHeader from which to extract the new window value |
Definition at line 2748 of file tcp-socket-base.cc.
References ns3::ESTABLISHED, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::GetWindowSize(), m_highRxAckMark, m_highRxMark, m_rcvScaleFactor, m_rWnd, m_state, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by DoForwardUp().
|
protectedpure virtual |
Return the max possible number of unacked bytes.
Implemented in ns3::TcpWestwood, ns3::TcpRfc793, ns3::TcpTahoe, ns3::TcpReno, and ns3::TcpNewReno.
Referenced by AvailableWindow().
|
protected |
Clock Granularity used in RTO calcs.
Definition at line 717 of file tcp-socket-base.h.
Referenced by DoPeerClose(), EstimateRtt(), GetClockGranularity(), NewAck(), SendEmptyPacket(), and SetClockGranularity().
|
protected |
Told app to close socket.
Definition at line 743 of file tcp-socket-base.h.
Referenced by CloseAndNotify(), DoPeerClose(), LastAckTimeout(), and ReceivedData().
|
protected |
Close socket upon tx buffer emptied.
Definition at line 744 of file tcp-socket-base.h.
Referenced by Close(), SendDataPacket(), and ShutdownSend().
|
protected |
Count of remaining connection retries.
Definition at line 713 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), DoRetransmit(), ProcessSynSent(), and SendEmptyPacket().
|
protected |
Number of connection retries before giving up.
Definition at line 714 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), GetConnCount(), ProcessSynSent(), SendEmptyPacket(), and SetConnCount().
|
protected |
Timeout for connection retry.
Definition at line 721 of file tcp-socket-base.h.
Referenced by GetConnTimeout(), SendEmptyPacket(), and SetConnTimeout().
|
protected |
Connection established.
Definition at line 747 of file tcp-socket-base.h.
Referenced by ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpWestwood::DupAck(), NewAck(), ProcessSynRcvd(), ProcessSynSent(), and Send().
|
protected |
Delayed ACK counter.
Definition at line 710 of file tcp-socket-base.h.
Referenced by DelAckTimeout(), ProcessSynRcvd(), ProcessSynSent(), ReceivedData(), SendDataPacket(), and SendEmptyPacket().
|
protected |
Delayed ACK timeout event.
Definition at line 706 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), ReceivedData(), SendDataPacket(), and SendEmptyPacket().
|
protected |
Number of packet to fire an ACK before delay timeout.
Definition at line 711 of file tcp-socket-base.h.
Referenced by GetDelAckMaxCount(), ProcessSynRcvd(), ProcessSynSent(), ReceivedData(), and SetDelAckMaxCount().
|
protected |
Time to delay an ACK.
Definition at line 719 of file tcp-socket-base.h.
Referenced by GetDelAckTimeout(), ReceivedData(), and SetDelAckTimeout().
|
protected |
Dupack counter.
Definition at line 709 of file tcp-socket-base.h.
Referenced by ReceivedAck(), and Retransmit().
|
protected |
the IPv4 endpoint
Definition at line 725 of file tcp-socket-base.h.
Referenced by Bind(), BindToNetDevice(), CompleteFork(), Connect(), DeallocateEndPoint(), Destroy(), DoForwardUp(), GetSockName(), PersistTimeout(), ProcessSynRcvd(), Recv(), RecvFrom(), SendDataPacket(), SendEmptyPacket(), SendPendingData(), SetupCallback(), SetupEndpoint(), and ~TcpSocketBase().
|
protected |
the IPv6 endpoint
Definition at line 726 of file tcp-socket-base.h.
Referenced by Bind(), Bind6(), BindToNetDevice(), CompleteFork(), Connect(), DeallocateEndPoint(), Destroy6(), DoForwardUp(), GetSockName(), PersistTimeout(), ProcessSynRcvd(), Recv(), RecvFrom(), SendDataPacket(), SendEmptyPacket(), SendPendingData(), SetupCallback(), SetupEndpoint6(), and ~TcpSocketBase().
|
protected |
Socket error code.
Definition at line 742 of file tcp-socket-base.h.
Referenced by Bind(), Bind6(), Connect(), GetErrno(), Listen(), Send(), SetupEndpoint(), and SetupEndpoint6().
|
protected |
Highest ack received.
Definition at line 755 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateWindowSize().
|
protected |
Highest seqno received.
Definition at line 754 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateWindowSize().
|
protected |
Highest seqno ever sent, regardless of ReTx.
Definition at line 736 of file tcp-socket-base.h.
Referenced by BytesInFlight(), ns3::TcpNewReno::DupAck(), GetTypeId(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ReTxTimeout(), and SendDataPacket().
|
protected |
List of sent packet.
Definition at line 722 of file tcp-socket-base.h.
Referenced by EstimateRtt(), and SendDataPacket().
|
protected |
ICMP callback.
Definition at line 729 of file tcp-socket-base.h.
Referenced by ForwardIcmp(), and GetTypeId().
|
protected |
ICMPv6 callback.
Definition at line 730 of file tcp-socket-base.h.
Referenced by ForwardIcmp6(), and GetTypeId().
|
protected |
Last ACK timeout event.
Definition at line 705 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), DoPeerClose(), and LastAckTimeout().
|
protected |
Last RTT sample collected.
Definition at line 718 of file tcp-socket-base.h.
Referenced by ns3::TcpWestwood::EstimateRtt(), EstimateRtt(), and GetTypeId().
|
protected |
Maximum window size to advertise.
Definition at line 752 of file tcp-socket-base.h.
Referenced by AdvertisedWindowSize(), CalculateWScale(), and GetTypeId().
|
protected |
minimum value of the Retransmit timeout
Definition at line 716 of file tcp-socket-base.h.
Referenced by EstimateRtt(), GetMinRto(), NewAck(), SendEmptyPacket(), and SetMinRto().
|
protected |
Max segment lifetime.
Definition at line 748 of file tcp-socket-base.h.
Referenced by GetTypeId(), and TimeWait().
|
protected |
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
Definition at line 735 of file tcp-socket-base.h.
Referenced by Close(), DoForwardUp(), DoRetransmit(), ns3::TcpNewReno::DupAck(), ns3::TcpTahoe::DupAck(), GetTypeId(), NewAck(), PersistTimeout(), ProcessSynRcvd(), ProcessSynSent(), ReceivedAck(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpWestwood::Retransmit(), Retransmit(), SendEmptyPacket(), SendPendingData(), and UnAckDataCount().
the associated node
Definition at line 727 of file tcp-socket-base.h.
Referenced by AddOptionTimestamp(), AddOptionWScale(), CalculateWScale(), GetNode(), ProcessOptionTimestamp(), ProcessOptionWScale(), SetNode(), SetupEndpoint(), SetupEndpoint6(), and ~TcpSocketBase().
|
protected |
Set to true to disable Nagle's algorithm.
Definition at line 712 of file tcp-socket-base.h.
Referenced by GetTcpNoDelay(), SendPendingData(), and SetTcpNoDelay().
|
protected |
Persist event: Send 1 byte to probe for a non-zero Rx window.
Definition at line 707 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), DoForwardUp(), NewAck(), and PersistTimeout().
|
protected |
Time between sending 1-byte probes.
Definition at line 720 of file tcp-socket-base.h.
Referenced by GetPersistTimeout(), NewAck(), PersistTimeout(), and SetPersistTimeout().
|
protected |
Received Window Scale (i.e., the one of the peer)
Definition at line 760 of file tcp-socket-base.h.
Referenced by ProcessOptionWScale(), and UpdateWindowSize().
|
protected |
Retransmission event.
Definition at line 704 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), Destroy(), Destroy6(), NewAck(), ProcessSynRcvd(), ProcessSynSent(), SendDataPacket(), and SendEmptyPacket().
|
protected |
Retransmit timeout.
Definition at line 715 of file tcp-socket-base.h.
Referenced by EstimateRtt(), GetTypeId(), NewAck(), SendDataPacket(), and SendEmptyPacket().
|
protected |
Round trip time estimator.
Definition at line 732 of file tcp-socket-base.h.
Referenced by Connect(), DoPeerClose(), EstimateRtt(), NewAck(), SendEmptyPacket(), SetRtt(), and TcpSocketBase().
|
protected |
Receiver window (RCV.WND in RFC793)
Definition at line 753 of file tcp-socket-base.h.
Referenced by DoForwardUp(), GetTypeId(), NewAck(), SendPendingData(), UpdateWindowSize(), ns3::TcpNewReno::Window(), ns3::TcpReno::Window(), ns3::TcpTahoe::Window(), ns3::TcpRfc793::Window(), and ns3::TcpWestwood::Window().
|
protected |
Rx buffer (reordering buffer)
Definition at line 737 of file tcp-socket-base.h.
Referenced by AdvertisedWindowSize(), CalculateWScale(), Close(), CompleteFork(), DoForwardUp(), GetRcvBufSize(), GetRxAvailable(), GetRxBuffer(), OutOfRange(), PeerClose(), PersistTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedData(), Recv(), SendDataPacket(), SendEmptyPacket(), SetRcvBufSize(), and TcpSocketBase().
|
protected |
Segment size.
Definition at line 751 of file tcp-socket-base.h.
Referenced by ns3::TcpWestwood::CountAck(), DoRetransmit(), ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpTahoe::DupAck(), ns3::TcpWestwood::DupAck(), ns3::TcpWestwood::EstimateBW(), GetSegSize(), ns3::TcpNewReno::InitializeCwnd(), ns3::TcpReno::InitializeCwnd(), ns3::TcpTahoe::InitializeCwnd(), ns3::TcpWestwood::InitializeCwnd(), ns3::TcpNewReno::NewAck(), ns3::TcpReno::NewAck(), ns3::TcpTahoe::NewAck(), ns3::TcpWestwood::NewAck(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpWestwood::Retransmit(), SendPendingData(), ns3::TcpNewReno::SetSegSize(), ns3::TcpReno::SetSegSize(), ns3::TcpTahoe::SetSegSize(), ns3::TcpWestwood::SetSegSize(), and SetSegSize().
|
protected |
micro-delay event to send pending data
Definition at line 765 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), ns3::TcpNewReno::DupAck(), ns3::TcpReno::DupAck(), ns3::TcpWestwood::DupAck(), NewAck(), and Send().
|
protected |
Receive no longer allowed.
Definition at line 746 of file tcp-socket-base.h.
Referenced by ProcessWait(), ReceivedData(), and ShutdownRecv().
|
protected |
Send no longer allowed.
Definition at line 745 of file tcp-socket-base.h.
Referenced by DoPeerClose(), Send(), SendPendingData(), and ShutdownSend().
|
protected |
Sent Window Scale (i.e., the one of the node)
Definition at line 759 of file tcp-socket-base.h.
Referenced by AddOptionWScale(), AdvertisedWindowSize(), and ReadOptions().
|
protected |
TCP state.
Definition at line 741 of file tcp-socket-base.h.
Referenced by Close(), CloseAndNotify(), CompleteFork(), DoClose(), DoConnect(), DoForwardUp(), DoPeerClose(), DoRetransmit(), ns3::TcpWestwood::EstimateRtt(), GetTypeId(), LastAckTimeout(), Listen(), NewAck(), OutOfRange(), PeerClose(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), Recv(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpWestwood::Retransmit(), ReTxTimeout(), Send(), SendDataPacket(), SendEmptyPacket(), ns3::TcpNewReno::SetInitialCwnd(), ns3::TcpReno::SetInitialCwnd(), ns3::TcpTahoe::SetInitialCwnd(), ns3::TcpWestwood::SetInitialCwnd(), ns3::TcpNewReno::SetInitialSSThresh(), ns3::TcpReno::SetInitialSSThresh(), ns3::TcpTahoe::SetInitialSSThresh(), ns3::TcpWestwood::SetInitialSSThresh(), ns3::TcpNewReno::SetSegSize(), ns3::TcpReno::SetSegSize(), ns3::TcpTahoe::SetSegSize(), ns3::TcpWestwood::SetSegSize(), SetSegSize(), ShutdownSend(), TimeWait(), and UpdateWindowSize().
|
protected |
the associated TCP L4 protocol
Definition at line 728 of file tcp-socket-base.h.
Referenced by Bind(), Bind6(), CompleteFork(), DeallocateEndPoint(), Destroy(), Destroy6(), DoForwardUp(), PersistTimeout(), SendDataPacket(), SendEmptyPacket(), SetTcp(), and ~TcpSocketBase().
|
protected |
Timestamp option enabled.
Definition at line 762 of file tcp-socket-base.h.
Referenced by AddOptions(), EstimateRtt(), GetTypeId(), and ReadOptions().
|
protected |
Timestamp to echo.
Definition at line 763 of file tcp-socket-base.h.
Referenced by AddOptionTimestamp(), and ProcessOptionTimestamp().
|
protected |
TIME_WAIT expiration event: Move this socket to CLOSED state.
Definition at line 708 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), and TimeWait().
|
protected |
Tx buffer.
Definition at line 738 of file tcp-socket-base.h.
Referenced by BytesInFlight(), Close(), DoRetransmit(), ns3::TcpNewReno::DupAck(), ns3::TcpTahoe::DupAck(), GetSndBufSize(), GetTxAvailable(), GetTxBuffer(), ns3::TcpNewReno::NewAck(), NewAck(), PersistTimeout(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedAck(), ns3::TcpNewReno::Retransmit(), ns3::TcpReno::Retransmit(), ns3::TcpTahoe::Retransmit(), ns3::TcpWestwood::Retransmit(), Retransmit(), Send(), SendDataPacket(), SendPendingData(), SetSndBufSize(), ShutdownSend(), TcpSocketBase(), and UnAckDataCount().
|
protected |
Window Scale option enabled.
Definition at line 758 of file tcp-socket-base.h.
Referenced by AddOptions(), GetTypeId(), and ReadOptions().