A base class for implementation of a stream socket using TCP. More...
#include "tcp-socket-base.h"
Public Member Functions | |
TcpSocketBase () | |
Create an unbound TCP socket. | |
TcpSocketBase (const TcpSocketBase &sock) | |
Clone a TCP socket, for use upon receiving a connection request in LISTEN state. | |
~TcpSocketBase () override | |
int | Bind () override |
Allocate a local IPv4 endpoint for this socket. | |
int | Bind (const Address &address) override |
Allocate a local endpoint for this socket. | |
int | Bind6 () override |
Allocate a local IPv6 endpoint for this socket. | |
void | BindToNetDevice (Ptr< NetDevice > netdevice) override |
Bind a socket to specific device. | |
bool | CheckEcnCe (uint8_t tos) const |
Checks for CE codepoint. | |
bool | CheckEcnEct0 (uint8_t tos) const |
Checks for ECT(0) codepoint. | |
bool | CheckEcnEct1 (uint8_t tos) const |
Checks for ECT(1) codepoint. | |
bool | CheckNoEcn (uint8_t tos) const |
Checks if TOS has no ECN codepoints. | |
uint8_t | ClearEcnBits (uint8_t tos) const |
Clears ECN bits from TOS. | |
int | Close () override |
Close a socket. | |
int | Connect (const Address &address) override |
Initiate a connection to a remote host. | |
Time | GetClockGranularity () const |
Get the Clock Granularity (used in RTO calcs). | |
SocketErrno | GetErrno () const override |
Get last error number. | |
TypeId | GetInstanceTypeId () const override |
Get the instance TypeId. | |
Time | GetMinRto () const |
Get the Minimum RTO. | |
Ptr< Node > | GetNode () const override |
Return the node this socket is associated with. | |
int | GetPeerName (Address &address) const override |
Get the peer address of a connected socket. | |
uint32_t | GetRetxThresh () const |
Get the retransmission threshold (dup ack threshold for a fast retransmit) | |
uint32_t | GetRxAvailable () const override |
Return number of bytes which can be returned from one or multiple calls to Recv. | |
Ptr< TcpRxBuffer > | GetRxBuffer () const |
Get a pointer to the Rx buffer. | |
SocketType | GetSocketType () const override |
int | GetSockName (Address &address) const override |
Get socket address. | |
uint32_t | GetTxAvailable () const override |
Returns the number of bytes which can be sent in a single call to Send. | |
Ptr< TcpTxBuffer > | GetTxBuffer () const |
Get a pointer to the Tx buffer. | |
bool | IsEct (TcpPacketType_t packetType) const |
Checks if a TCP packet should be ECN-capable (ECT) according to the TcpPacketType and ECN mode. | |
int | Listen () override |
Listen for incoming connections. | |
uint8_t | MarkEcnCe (uint8_t tos) const |
Mark CE codepoint. | |
uint8_t | MarkEcnCodePoint (const uint8_t tos, const TcpSocketState::EcnCodePoint_t codePoint) const |
mark ECN code point | |
uint8_t | MarkEcnEct0 (uint8_t tos) const |
Mark ECT(0) codepoint. | |
uint8_t | MarkEcnEct1 (uint8_t tos) const |
Mark ECT(1) codepoint. | |
Ptr< Packet > | Recv (uint32_t maxSize, uint32_t flags) override |
Read data from the socket. | |
Ptr< Packet > | RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress) override |
Read a single packet from the socket and retrieve the sender address. | |
int | Send (Ptr< Packet > p, uint32_t flags) override |
Send data (or dummy data) to the remote host. | |
int | SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress) override |
Send data to a specified peer. | |
void | SetClockGranularity (Time clockGranularity) |
Sets the Clock Granularity (used in RTO calcs). | |
void | SetCongestionControlAlgorithm (Ptr< TcpCongestionOps > algo) |
Install a congestion control algorithm on this socket. | |
void | SetMinRto (Time minRto) |
Sets the Minimum RTO. | |
virtual void | SetNode (Ptr< Node > node) |
Set the associated node. | |
void | SetPaceInitialWindow (bool paceWindow) |
Enable or disable pacing of the initial window. | |
void | SetPacingStatus (bool pacing) |
Enable or disable pacing. | |
void | SetRecoveryAlgorithm (Ptr< TcpRecoveryOps > recovery) |
Install a recovery algorithm on this socket. | |
void | SetRetxThresh (uint32_t retxThresh) |
Set the retransmission threshold (dup ack threshold for a fast retransmit) | |
virtual void | SetRtt (Ptr< RttEstimator > rtt) |
Set the associated RTT estimator. | |
virtual void | SetTcp (Ptr< TcpL4Protocol > tcp) |
Set the associated TCP L4 protocol. | |
void | SetUseEcn (TcpSocketState::UseEcn_t useEcn) |
Set ECN mode of use on the socket. | |
int | ShutdownRecv () override |
int | ShutdownSend () override |
void | UpdateBytesInFlight (uint32_t oldValue, uint32_t newValue) const |
Callback function to hook to TcpSocketState bytes inflight. | |
void | UpdateCongState (TcpSocketState::TcpCongState_t oldValue, TcpSocketState::TcpCongState_t newValue) const |
Callback function to hook to TcpSocketState congestion state. | |
void | UpdateCwnd (uint32_t oldValue, uint32_t newValue) const |
Callback function to hook to TcpSocketState congestion window. | |
void | UpdateCwndInfl (uint32_t oldValue, uint32_t newValue) const |
Callback function to hook to TcpSocketState inflated congestion window. | |
void | UpdateEcnState (TcpSocketState::EcnState_t oldValue, TcpSocketState::EcnState_t newValue) const |
Callback function to hook to EcnState state. | |
void | UpdateHighTxMark (SequenceNumber32 oldValue, SequenceNumber32 newValue) const |
Callback function to hook to TcpSocketState high tx mark. | |
void | UpdateLastRtt (Time oldValue, Time newValue) const |
Callback function to hook to TcpSocketState lastRtt. | |
void | UpdateNextTxSequence (SequenceNumber32 oldValue, SequenceNumber32 newValue) const |
Callback function to hook to TcpSocketState next tx sequence. | |
void | UpdatePacingRateTrace (DataRate oldValue, DataRate newValue) const |
Callback function to hook to TcpSocketState pacing rate. | |
void | UpdateRtt (Time oldValue, Time newValue) const |
Callback function to hook to TcpSocketState rtt. | |
void | UpdateSsThresh (uint32_t oldValue, uint32_t newValue) const |
Callback function to hook to TcpSocketState slow start threshold. | |
Public Member Functions inherited from ns3::TcpSocket | |
TcpSocket () | |
~TcpSocket () override | |
Public Member Functions inherited from ns3::Socket | |
Socket () | |
~Socket () override | |
Ptr< NetDevice > | GetBoundNetDevice () |
Returns socket's bound NetDevice, if any. | |
uint8_t | GetIpTos () const |
Query the value of IP Type of Service of this socket. | |
virtual uint8_t | GetIpTtl () const |
Query the value of IP Time to Live field of this socket. | |
virtual uint8_t | GetIpv6HopLimit () const |
Query the value of IP Hop Limit field of this socket. | |
uint8_t | GetIpv6Tclass () const |
Query the value of IPv6 Traffic Class field of this socket. | |
uint8_t | GetPriority () const |
Query the priority value of this socket. | |
virtual void | Ipv6JoinGroup (Ipv6Address address) |
Joins a IPv6 multicast group without filters. | |
virtual void | Ipv6JoinGroup (Ipv6Address address, Ipv6MulticastFilterMode filterMode, std::vector< Ipv6Address > sourceAddresses) |
Joins a IPv6 multicast group. | |
virtual void | Ipv6LeaveGroup () |
Leaves IPv6 multicast group this socket is joined to. | |
bool | IsIpRecvTos () const |
Ask if the socket is currently passing information about IP Type of Service up the stack. | |
bool | IsIpRecvTtl () const |
Ask if the socket is currently passing information about IP_TTL up the stack. | |
bool | IsIpv6RecvHopLimit () const |
Ask if the socket is currently passing information about IPv6 Hop Limit up the stack. | |
bool | IsIpv6RecvTclass () const |
Ask if the socket is currently passing information about IPv6 Traffic Class up the stack. | |
bool | IsRecvPktInfo () const |
Get status indicating whether enable/disable packet information to socket. | |
Ptr< Packet > | Recv () |
Read a single packet from the socket. | |
int | Recv (uint8_t *buf, uint32_t size, uint32_t flags) |
Recv data (or dummy data) from the remote host. | |
Ptr< Packet > | RecvFrom (Address &fromAddress) |
Read a single packet from the socket and retrieve the sender address. | |
int | RecvFrom (uint8_t *buf, uint32_t size, uint32_t flags, Address &fromAddress) |
Read a single packet from the socket and retrieve the sender address. | |
int | Send (const uint8_t *buf, uint32_t size, uint32_t flags) |
Send data (or dummy data) to the remote host. | |
int | Send (Ptr< Packet > p) |
Send data (or dummy data) to the remote host. | |
int | SendTo (const uint8_t *buf, uint32_t size, uint32_t flags, const Address &address) |
Send data to a specified peer. | |
void | SetAcceptCallback (Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated) |
Accept connection requests from remote hosts. | |
void | SetCloseCallbacks (Callback< void, Ptr< Socket > > normalClose, Callback< void, Ptr< Socket > > errorClose) |
Detect socket recv() events such as graceful shutdown or error. | |
void | SetConnectCallback (Callback< void, Ptr< Socket > > connectionSucceeded, Callback< void, Ptr< Socket > > connectionFailed) |
Specify callbacks to allow the caller to determine if the connection succeeds of fails. | |
void | SetDataSentCallback (Callback< void, Ptr< Socket >, uint32_t > dataSent) |
Notify application when a packet has been sent from transport protocol (non-standard socket call) | |
void | SetIpRecvTos (bool ipv4RecvTos) |
Tells a socket to pass information about IP Type of Service up the stack. | |
void | SetIpRecvTtl (bool ipv4RecvTtl) |
Tells a socket to pass information about IP_TTL up the stack. | |
void | SetIpTos (uint8_t ipTos) |
Manually set IP Type of Service field. | |
virtual void | SetIpTtl (uint8_t ipTtl) |
Manually set IP Time to Live field. | |
virtual void | SetIpv6HopLimit (uint8_t ipHopLimit) |
Manually set IPv6 Hop Limit. | |
void | SetIpv6RecvHopLimit (bool ipv6RecvHopLimit) |
Tells a socket to pass information about IPv6 Hop Limit up the stack. | |
void | SetIpv6RecvTclass (bool ipv6RecvTclass) |
Tells a socket to pass information about IPv6 Traffic Class up the stack. | |
void | SetIpv6Tclass (int ipTclass) |
Manually set IPv6 Traffic Class field. | |
void | SetPriority (uint8_t priority) |
Manually set the socket priority. | |
void | SetRecvCallback (Callback< void, Ptr< Socket > > receivedData) |
Notify application when new data is available to be read. | |
void | SetRecvPktInfo (bool flag) |
Enable/Disable receive packet information to socket. | |
void | SetSendCallback (Callback< void, Ptr< Socket >, uint32_t > sendCb) |
Notify application when space in transmit buffer is added. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::TcpSocket | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Socket | |
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. | |
static TypeId | GetTypeId () |
Get the type ID. | |
static uint8_t | IpTos2Priority (uint8_t ipTos) |
Return the priority corresponding to a given TOS value. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Protected Member Functions | |
void | AddOptions (TcpHeader &tcpHeader) |
Add options to TcpHeader. | |
void | AddOptionSack (TcpHeader &header) |
Add the SACK option to the header. | |
void | AddOptionSackPermitted (TcpHeader &header) |
Add the SACK PERMITTED option to the header. | |
void | AddOptionTimestamp (TcpHeader &header) |
Add the timestamp option to the header. | |
void | AddOptionWScale (TcpHeader &header) |
Add the window scale option to the header. | |
void | AddSocketTags (const Ptr< Packet > &p, bool isEct) const |
Add Tags for the Socket. | |
virtual uint16_t | AdvertisedWindowSize (bool scale=true) const |
The amount of Rx window announced to the peer. | |
virtual uint32_t | AvailableWindow () const |
Return unfilled portion of window. | |
virtual uint32_t | BytesInFlight () const |
Return total bytes in flight. | |
virtual Time | CalculateRttSample (const TcpHeader &tcpHeader, const RttHistory &rttHistory) |
Calculate RTT sample for the ACKed packet. | |
uint8_t | CalculateWScale () const |
Calculate window scale value based on receive buffer space. | |
void | CancelAllTimers () |
Cancel all timer when endpoint is deleted. | |
void | CloseAndNotify () |
Peacefully close the socket by notifying the upper layer and deallocate end point. | |
virtual void | CompleteFork (Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) |
Complete a connection by forking the socket. | |
void | ConnectionSucceeded () |
Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded() | |
void | DeallocateEndPoint () |
Deallocate m_endPoint and m_endPoint6. | |
virtual void | DelAckTimeout () |
Action upon delay ACK timeout, i.e. | |
void | Destroy () |
Kill this socket by zeroing its attributes (IPv4) | |
void | Destroy6 () |
Kill this socket by zeroing its attributes (IPv6) | |
int | DoClose () |
Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state. | |
int | DoConnect () |
Perform the real connection tasks: Send SYN if allowed, RST if invalid. | |
virtual void | DoForwardUp (Ptr< Packet > packet, const Address &fromAddress, const Address &toAddress) |
Called by TcpSocketBase::ForwardUp{,6}(). | |
void | DoPeerClose () |
FIN is in sequence, notify app and respond with a FIN. | |
void | DoRetransmit () |
Retransmit the first segment marked as lost, without considering available window nor pacing. | |
void | DupAck (uint32_t currentDelivered) |
Dupack management. | |
void | EnterCwr (uint32_t currentDelivered) |
Enter CA_CWR state upon receipt of an ECN Echo. | |
void | EnterRecovery (uint32_t currentDelivered) |
Enter the CA_RECOVERY, and retransmit the head. | |
virtual void | EstimateRtt (const TcpHeader &tcpHeader) |
Take into account the packet for RTT estimation. | |
virtual Ptr< TcpSocketBase > | Fork () |
Call CopyObject<> to clone me. | |
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. | |
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. | |
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. | |
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. | |
bool | GetAllowBroadcast () const override |
Query whether broadcast datagram transmissions are allowed. | |
Time | GetConnTimeout () const override |
Get the connection timeout. | |
uint32_t | GetDataRetries () const override |
Get the number of data transmission retries before giving up. | |
uint32_t | GetDelAckMaxCount () const override |
Get the number of packet to fire an ACK before delay timeout. | |
Time | GetDelAckTimeout () const override |
Get the time to delay an ACK. | |
SequenceNumber32 | GetHighRxAck () const |
Get the current value of the receiver's highest (in-sequence) sequence number acked. | |
uint32_t | GetInitialCwnd () const override |
Get the initial Congestion Window. | |
uint32_t | GetInitialSSThresh () const override |
Get the initial Slow Start Threshold. | |
Time | GetPersistTimeout () const override |
Get the timeout for persistent connection. | |
uint32_t | GetRcvBufSize () const override |
Get the receive buffer size. | |
uint32_t | GetRWnd () const |
Get the current value of the receiver's offered window (RCV.WND) | |
uint32_t | GetSegSize () const override |
Get the segment size. | |
uint32_t | GetSndBufSize () const override |
Get the send buffer size. | |
uint32_t | GetSynRetries () const override |
Get the number of connection retries before giving up. | |
bool | GetTcpNoDelay () const override |
Check if Nagle's algorithm is enabled or not. | |
bool | IsPacingEnabled () const |
Return true if packets in the current window should be paced. | |
bool | IsTcpOptionEnabled (uint8_t kind) const |
Return true if the specified option is enabled. | |
bool | IsValidTcpSegment (const SequenceNumber32 seq, const uint32_t tcpHeaderSize, const uint32_t tcpPayloadSize) |
Checks whether the given TCP segment is valid or not. | |
virtual void | LastAckTimeout () |
Timeout at LAST_ACK, close the connection. | |
virtual void | NewAck (const SequenceNumber32 &seq, bool resetRTO) |
Update buffers w.r.t. | |
void | NotifyPacingPerformed () |
Notify Pacing. | |
bool | OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const |
Check if a sequence number range is within the rx window. | |
void | PeerClose (Ptr< Packet > p, const TcpHeader &tcpHeader) |
Received a FIN from peer, notify rx buffer. | |
virtual void | PersistTimeout () |
Send 1 byte probe to get an updated window size. | |
virtual void | ProcessAck (const SequenceNumber32 &ackNumber, bool scoreboardUpdated, uint32_t currentDelivered, const SequenceNumber32 &oldHeadSequence, bool receivedData) |
Process a received ack. | |
void | ProcessClosing (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received a packet upon CLOSING. | |
void | ProcessEstablished (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received a packet upon ESTABLISHED state. | |
void | ProcessLastAck (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received a packet upon LAST_ACK. | |
void | ProcessListen (Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) |
Received a packet upon LISTEN state. | |
uint32_t | ProcessOptionSack (const Ptr< const TcpOption > option) |
Read the SACK option. | |
void | ProcessOptionSackPermitted (const Ptr< const TcpOption > option) |
Read the SACK PERMITTED option. | |
void | ProcessOptionTimestamp (const Ptr< const TcpOption > option, const SequenceNumber32 &seq) |
Process the timestamp option from other side. | |
void | ProcessOptionWScale (const Ptr< const TcpOption > option) |
Read and parse the Window scale option. | |
void | ProcessSynRcvd (Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) |
Received a packet upon SYN_RCVD. | |
void | ProcessSynSent (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received a packet upon SYN_SENT. | |
void | ProcessWait (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received a packet upon CLOSE_WAIT, FIN_WAIT_1, FIN_WAIT_2. | |
void | ReadOptions (const TcpHeader &tcpHeader, uint32_t *bytesSacked) |
Read TCP options before Ack processing. | |
virtual void | ReceivedAck (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Received an ACK packet. | |
virtual void | ReceivedData (Ptr< Packet > packet, const TcpHeader &tcpHeader) |
Recv of a data, put into buffer, call L7 to get it if necessary. | |
virtual void | ReTxTimeout () |
An RTO event happened. | |
virtual uint32_t | SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck) |
Extract at most maxSize bytes from the TxBuffer at sequence seq, add the TCP header, and send to TcpL4Protocol. | |
virtual void | SendEmptyPacket (uint8_t flags) |
Send a empty packet that carries a flag, e.g., ACK. | |
uint32_t | SendPendingData (bool withAck=false) |
Send as much pending data as possible according to the Tx window. | |
void | SendRST () |
Send reset and tear down this socket. | |
bool | SetAllowBroadcast (bool allowBroadcast) override |
Configure whether broadcast datagram transmissions are allowed. | |
void | SetConnTimeout (Time timeout) override |
Set the connection timeout. | |
void | SetDataRetries (uint32_t retries) override |
Set the number of data transmission retries before giving up. | |
void | SetDelAckMaxCount (uint32_t count) override |
Set the number of packet to fire an ACK before delay timeout. | |
void | SetDelAckTimeout (Time timeout) override |
Set the time to delay an ACK. | |
void | SetInitialCwnd (uint32_t cwnd) override |
Set the initial Congestion Window. | |
void | SetInitialSSThresh (uint32_t threshold) override |
Set the initial Slow Start Threshold. | |
void | SetPersistTimeout (Time timeout) override |
Set the timeout for persistent connection. | |
void | SetRcvBufSize (uint32_t size) override |
Set the receive buffer size. | |
void | SetSegSize (uint32_t size) override |
Set the segment size. | |
void | SetSndBufSize (uint32_t size) override |
Set the send buffer size. | |
void | SetSynRetries (uint32_t count) override |
Set the number of connection retries before giving up. | |
void | SetTcpNoDelay (bool noDelay) override |
Enable/Disable Nagle's algorithm. | |
int | SetupCallback () |
Common part of the two Bind(), i.e. | |
int | SetupEndpoint () |
Configure the endpoint to a local address. | |
int | SetupEndpoint6 () |
Configure the endpoint v6 to a local address. | |
void | TimeWait () |
Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state. | |
virtual uint32_t | UnAckDataCount () const |
Return count of number of unacked bytes. | |
void | UpdatePacingRate () |
Dynamically update the pacing rate. | |
virtual void | UpdateRttHistory (const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission) |
Update the RTT history, when we send TCP segments. | |
void | UpdateWindowSize (const TcpHeader &header) |
Update the receiver window (RWND) based on the value of the window field in the header. | |
virtual uint32_t | Window () const |
Return the max possible number of unacked bytes. | |
Protected Member Functions inherited from ns3::Socket | |
void | DoDispose () override |
Destructor implementation. | |
bool | IsManualIpTtl () const |
Checks if the socket has a specific IPv4 TTL set. | |
bool | IsManualIpv6HopLimit () const |
Checks if the socket has a specific IPv6 Hop Limit set. | |
bool | IsManualIpv6Tclass () const |
Checks if the socket has a specific IPv6 Tclass set. | |
void | NotifyConnectionFailed () |
Notify through the callback (if set) that the connection has not been established due to an error. | |
bool | NotifyConnectionRequest (const Address &from) |
Notify through the callback (if set) that an incoming connection is being requested by a remote host. | |
void | NotifyConnectionSucceeded () |
Notify through the callback (if set) that the connection has been established. | |
void | NotifyDataRecv () |
Notify through the callback (if set) that some data have been received. | |
void | NotifyDataSent (uint32_t size) |
Notify through the callback (if set) that some data have been sent. | |
void | NotifyErrorClose () |
Notify through the callback (if set) that the connection has been closed due to an error. | |
void | NotifyNewConnectionCreated (Ptr< Socket > socket, const Address &from) |
Notify through the callback (if set) that a new connection has been created. | |
void | NotifyNormalClose () |
Notify through the callback (if set) that the connection has been closed. | |
void | NotifySend (uint32_t spaceAvailable) |
Notify through the callback (if set) that some data have been sent. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Static Protected Member Functions | |
static uint32_t | SafeSubtraction (uint32_t a, uint32_t b) |
Performs a safe subtraction between a and b (a-b) | |
Protected Attributes | |
TracedValue< uint32_t > | m_advWnd {0} |
Advertised Window size. | |
uint32_t | m_bytesAckedNotProcessed {0} |
Bytes acked, but not processed. | |
Time | m_clockGranularity {Seconds(0.001)} |
Clock Granularity used in RTO calcs. | |
bool | m_closeNotified {false} |
Told app to close socket. | |
bool | m_closeOnEmpty {false} |
Close socket upon tx buffer emptied. | |
Time | m_cnTimeout {Seconds(0.0)} |
Timeout for connection retry. | |
Ptr< TcpCongestionOps > | m_congestionControl |
Congestion control. | |
bool | m_connected {false} |
Connection established. | |
uint32_t | m_dataRetrCount {0} |
Count of remaining data retransmission attempts. | |
uint32_t | m_dataRetries {0} |
Number of data retransmission attempts. | |
uint32_t | m_delAckCount {0} |
Delayed ACK counter. | |
EventId | m_delAckEvent {} |
Delayed ACK timeout event. | |
uint32_t | m_delAckMaxCount {0} |
Number of packet to fire an ACK before delay timeout. | |
Time | m_delAckTimeout {Seconds(0.0)} |
Time to delay an ACK. | |
uint32_t | m_dupAckCount {0} |
Dupack counter. | |
TracedValue< SequenceNumber32 > | m_ecnCESeq |
Sequence number of the last received Congestion Experienced. | |
TracedValue< SequenceNumber32 > | m_ecnCWRSeq {0} |
Sequence number of the last sent CWR. | |
TracedValue< SequenceNumber32 > | m_ecnEchoSeq |
Sequence number of the last received ECN Echo. | |
Ipv4EndPoint * | m_endPoint {nullptr} |
the IPv4 endpoint | |
Ipv6EndPoint * | m_endPoint6 {nullptr} |
the IPv6 endpoint | |
SocketErrno | m_errno {ERROR_NOTERROR} |
Socket error code. | |
TracedValue< SequenceNumber32 > | m_highRxAckMark {0} |
Highest ack received. | |
TracedValue< SequenceNumber32 > | m_highRxMark {0} |
Highest seqno received. | |
SequenceNumber32 | m_highTxAck {0} |
Highest ack sent. | |
std::deque< RttHistory > | m_history |
List of sent packet. | |
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > | m_icmpCallback |
ICMP callback. | |
Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > | m_icmpCallback6 |
ICMPv6 callback. | |
bool | m_isFirstPartialAck {true} |
First partial ACK during RECOVERY. | |
EventId | m_lastAckEvent {} |
Last ACK timeout event. | |
bool | m_limitedTx {true} |
perform limited transmit | |
uint16_t | m_maxWinSize {0} |
Maximum window size to advertise. | |
Time | m_minRto {Time::Max()} |
minimum value of the Retransmit timeout | |
double | m_msl {0.0} |
Max segment lifetime. | |
Ptr< Node > | m_node |
the associated node | |
bool | m_noDelay {false} |
Set to true to disable Nagle's algorithm. | |
Timer | m_pacingTimer {Timer::CANCEL_ON_DESTROY} |
Pacing Event. | |
EventId | m_persistEvent {} |
Persist event: Send 1 byte to probe for a non-zero Rx window. | |
Time | m_persistTimeout {Seconds(0.0)} |
Time between sending 1-byte probes. | |
Ptr< TcpRateOps > | m_rateOps |
Rate operations. | |
uint8_t | m_rcvWindShift {0} |
Window shift to apply to outgoing segments. | |
SequenceNumber32 | m_recover |
Previous highest Tx seqnum for fast recovery (set it to initial seq number) | |
bool | m_recoverActive {false} |
Whether "m_recover" has been set/activated It is used to avoid comparing with the old m_recover value which was set for handling previous congestion event. | |
Ptr< TcpRecoveryOps > | m_recoveryOps |
Recovery Algorithm. | |
TracedCallback< Ptr< const Packet >, const TcpHeader &, const Address &, const Address &, Ptr< const TcpSocketBase > > | m_retransmissionTrace |
Trace of retransmitted packets. | |
EventId | m_retxEvent {} |
Retransmission event. | |
uint32_t | m_retxThresh {3} |
Fast Retransmit threshold. | |
TracedValue< Time > | m_rto {Seconds(0.0)} |
Retransmit timeout. | |
Ptr< RttEstimator > | m_rtt |
Round trip time estimator. | |
TracedValue< uint32_t > | m_rWnd {0} |
Receiver window (RCV.WND in RFC793) | |
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > | m_rxTrace |
Trace of received packets. | |
bool | m_sackEnabled {true} |
RFC SACK option enabled. | |
EventId | m_sendPendingDataEvent {} |
micro-delay event to send pending data | |
bool | m_shutdownRecv {false} |
Receive no longer allowed. | |
bool | m_shutdownSend {false} |
Send no longer allowed. | |
uint8_t | m_sndWindShift {0} |
Window shift to apply to incoming segments. | |
TracedValue< TcpStates_t > | m_state {CLOSED} |
TCP state. | |
uint32_t | m_synCount {0} |
Count of remaining connection retries. | |
uint32_t | m_synRetries {0} |
Number of connection attempts. | |
Ptr< TcpSocketState > | m_tcb |
Congestion control information. | |
Ptr< TcpL4Protocol > | m_tcp |
the associated TCP L4 protocol | |
bool | m_timestampEnabled {true} |
Timestamp option enabled. | |
uint32_t | m_timestampToEcho {0} |
Timestamp to echo. | |
EventId | m_timewaitEvent {} |
TIME_WAIT expiration event: Move this socket to CLOSED state. | |
Ptr< TcpTxBuffer > | m_txBuffer |
Tx buffer. | |
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > | m_txTrace |
Trace of transmitted packets. | |
bool | m_winScalingEnabled {true} |
Window Scale option enabled (RFC 7323) | |
Protected Attributes inherited from ns3::Socket | |
Ptr< NetDevice > | m_boundnetdevice |
the device this socket is bound to (might be null). | |
Ipv6Address | m_ipv6MulticastGroupAddress |
IPv6 multicast group address. | |
bool | m_recvPktInfo |
if the socket should add packet info tags to the packet forwarded to L4. | |
Related Symbols | |
(Note that these are not member symbols.) | |
class | TcpGeneralTest |
TcpGeneralTest friend class (for tests). | |
Additional Inherited Members | |
Static Public Attributes inherited from ns3::TcpSocket | |
static const char *const | TcpStateName [TcpSocket::LAST_STATE] |
Literal names of TCP states for use in log messages. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
A base class for implementation of a stream socket using TCP.
This class contains the essential components of TCP, as well as a sockets interface for upper layers to call. This class provides connection orientation and sliding window flow control; congestion control is delegated to subclasses of TcpCongestionOps. Part of TcpSocketBase is modified from the original NS-3 TCP socket implementation (TcpSocketImpl) by Raj Bhattacharjea raj.b.nosp@m.@gat.nosp@m.ech.e.nosp@m.du of Georgia Tech.
For IPv4 packets, the TOS set for the socket is used. The Bind and Connect operations set the TOS for the socket to the value specified in the provided address. A SocketIpTos tag is only added to the packet if the resulting TOS is non-null. Each packet is assigned the priority set for the socket. Setting a TOS for a socket also sets a priority for the socket (according to the Socket::IpTos2Priority function). A SocketPriority tag is only added to the packet if the priority is non-null.
The socket maintains two state machines; the TCP one, and another called "Congestion state machine", which keeps track of the phase we are in. Currently, ns-3 manages the states:
For more information, see the TcpCongState_t documentation.
Congestion control, unlike older releases of ns-3, has been split from TcpSocketBase. In particular, each congestion control is now a subclass of the main TcpCongestionOps class. Switching between congestion algorithm is now a matter of setting a pointer into the TcpSocketBase class. The idea and the interfaces are inspired by the Linux operating system, and in particular from the structure tcp_congestion_ops. The reference paper is https://www.sciencedirect.com/science/article/abs/pii/S1569190X15300939.
The variables needed to congestion control classes to operate correctly have been moved inside the TcpSocketState class. It contains information on the congestion window, slow start threshold, segment size and the state of the Congestion state machine.
To track the trace inside the TcpSocketState class, a "forward" technique is used, which consists in chaining callbacks from TcpSocketState to TcpSocketBase (see for example cWnd trace source).
The fast retransmit enhancement is introduced in RFC 2581 and updated in RFC
The attribute which manages the number of dup ACKs necessary to start the fast retransmit algorithm is named "ReTxThreshold", and by default is 3. The parameter is also used in TcpTxBuffer to determine if a packet is lost (please take a look at TcpTxBuffer documentation to see details) but, right now, it is assumed to be fixed. In future releases this parameter can be made dynamic, to reflect the reordering degree of the network. With SACK, the next sequence to transmit is given by the RFC 6675 algorithm. Without SACK option, the implementation adds "hints" to TcpTxBuffer to make sure it returns, as next transmittable sequence, the first lost (or presumed lost) segment.
The fast recovery algorithm is introduced RFC 2001, and it avoids to reset cWnd to 1 segment after sensing a loss on the channel. Instead, a new slow start threshold value is asked to the congestion control (for instance, with NewReno the returned amount is half of the previous), and the cWnd is set equal to such value. Ns-3 does not implement any inflation/deflation to the congestion window since it uses an evolved method (borrowed from Linux operating system) to calculate the number of bytes in flight. The fundamental idea is to subtract from the total bytes in flight the lost/sacked amount (the segments that have left the network) and to add the retransmitted count. In this way, congestion window represents the exact number of bytes that should be in flight. The implementation then decides what to transmit, it there is space, between new or already transmitted data portion. If a value of the congestion window with inflation and deflation is needed, there is a traced source named "CongestionWindowInflated". However, the variable behind it is not used in the code, but maintained for backward compatibility.
When the Retransmission Time Out expires, the TCP faces a significant performance drop. The expiration event is managed in the ReTxTimeout method, which set the cWnd to 1 segment and starts "from scratch" again. The list of sent packet is set as lost entirely, and the transmission is re-started from the SND.UNA sequence number.
SYN and SYN-ACK options, which are allowed only at the beginning of the connection, are managed in the DoForwardUp and SendEmptyPacket methods. To read all others, we have set up a cycle inside ReadOptions. For adding them, there is no a unique place, since the options (and the information available to build them) are scattered around the code. For instance, the SACK option is built in SendEmptyPacket only under certain conditions.
The SACK generation/management is delegated to the buffer classes, namely TcpTxBuffer and TcpRxBuffer. In TcpRxBuffer it is managed the creation of the SACK option from the receiver point of view. It must provide an accurate (and efficient) representation of the status of the receiver buffer. On the other side, inside TcpTxBuffer the received options (that contain the SACK block) are processed and a particular data structure, called Scoreboard, is filled. Please take a look at TcpTxBuffer and TcpRxBuffer documentation if you need more information. The reference paper is https://dl.acm.org/citation.cfm?id=3067666.
Definition at line 208 of file tcp-socket-base.h.
typedef void(* ns3::TcpSocketBase::RetransmissionCallback) (const Ptr< const Packet > packet, const TcpHeader &header, const Address &localAddr, const Address &peerAddr, const Ptr< const TcpSocketBase > socket) |
TracedCallback signature for TCP packet retransmission events.
[in] | packet | The packet. |
[in] | header | The TcpHeader |
[in] | localAddr | The local address |
[in] | peerAddr | The peer/remote address |
[in] | socket | This socket |
Definition at line 664 of file tcp-socket-base.h.
typedef void(* ns3::TcpSocketBase::TcpTxRxTracedCallback) (const Ptr< const Packet > packet, const TcpHeader &header, const Ptr< const TcpSocketBase > socket) |
TracedCallback signature for TCP packet transmission or reception events.
[in] | packet | The packet. |
[in] | header | The TcpHeader |
[in] | socket | This socket |
Definition at line 651 of file tcp-socket-base.h.
Tcp Packet Types.
Taxonomy referred from Table 1 of https://www.ietf.org/archive/id/draft-ietf-tcpm-generalized-ecn-15.txt
Enumerator | |
---|---|
SYN | |
SYN_ACK | |
PURE_ACK | |
WINDOW_PROBE | |
FIN | |
RST | |
RE_XMT | |
DATA | |
INVALID |
Definition at line 249 of file tcp-socket-base.h.
ns3::TcpSocketBase::TcpSocketBase | ( | ) |
Create an unbound TCP socket.
Definition at line 298 of file tcp-socket-base.cc.
References ns3::CreateObject(), GetRWnd(), m_pacingTimer, m_rateOps, m_tcb, m_txBuffer, ns3::MakeCallback(), NotifyPacingPerformed(), NS_ASSERT, NS_LOG_FUNCTION, SendEmptyPacket(), ns3::Timer::SetFunction(), UpdateBytesInFlight(), UpdateCongState(), UpdateCwnd(), UpdateCwndInfl(), UpdateEcnState(), UpdateHighTxMark(), UpdateLastRtt(), UpdateNextTxSequence(), UpdatePacingRateTrace(), UpdateRtt(), and UpdateSsThresh().
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 362 of file tcp-socket-base.cc.
References ns3::Object::CopyObject, ns3::CreateObject(), GetRWnd(), m_congestionControl, m_pacingTimer, m_rateOps, m_recoveryOps, m_rtt, m_tcb, m_txBuffer, ns3::MakeCallback(), ns3::MakeNullCallback(), NotifyPacingPerformed(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, SendEmptyPacket(), ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Timer::SetFunction(), ns3::Socket::SetRecvCallback(), ns3::Socket::SetSendCallback(), UpdateBytesInFlight(), UpdateCongState(), UpdateCwnd(), UpdateCwndInfl(), UpdateEcnState(), UpdateHighTxMark(), UpdateLastRtt(), UpdateNextTxSequence(), UpdatePacingRateTrace(), UpdateRtt(), and UpdateSsThresh().
|
override |
Definition at line 502 of file tcp-socket-base.cc.
References CancelAllTimers(), m_endPoint, m_endPoint6, m_node, m_tcp, NS_ASSERT, and NS_LOG_FUNCTION.
|
protected |
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 4322 of file tcp-socket-base.cc.
References AddOptionTimestamp(), m_timestampEnabled, and NS_LOG_FUNCTION.
Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Add the SACK option to the header.
header | TcpHeader where the method should add the option |
Definition at line 4430 of file tcp-socket-base.cc.
References ns3::TcpHeader::AppendOption(), ns3::CreateObject(), ns3::Node::GetId(), ns3::TcpHeader::GetMaxOptionLength(), ns3::TcpHeader::GetOptionLength(), m_node, m_tcb, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
Referenced by SendEmptyPacket().
|
protected |
Add the SACK PERMITTED option to the header.
header | TcpHeader where the method should add the option |
Definition at line 4419 of file tcp-socket-base.cc.
References ns3::TcpHeader::AppendOption(), ns3::CreateObject(), ns3::TcpHeader::GetFlags(), ns3::Node::GetId(), m_node, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpHeader::SYN.
Referenced by 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 4487 of file tcp-socket-base.cc.
References ns3::TcpHeader::AppendOption(), ns3::CreateObject(), 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 4379 of file tcp-socket-base.cc.
References ns3::TcpHeader::AppendOption(), CalculateWScale(), ns3::CreateObject(), ns3::TcpHeader::GetFlags(), ns3::Node::GetId(), m_node, m_rcvWindShift, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpHeader::SYN.
Referenced by SendEmptyPacket().
Add Tags for the Socket.
p | Packet |
isEct | Whether the packet is allowed to be ECT capable |
Definition at line 3102 of file tcp-socket-base.cc.
References CheckNoEcn(), ns3::TcpSocketState::DctcpEcn, ns3::TcpSocketState::ECN_DISABLED, ns3::Socket::GetIpTos(), ns3::Socket::GetIpTtl(), ns3::Socket::GetIpv6HopLimit(), ns3::Socket::GetIpv6Tclass(), ns3::Socket::GetPriority(), ns3::Socket::IsManualIpTtl(), ns3::Socket::IsManualIpv6HopLimit(), ns3::Socket::IsManualIpv6Tclass(), m_tcb, MarkEcnCodePoint(), ns3::SocketIpv6HopLimitTag::SetHopLimit(), ns3::SocketPriorityTag::SetPriority(), ns3::SocketIpv6TclassTag::SetTclass(), ns3::SocketIpTosTag::SetTos(), and ns3::SocketIpTtlTag::SetTtl().
Referenced by PersistTimeout(), SendDataPacket(), and SendEmptyPacket().
|
protectedvirtual |
The amount of Rx window announced to the peer.
scale | indicate if the window should be scaled. True for almost all cases, except when we are sending a SYN |
Reimplemented in TcpSocketAdvertisedWindowProxy.
Definition at line 3578 of file tcp-socket-base.cc.
References m_advWnd, m_maxWinSize, m_rcvWindShift, m_tcb, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
Referenced by DoForwardUp(), PersistTimeout(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protectedvirtual |
Return unfilled portion of window.
Definition at line 3570 of file tcp-socket-base.cc.
References BytesInFlight(), and Window().
Referenced by Send(), and SendPendingData().
|
overridevirtual |
Allocate a local IPv4 endpoint for this socket.
Implements ns3::Socket.
Definition at line 575 of file tcp-socket-base.cc.
References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().
Referenced by Connect().
|
overridevirtual |
Allocate a local endpoint for this socket.
address | the address to try to allocate |
Implements ns3::Socket.
Definition at line 609 of file tcp-socket-base.cc.
References ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::ERROR_ADDRINUSE, ns3::Socket::ERROR_ADDRNOTAVAIL, ns3::Socket::ERROR_INVAL, ns3::Ipv4Address::GetAny(), ns3::Ipv6Address::GetAny(), ns3::Socket::GetBoundNetDevice(), ns3::InetSocketAddress::GetIpv4(), ns3::Inet6SocketAddress::GetIpv6(), ns3::Inet6SocketAddress::GetPort(), ns3::InetSocketAddress::GetPort(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_endPoint, m_endPoint6, m_errno, m_tcp, NS_LOG_FUNCTION, NS_LOG_LOGIC, port, and SetupCallback().
|
overridevirtual |
Allocate a local IPv6 endpoint for this socket.
Implements ns3::Socket.
Definition at line 591 of file tcp-socket-base.cc.
References ns3::Socket::ERROR_ADDRNOTAVAIL, m_endPoint6, m_errno, m_tcp, NS_LOG_FUNCTION, and SetupCallback().
Referenced by Connect().
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 1044 of file tcp-socket-base.cc.
References ns3::Ipv4EndPoint::BindToNetDevice(), ns3::Ipv6EndPoint::BindToNetDevice(), ns3::Socket::BindToNetDevice(), m_endPoint, m_endPoint6, and NS_LOG_FUNCTION.
|
protectedvirtual |
Return total bytes in flight.
Does not count segments lost and SACKed (or dupACKed)
Definition at line 3552 of file tcp-socket-base.cc.
References m_tcb, m_txBuffer, and NS_LOG_DEBUG.
Referenced by AvailableWindow(), EnterCwr(), EnterRecovery(), ProcessAck(), ReceivedAck(), ReTxTimeout(), and SendDataPacket().
|
protectedvirtual |
Calculate RTT sample for the ACKed packet.
Per RFC 6298 (Section 3), If m_timestampsEnabled
is true, calculate RTT using timestamps option. Otherwise, return RTT as the elapsed time since the packet was transmitted. If ACKed packed was a retrasmitted packet, return zero time.
tcpHeader | the packet's TCP header |
rttHistory | the ACKed packet's RTT History |
Definition at line 3717 of file tcp-socket-base.cc.
References ns3::RttHistory::count, ns3::DynamicCast(), ns3::TcpOptionTS::ElapsedTimeFromTsValue(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetOption(), ns3::TcpHeader::HasOption(), ns3::Time::IsZero(), m_timestampEnabled, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::RttHistory::retx, ns3::RttHistory::seq, ns3::RttHistory::time, and ns3::TcpOption::TS.
Referenced by EstimateRtt().
|
protected |
Calculate window scale value based on receive buffer space.
Calculate our factor from the rxBuffer max size
Definition at line 4354 of file tcp-socket-base.cc.
References ns3::Node::GetId(), m_maxWinSize, m_node, m_tcb, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
Referenced by AddOptionWScale().
|
protected |
Cancel all timer when endpoint is deleted.
Definition at line 4121 of file tcp-socket-base.cc.
References ns3::EventId::Cancel(), ns3::Timer::Cancel(), m_delAckEvent, m_lastAckEvent, m_pacingTimer, m_persistEvent, m_retxEvent, m_sendPendingDataEvent, and m_timewaitEvent.
Referenced by ~TcpSocketBase(), DeallocateEndPoint(), Destroy(), Destroy6(), and TimeWait().
|
inline |
Checks for CE codepoint.
tos | the TOS byte to check |
Definition at line 564 of file tcp-socket-base.h.
|
inline |
Checks for ECT(0) codepoint.
tos | the TOS byte to check |
Definition at line 542 of file tcp-socket-base.h.
|
inline |
Checks for ECT(1) codepoint.
tos | the TOS byte to check |
Definition at line 553 of file tcp-socket-base.h.
|
inline |
Checks if TOS has no ECN codepoints.
tos | the TOS byte to check |
Definition at line 531 of file tcp-socket-base.h.
Referenced by AddSocketTags().
|
inline |
Clears ECN bits from TOS.
tos | the TOS byte to modify |
Definition at line 520 of file tcp-socket-base.h.
|
overridevirtual |
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 808 of file tcp-socket-base.cc.
References DoClose(), m_closeOnEmpty, m_state, m_tcb, m_txBuffer, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_WARN, 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 1169 of file tcp-socket-base.cc.
References ns3::EventId::Cancel(), ns3::TcpSocket::CLOSED, DeallocateEndPoint(), ns3::EventId::IsPending(), m_closeNotified, m_lastAckEvent, m_state, ns3::Socket::NotifyNormalClose(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::TcpSocket::TcpStateName.
Referenced by DoClose(), DoConnect(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and TimeWait().
|
protectedvirtual |
Complete a connection by forking the socket.
This function is called only if a SYN received in LISTEN state. After TcpSocketBase cloned, allocate a new end point to handle the incoming connection and send a SYN+ACK to complete the handshake.
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 |
Reimplemented in ns3::TcpSocketMsgBase.
Definition at line 3034 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::Socket::GetBoundNetDevice(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_dataRetrCount, m_dataRetries, m_endPoint, m_endPoint6, m_state, m_synCount, m_synRetries, m_tcb, m_tcp, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::TcpSocketState::Off, SendEmptyPacket(), SetupCallback(), ns3::TcpHeader::SYN, and ns3::TcpSocket::SYN_RCVD.
Referenced by ns3::TcpSocketMsgBase::CompleteFork(), and ProcessListen().
|
overridevirtual |
Initiate a connection to a remote host.
address | Address of remote. |
Implements ns3::Socket.
Definition at line 713 of file tcp-socket-base.cc.
References Bind(), Bind6(), Connect(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), DoConnect(), ns3::Socket::ERROR_INVAL, ns3::InetSocketAddress::GetIpv4(), ns3::Ipv6Address::GetIpv4MappedAddress(), ns3::Inet6SocketAddress::GetIpv6(), ns3::Inet6SocketAddress::GetPort(), ns3::InetSocketAddress::GetPort(), ns3::Ipv6Address::IsIpv4MappedAddress(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_dataRetrCount, m_dataRetries, m_endPoint, m_endPoint6, m_errno, m_rtt, m_synCount, m_synRetries, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::Ipv4EndPoint::SetPeer(), ns3::Ipv6EndPoint::SetPeer(), SetupEndpoint(), and SetupEndpoint6().
Referenced by Connect().
|
protected |
Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded()
Definition at line 3088 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 2944 of file tcp-socket-base.cc.
References CancelAllTimers(), m_endPoint, m_endPoint6, m_tcp, ns3::MakeNullCallback(), ns3::Ipv4EndPoint::SetDestroyCallback(), and ns3::Ipv6EndPoint::SetDestroyCallback().
Referenced by CloseAndNotify(), LastAckTimeout(), ReTxTimeout(), SendEmptyPacket(), and SendRST().
|
protectedvirtual |
Action upon delay ACK timeout, i.e.
send an ACK
Definition at line 3990 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_EVENT_DELAYED_ACK, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_SENDING_ECE, m_congestionControl, m_delAckCount, m_tcb, 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 2748 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 2764 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 1127 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpSocket::CLOSE_WAIT, CloseAndNotify(), ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, m_state, NS_LOG_DEBUG, NS_LOG_FUNCTION, SendEmptyPacket(), SendRST(), ns3::TcpSocket::SYN_RCVD, ns3::TcpSocket::SYN_SENT, and ns3::TcpSocket::TIME_WAIT.
Referenced by Close().
|
protected |
Perform the real connection tasks: Send SYN if allowed, RST if invalid.
Definition at line 1093 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSE_WAIT, CloseAndNotify(), ns3::TcpSocket::CLOSED, ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, m_state, m_tcb, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::TcpSocketState::On, SendEmptyPacket(), SendRST(), ns3::TcpHeader::SYN, ns3::TcpSocket::SYN_SENT, ns3::TcpSocket::TcpStateName, and ns3::TcpSocket::TIME_WAIT.
Referenced by Connect().
|
protectedvirtual |
Called by TcpSocketBase::ForwardUp{,6}().
Get a packet from L3. This is the real function to handle the incoming packet from lower layers. This is wrapped by ForwardUp() so that this function can be overloaded by daughter classes.
packet | the incoming packet |
fromAddress | the address of the sender of packet |
toAddress | the address of the receiver of packet (hopefully, us) |
Definition at line 1346 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, AddOptions(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::Create(), ns3::TcpHeader::CWR, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, EstimateRtt(), ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TracedValue< T >::Get(), ns3::TcpHeader::GetAckNumber(), ns3::Simulator::GetDelayLeft(), ns3::TcpHeader::GetDestinationPort(), ns3::TcpHeader::GetFlags(), GetInitialCwnd(), GetInitialSSThresh(), ns3::TcpHeader::GetOption(), GetSegSize(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::GetSourcePort(), ns3::TcpHeader::GetWindowSize(), ns3::TcpHeader::HasOption(), ns3::EventId::IsExpired(), ns3::EventId::IsPending(), ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, ns3::Socket::m_boundnetdevice, m_connected, m_highRxAckMark, m_persistEvent, m_persistTimeout, m_retxEvent, m_rWnd, m_rxTrace, m_sackEnabled, m_state, m_tcb, m_tcp, m_timestampEnabled, m_txBuffer, m_txTrace, m_winScalingEnabled, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_LOGIC, PersistTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessListen(), ProcessOptionSackPermitted(), ProcessOptionTimestamp(), ProcessOptionWScale(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ns3::TcpHeader::PSH, ns3::TcpHeader::RST, ns3::TcpOption::SACKPERMITTED, ns3::Simulator::Schedule(), SendPendingData(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::TcpHeader::SYN, ns3::TcpSocket::SYN_RCVD, ns3::TcpSocket::SYN_SENT, ns3::TcpSocket::TcpStateName, ns3::TcpSocket::TIME_WAIT, ns3::TcpOption::TS, UpdateWindowSize(), ns3::TcpHeader::URG, and ns3::TcpOption::WINSCALE.
Referenced by ForwardUp(), and ForwardUp6().
|
protected |
FIN is in sequence, notify app and respond with a FIN.
Definition at line 2707 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, Close(), ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::ESTABLISHED, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TcpSocket::LAST_ACK, LastAckTimeout(), m_clockGranularity, m_closeNotified, m_dataRetrCount, m_dataRetries, m_lastAckEvent, m_rtt, m_shutdownSend, m_state, Max, ns3::Socket::NotifyNormalClose(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_LOGIC, ns3::Simulator::Schedule(), SendEmptyPacket(), ns3::TcpSocket::SYN_RCVD, and ns3::TcpSocket::TcpStateName.
Referenced by PeerClose(), and ReceivedData().
|
protected |
Retransmit the first segment marked as lost, without considering available window nor pacing.
Definition at line 4086 of file tcp-socket-base.cc.
References m_sackEnabled, m_tcb, m_txBuffer, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, and SendDataPacket().
Referenced by ProcessAck().
|
protected |
Dupack management.
currentDelivered | Current (S)ACKed bytes |
Definition at line 1737 of file tcp-socket-base.cc.
References ns3::TcpSocketState::CA_DISORDER, ns3::TcpSocketState::CA_LOSS, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, EnterRecovery(), m_congestionControl, m_dupAckCount, m_highRxAckMark, m_limitedTx, m_recover, m_recoverActive, m_recoveryOps, m_retxThresh, m_sackEnabled, m_tcb, m_txBuffer, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by ProcessAck().
|
protected |
Enter CA_CWR state upon receipt of an ECN Echo.
currentDelivered | Currently (S)ACKed bytes |
Definition at line 1652 of file tcp-socket-base.cc.
References BytesInFlight(), ns3::TcpSocketState::CA_CWR, m_congestionControl, m_dupAckCount, m_recover, m_recoveryOps, m_tcb, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::TcpSocketState::TcpCongStateName, and UnAckDataCount().
Referenced by ReceivedAck().
|
protected |
Enter the CA_RECOVERY, and retransmit the head.
currentDelivered | Currently (S)ACKed bytes |
Definition at line 1679 of file tcp-socket-base.cc.
References BytesInFlight(), ns3::TcpSocketState::CA_RECOVERY, m_congestionControl, m_dupAckCount, m_highRxAckMark, m_recover, m_recoverActive, m_recoveryOps, m_sackEnabled, m_tcb, m_txBuffer, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, SendDataPacket(), ns3::TcpSocketState::TcpCongStateName, and UnAckDataCount().
Referenced by DupAck().
|
protectedvirtual |
Take into account the packet for RTT estimation.
tcpHeader | the packet's TCP header |
Definition at line 3756 of file tcp-socket-base.cc.
References CalculateRttSample(), ns3::RttHistory::count, ns3::TcpHeader::GetAckNumber(), ns3::Time::IsZero(), m_clockGranularity, m_history, m_minRto, m_rto, m_rtt, m_tcb, Max, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::RttHistory::seq.
Referenced by DoForwardUp().
|
protectedvirtual |
Call CopyObject<> to clone me.
Reimplemented in ns3::TcpSocketCongestedRouter, ns3::TcpSocketMsgBase, ns3::TcpSocketSmallAcks, TcpDctcpCongestedRouter, TcpSocketAdvertisedWindowProxy, and TcpSocketHalfAck.
Definition at line 4676 of file tcp-socket-base.cc.
References ns3::Object::CopyObject.
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 1290 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 1306 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 1211 of file tcp-socket-base.cc.
References ns3::TcpSocketState::CA_EVENT_ECN_IS_CE, ns3::TcpSocketState::CA_EVENT_ECN_NO_CE, DoForwardUp(), ns3::Ipv4Header::ECN_CE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_DISABLED, ns3::Ipv4Header::ECN_NotECT, ns3::TcpSocketState::EcnStateName, ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetEcn(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::TcpHeader::GetSequenceNumber(), ns3::Ipv4Header::GetSource(), IsValidTcpSegment(), m_congestionControl, m_ecnCESeq, m_endPoint, m_tcb, NS_LOG_DEBUG, NS_LOG_INFO, NS_LOG_LOGIC, and port.
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 1251 of file tcp-socket-base.cc.
References ns3::TcpSocketState::CA_EVENT_ECN_IS_CE, ns3::TcpSocketState::CA_EVENT_ECN_NO_CE, DoForwardUp(), ns3::Ipv6Header::ECN_CE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::Ipv6Header::ECN_NotECT, ns3::TcpSocketState::EcnStateName, ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetEcn(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::TcpHeader::GetSequenceNumber(), ns3::Ipv6Header::GetSource(), IsValidTcpSegment(), m_congestionControl, m_ecnCESeq, m_endPoint6, m_tcb, NS_LOG_DEBUG, NS_LOG_INFO, NS_LOG_LOGIC, and port.
Referenced by SetupCallback().
|
overrideprotectedvirtual |
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 4316 of file tcp-socket-base.cc.
Time ns3::TcpSocketBase::GetClockGranularity | ( | ) | const |
Get the Clock Granularity (used in RTO calcs).
Definition at line 4567 of file tcp-socket-base.cc.
References m_clockGranularity.
Referenced by GetTypeId().
|
overrideprotectedvirtual |
Get the connection timeout.
Implements ns3::TcpSocket.
Definition at line 4224 of file tcp-socket-base.cc.
References m_cnTimeout.
|
overrideprotectedvirtual |
Get the number of data transmission retries before giving up.
Implements ns3::TcpSocket.
Definition at line 4250 of file tcp-socket-base.cc.
References m_dataRetries, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Get the number of packet to fire an ACK before delay timeout.
Implements ns3::TcpSocket.
Definition at line 4277 of file tcp-socket-base.cc.
References m_delAckMaxCount.
|
overrideprotectedvirtual |
Get the time to delay an ACK.
Implements ns3::TcpSocket.
Definition at line 4264 of file tcp-socket-base.cc.
References m_delAckTimeout.
|
overridevirtual |
Get last error number.
Implements ns3::Socket.
Definition at line 554 of file tcp-socket-base.cc.
References m_errno.
|
protected |
Get the current value of the receiver's highest (in-sequence) sequence number acked.
Definition at line 4819 of file tcp-socket-base.cc.
References ns3::TracedValue< T >::Get(), and m_highRxAckMark.
|
overrideprotectedvirtual |
Get the initial Congestion Window.
Implements ns3::TcpSocket.
Definition at line 706 of file tcp-socket-base.cc.
References m_tcb.
Referenced by DoForwardUp(), and IsPacingEnabled().
|
overrideprotectedvirtual |
Get the initial Slow Start Threshold.
Implements ns3::TcpSocket.
Definition at line 690 of file tcp-socket-base.cc.
References m_tcb.
Referenced by DoForwardUp().
|
overridevirtual |
Get the instance TypeId.
Reimplemented from ns3::Object.
Definition at line 293 of file tcp-socket-base.cc.
References GetTypeId().
Time ns3::TcpSocketBase::GetMinRto | ( | ) | const |
Get the Minimum RTO.
Definition at line 4554 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 568 of file tcp-socket-base.cc.
References m_node.
|
overridevirtual |
Get the peer address of a connected socket.
address | the address this socket is connected to. |
Implements ns3::Socket.
Definition at line 1016 of file tcp-socket-base.cc.
References ns3::Socket::ERROR_NOTCONN, ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), m_endPoint, m_endPoint6, m_errno, NS_ASSERT, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Get the timeout for persistent connection.
When the timeout expires, send 1-byte data to probe for the window size at the receiver when the local knowledge tells that the receiver has zero window size
Implements ns3::TcpSocket.
Definition at line 4303 of file tcp-socket-base.cc.
References m_persistTimeout.
|
overrideprotectedvirtual |
Get the receive buffer size.
Implements ns3::TcpSocket.
Definition at line 4195 of file tcp-socket-base.cc.
References m_tcb.
Referenced by SetRcvBufSize().
|
inline |
Get the retransmission threshold (dup ack threshold for a fast retransmit)
Definition at line 328 of file tcp-socket-base.h.
References m_retxThresh.
Referenced by GetTypeId().
|
protected |
Get the current value of the receiver's offered window (RCV.WND)
Definition at line 4813 of file tcp-socket-base.cc.
References ns3::TracedValue< T >::Get(), and m_rWnd.
Referenced by TcpSocketBase(), and TcpSocketBase().
|
overridevirtual |
Return number of bytes which can be returned from one or multiple calls to Recv.
Must be possible to call this method from the Recv callback.
Implements ns3::Socket.
Definition at line 987 of file tcp-socket-base.cc.
References m_tcb, and NS_LOG_FUNCTION.
Ptr< TcpRxBuffer > ns3::TcpSocketBase::GetRxBuffer | ( | ) | const |
Get a pointer to the Rx buffer.
Definition at line 4579 of file tcp-socket-base.cc.
References m_tcb.
Referenced by GetTypeId().
|
overrideprotectedvirtual |
Get the segment size.
Implements ns3::TcpSocket.
Definition at line 4211 of file tcp-socket-base.cc.
References m_tcb.
Referenced by DoForwardUp().
|
overrideprotectedvirtual |
Get the send buffer size.
Implements ns3::TcpSocket.
Definition at line 4162 of file tcp-socket-base.cc.
References m_txBuffer.
|
overridevirtual |
Implements ns3::Socket.
Definition at line 561 of file tcp-socket-base.cc.
References ns3::Socket::NS3_SOCK_STREAM.
|
overridevirtual |
Get socket address.
address | the address name this socket is associated with. |
Implements ns3::Socket.
Definition at line 995 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.
|
overrideprotectedvirtual |
Get the number of connection retries before giving up.
Implements ns3::TcpSocket.
Definition at line 4237 of file tcp-socket-base.cc.
References m_synRetries.
|
overrideprotectedvirtual |
Check if Nagle's algorithm is enabled or not.
Implements ns3::TcpSocket.
Definition at line 4290 of file tcp-socket-base.cc.
References m_noDelay.
|
overridevirtual |
Returns the number of bytes which can be sent in a single call to Send.
For datagram sockets, this returns the number of bytes that can be passed atomically through the underlying protocol.
For stream sockets, this returns the available space in bytes left in the transmit buffer.
Implements ns3::Socket.
Definition at line 979 of file tcp-socket-base.cc.
References m_txBuffer, and NS_LOG_FUNCTION.
Referenced by ConnectionSucceeded(), NewAck(), ProcessSynRcvd(), and SendPendingData().
Ptr< TcpTxBuffer > ns3::TcpSocketBase::GetTxBuffer | ( | ) | const |
Get a pointer to the Tx buffer.
Definition at line 4573 of file tcp-socket-base.cc.
References m_txBuffer.
Referenced by GetTypeId().
|
static |
Get the type ID.
Get the type ID.
Definition at line 94 of file tcp-socket-base.cc.
References ns3::TcpSocketState::AcceptOnly, GetClockGranularity(), GetMinRto(), GetRetxThresh(), GetRxBuffer(), GetTxBuffer(), m_advWnd, m_bytesInFlightTrace, m_congestionControl, m_congStateTrace, m_cWndInflTrace, m_cWndTrace, m_ecnCESeq, m_ecnCWRSeq, m_ecnEchoSeq, m_ecnStateTrace, m_highRxAckMark, m_highRxMark, m_highTxMarkTrace, m_icmpCallback, m_icmpCallback6, m_lastRttTrace, m_limitedTx, m_maxWinSize, m_msl, m_nextTxSequenceTrace, m_pacingRateTrace, m_recoveryOps, m_retransmissionTrace, m_rto, m_rWnd, m_rxTrace, m_sackEnabled, m_srttTrace, m_ssThTrace, m_state, m_timestampEnabled, m_txTrace, m_winScalingEnabled, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeCallbackAccessor(), ns3::MakeCallbackChecker(), ns3::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MilliSeconds(), ns3::TcpSocketState::Off, ns3::TcpSocketState::On, ns3::Seconds(), SetClockGranularity(), SetMinRto(), ns3::TypeId::SetParent(), SetRetxThresh(), and SetUseEcn().
Referenced by GetInstanceTypeId().
bool ns3::TcpSocketBase::IsEct | ( | TcpPacketType_t | packetType | ) | const |
Checks if a TCP packet should be ECN-capable (ECT) according to the TcpPacketType and ECN mode.
Currently, only Classic ECN and DCTCP ECN modes are supported, with potential extensions for future modes (Ecnpp).
packetType | The type of the TCP packet, represented by an enum TcpPacketType. |
Reference: https://www.ietf.org/archive/id/draft-ietf-tcpm-generalized-ecn-15.txt (Table 1)
Definition at line 4790 of file tcp-socket-base.cc.
References ns3::TcpSocketState::ECN_DISABLED, INVALID, m_tcb, NS_ABORT_MSG_IF, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by PersistTimeout(), SendDataPacket(), and SendEmptyPacket().
|
protected |
Return true if packets in the current window should be paced.
Definition at line 4701 of file tcp-socket-base.cc.
References GetInitialCwnd(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), and m_tcb.
Referenced by SendDataPacket(), and SendPendingData().
|
protected |
Return true if the specified option is enabled.
kind | kind of TCP option |
Definition at line 1611 of file tcp-socket-base.cc.
References m_sackEnabled, m_timestampEnabled, m_winScalingEnabled, NS_LOG_FUNCTION, ns3::TcpOption::SACK, ns3::TcpOption::SACKPERMITTED, ns3::TcpOption::TS, and ns3::TcpOption::WINSCALE.
|
protected |
Checks whether the given TCP segment is valid or not.
seq | the sequence number of packet's TCP header |
tcpHeaderSize | the size of packet's TCP header |
tcpPayloadSize | the size of TCP payload |
Definition at line 1322 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, m_state, m_tcb, NS_LOG_ERROR, NS_LOG_WARN, OutOfRange(), SendEmptyPacket(), and ns3::TcpSocket::TcpStateName.
Referenced by ForwardUp(), and ForwardUp6().
|
protectedvirtual |
Timeout at LAST_ACK, close the connection.
Definition at line 4007 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::EventId::Cancel(), DeallocateEndPoint(), ns3::TcpHeader::FIN, ns3::TcpSocket::LAST_ACK, LastAckTimeout(), m_clockGranularity, m_dataRetrCount, m_lastAckEvent, m_rtt, m_state, Max, ns3::Socket::NotifyErrorClose(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and SendEmptyPacket().
Referenced by DoPeerClose(), and LastAckTimeout().
|
overridevirtual |
Listen for incoming connections.
Implements ns3::Socket.
Definition at line 790 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSED, ns3::Socket::ERROR_INVAL, ns3::TcpSocket::LISTEN, m_errno, m_state, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
inline |
Mark CE codepoint.
tos | the TOS byte to modify |
Definition at line 509 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketCongestedRouter::SendDataPacket().
|
inline |
mark ECN code point
tos | the TOS byte to modify |
codePoint | the codepoint to use |
Definition at line 576 of file tcp-socket-base.h.
Referenced by AddSocketTags().
|
inline |
Mark ECT(0) codepoint.
tos | the TOS byte to modify |
Definition at line 487 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketCongestedRouter::SendDataPacket().
|
inline |
Mark ECT(1) codepoint.
tos | the TOS byte to modify |
Definition at line 498 of file tcp-socket-base.h.
|
protectedvirtual |
Update buffers w.r.t.
ACK
seq | the sequence number |
resetRTO | indicates if RTO should be reset |
Definition at line 3813 of file tcp-socket-base.cc.
References ns3::EventId::Cancel(), ns3::TcpSocket::CLOSING, ns3::TcpSocket::FIN_WAIT_1, ns3::Simulator::GetDelayLeft(), ns3::Time::GetSeconds(), GetTxAvailable(), m_clockGranularity, m_dataRetrCount, m_dataRetries, m_minRto, m_retxEvent, m_rto, m_rtt, m_state, m_tcb, m_txBuffer, Max, ns3::Socket::NotifySend(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ReTxTimeout(), ns3::Simulator::Schedule(), and ns3::TcpSocket::SYN_RCVD.
Referenced by ProcessAck().
|
protected |
Notify Pacing.
Definition at line 4693 of file tcp-socket-base.cc.
References m_connected, NS_LOG_FUNCTION, NS_LOG_INFO, and SendPendingData().
Referenced by TcpSocketBase(), and TcpSocketBase().
|
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 1190 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::CLOSING, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::LISTEN, m_state, m_tcb, ns3::TcpSocket::SYN_RCVD, and ns3::TcpSocket::SYN_SENT.
Referenced by IsValidTcpSegment().
Received a FIN from peer, notify rx buffer.
p | the packet |
tcpHeader | the packet's TCP header |
Definition at line 2668 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSING, DoPeerClose(), ns3::TcpSocket::FIN_WAIT_1, ns3::TcpHeader::GetSequenceNumber(), m_state, m_tcb, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ReceivedData().
Referenced by ProcessEstablished(), and ProcessSynRcvd().
|
protectedvirtual |
Send 1 byte probe to get an updated window size.
Definition at line 4033 of file tcp-socket-base.cc.
References AddOptions(), AddSocketTags(), AdvertisedWindowSize(), ns3::TcpSocketState::ECN_DISABLED, ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), IsEct(), ns3::Socket::m_boundnetdevice, m_endPoint, m_endPoint6, m_persistEvent, m_persistTimeout, m_tcb, m_tcp, m_txBuffer, m_txTrace, ns3::Simulator::Now(), NS_LOG_LOGIC, PersistTimeout(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), and WINDOW_PROBE.
Referenced by DoForwardUp(), and PersistTimeout().
|
protectedvirtual |
Process a received ack.
ackNumber | ack number |
scoreboardUpdated | if true indicates that the scoreboard has been |
oldHeadSequence | value of HeadSequence before ack updated with SACK information |
currentDelivered | The number of bytes (S)ACKed |
receivedData | if true indicates that data is piggybacked with ACK |
Definition at line 1968 of file tcp-socket-base.cc.
References BytesInFlight(), ns3::TcpSocketState::CA_CWR, ns3::TcpSocketState::CA_DISORDER, ns3::TcpSocketState::CA_EVENT_COMPLETE_CWR, ns3::TcpSocketState::CA_LOSS, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, DoRetransmit(), DupAck(), m_bytesAckedNotProcessed, m_congestionControl, m_dupAckCount, m_isFirstPartialAck, m_recover, m_recoverActive, m_recoveryOps, m_sackEnabled, m_tcb, m_txBuffer, NewAck(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, SafeSubtraction(), ns3::TcpSocketState::TcpCongStateName, and UpdatePacingRate().
Referenced by ReceivedAck().
|
protected |
Received a packet upon CLOSING.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 2598 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_tcb, 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 1528 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_SENDING_ECE, ns3::TcpSocketState::EcnStateName, ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), m_tcb, m_txBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, PeerClose(), ns3::TcpHeader::PSH, ReceivedAck(), ReceivedData(), ns3::TcpHeader::RST, SendEmptyPacket(), 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 2631 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_tcb, 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 2275 of file tcp-socket-base.cc.
References CompleteFork(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, Fork(), ns3::TcpHeader::GetFlags(), ns3::Socket::NotifyConnectionRequest(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ns3::Simulator::ScheduleNow(), ns3::TcpHeader::SYN, and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
Read the SACK option.
option | SACK option from the header |
Definition at line 4399 of file tcp-socket-base.cc.
References ns3::DynamicCast(), m_rateOps, m_txBuffer, ns3::MakeCallback(), NS_LOG_FUNCTION, and ns3::TcpRateOps::SkbDelivered().
Referenced by ReadOptions().
|
protected |
Read the SACK PERMITTED option.
Currently this is a placeholder, since no operations should be done on such option.
option | SACK PERMITTED option from the header |
Definition at line 4408 of file tcp-socket-base.cc.
References ns3::DynamicCast(), ns3::Node::GetId(), m_node, m_sackEnabled, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by DoForwardUp().
|
protected |
Process the timestamp option from other side.
Get the timestamp and the echo, then save timestamp (which will be the echo value in our out-packets) and save the echoed timestamp, to utilize later to calculate RTT.
option | Option from the segment |
seq | Sequence number of the segment |
Definition at line 4459 of file tcp-socket-base.cc.
References ns3::DynamicCast(), ns3::Node::GetId(), m_highTxAck, m_node, m_tcb, m_timestampToEcho, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by DoForwardUp().
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 4333 of file tcp-socket-base.cc.
References ns3::DynamicCast(), ns3::Node::GetId(), m_node, m_sndWindShift, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
Referenced by DoForwardUp().
|
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 2410 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_OPEN, ns3::EventId::Cancel(), CloseAndNotify(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), GetTxAvailable(), m_congestionControl, m_connected, m_delAckCount, m_delAckMaxCount, m_endPoint, m_endPoint6, m_retxEvent, m_state, m_tcb, m_txBuffer, ns3::Socket::NotifyNewConnectionCreated(), ns3::Socket::NotifySend(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpSocketState::Off, PeerClose(), ns3::TcpHeader::PSH, ReceivedAck(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), ns3::Ipv4EndPoint::SetPeer(), ns3::Ipv6EndPoint::SetPeer(), ns3::TcpHeader::SYN, UpdatePacingRate(), and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Received a packet upon SYN_SENT.
packet | the packet |
tcpHeader | the packet's TCP header |
Definition at line 2312 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_OPEN, ns3::EventId::Cancel(), CloseAndNotify(), ConnectionSucceeded(), ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_congestionControl, m_connected, m_delAckCount, m_delAckMaxCount, m_retxEvent, m_state, m_synCount, m_synRetries, m_tcb, m_txBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpSocketState::Off, ns3::TcpHeader::PSH, ReceivedData(), ns3::TcpHeader::RST, ns3::Simulator::ScheduleNow(), SendEmptyPacket(), SendPendingData(), SendRST(), ns3::TcpHeader::SYN, ns3::TcpSocket::SYN_RCVD, UpdatePacingRate(), 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 2525 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, CloseAndNotify(), ns3::TcpSocket::CLOSING, ns3::TcpHeader::CWR, ns3::TcpHeader::ECE, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::FIN_WAIT_2, ns3::TcpHeader::FlagsToString(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), m_shutdownRecv, m_state, m_tcb, m_txBuffer, ns3::Socket::NotifyDataRecv(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::TcpHeader::PSH, ReceivedAck(), ReceivedData(), ns3::TcpHeader::RST, SendEmptyPacket(), SendRST(), ns3::TcpHeader::SYN, TimeWait(), and ns3::TcpHeader::URG.
Referenced by DoForwardUp().
|
protected |
Read TCP options before Ack processing.
Timestamp and Window scale are managed in other pieces of code.
tcpHeader | Header of the segment | |
[out] | bytesSacked | Number of bytes SACKed, or 0 |
Definition at line 1631 of file tcp-socket-base.cc.
References ns3::TcpHeader::GetOptionList(), NS_LOG_FUNCTION, ProcessOptionSack(), and ns3::TcpOption::SACK.
Referenced by ReceivedAck().
|
protectedvirtual |
Received an ACK packet.
packet | the packet |
tcpHeader | the packet's TCP header |
Reimplemented in ns3::TcpSocketMsgBase.
Definition at line 1846 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, BytesInFlight(), ns3::TcpSocketState::CA_CWR, ns3::TcpSocketState::CA_EVENT_COMPLETE_CWR, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_DISABLED, ns3::TcpSocketState::ECN_ECE_RCVD, ns3::TcpSocketState::ECN_IDLE, ns3::TcpSocketState::EcnStateName, EnterCwr(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), m_congestionControl, m_connected, m_ecnEchoSeq, m_rateOps, m_recover, m_recoveryOps, m_tcb, m_txBuffer, ns3::MakeCallback(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ProcessAck(), ReadOptions(), ReceivedData(), SendPendingData(), ns3::TcpRateOps::SkbDelivered(), and ns3::TcpSocketState::TcpCongStateName.
Referenced by ProcessEstablished(), ProcessSynRcvd(), ProcessWait(), and ns3::TcpSocketMsgBase::ReceivedAck().
|
protectedvirtual |
Recv of a data, put into buffer, call L7 to get it if necessary.
packet | the packet |
tcpHeader | the packet's TCP header |
Reimplemented in TcpSocketHalfAck.
Definition at line 3619 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpSocketState::CA_EVENT_DELAYED_ACK, ns3::TcpSocketState::CA_EVENT_NON_DELAYED_ACK, ns3::EventId::Cancel(), DelAckTimeout(), DoPeerClose(), ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_SENDING_ECE, ns3::TcpSocketState::EcnStateName, ns3::TcpHeader::FIN, ns3::Simulator::GetDelayLeft(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::EventId::IsExpired(), m_closeNotified, m_congestionControl, m_delAckCount, m_delAckEvent, m_delAckMaxCount, m_delAckTimeout, m_shutdownRecv, m_tcb, ns3::Socket::NotifyDataRecv(), ns3::Simulator::Now(), NS_LOG_DEBUG, 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 938 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSE_WAIT, ns3::Create(), m_state, m_tcb, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
|
overridevirtual |
Read a single packet from the socket and retrieve the sender address.
Calls Recv(maxSize, flags) with maxSize implicitly set to maximum sized integer, and flags set to zero.
This method has similar semantics to Recv () but subclasses may want to provide checks on socket state, so the implementation is pushed to subclasses.
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 952 of file tcp-socket-base.cc.
References ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Ipv4Address::GetZero(), m_endPoint, m_endPoint6, NS_LOG_FUNCTION, and ns3::Socket::Recv().
|
protectedvirtual |
An RTO event happened.
Reimplemented in ns3::TcpSocketCongestedRouter, ns3::TcpSocketMsgBase, and TcpDctcpCongestedRouter.
Definition at line 3860 of file tcp-socket-base.cc.
References BytesInFlight(), ns3::TcpSocketState::CA_EVENT_LOSS, ns3::TcpSocketState::CA_LOSS, ns3::Timer::Cancel(), ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::TcpHeader::CWR, DeallocateEndPoint(), ns3::TcpHeader::ECE, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::Time::FromDouble(), m_congestionControl, m_connected, m_dataRetrCount, m_dupAckCount, m_history, m_pacingTimer, m_recover, m_recoverActive, m_rto, m_sackEnabled, m_state, m_synCount, m_tcb, m_txBuffer, Min, ns3::Socket::NotifyErrorClose(), ns3::Simulator::Now(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::TcpSocketState::On, ns3::Time::S, SendEmptyPacket(), SendPendingData(), ns3::TcpHeader::SYN, ns3::TcpSocket::SYN_SENT, and ns3::TcpSocket::TIME_WAIT.
Referenced by NewAck(), ns3::TcpSocketCongestedRouter::ReTxTimeout(), ns3::TcpSocketMsgBase::ReTxTimeout(), TcpDctcpCongestedRouter::ReTxTimeout(), and SendDataPacket().
Performs a safe subtraction between a and b (a-b)
Safe is used to indicate that, if b>a, the results returned is 0.
a | first number |
b | second number |
Definition at line 4682 of file tcp-socket-base.cc.
Referenced by ProcessAck().
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 880 of file tcp-socket-base.cc.
References AvailableWindow(), ns3::TcpSocket::CLOSE_WAIT, ns3::Socket::ERROR_MSGSIZE, ns3::Socket::ERROR_NOTCONN, ns3::Socket::ERROR_SHUTDOWN, ns3::TcpSocket::ESTABLISHED, ns3::EventId::IsPending(), m_connected, m_errno, m_rateOps, m_sendPendingDataEvent, m_shutdownSend, m_state, m_tcb, m_txBuffer, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), SendPendingData(), ns3::TcpSocket::SYN_SENT, and ns3::TcpSocket::TcpStateName.
Referenced by SendTo().
|
protectedvirtual |
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 |
Reimplemented in ns3::TcpSocketCongestedRouter, and TcpDctcpCongestedRouter.
Definition at line 3187 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, AddOptions(), AddSocketTags(), AdvertisedWindowSize(), BytesInFlight(), ns3::TcpSocketState::CA_CWR, ns3::TcpSocketState::CA_RECOVERY, ns3::EventId::Cancel(), ns3::TcpSocket::CLOSE_WAIT, ns3::TcpHeader::CWR, DATA, ns3::TcpSocketState::ECN_CWR_SENT, ns3::TcpSocketState::ECN_ECE_RCVD, ns3::TcpSocketState::EcnStateName, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TracedValue< T >::Get(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::TcpTxItem::GetPacketCopy(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Time::GetSeconds(), IsEct(), ns3::EventId::IsExpired(), ns3::Timer::IsExpired(), IsPacingEnabled(), ns3::TcpTxItem::IsRetrans(), ns3::TcpSocket::LAST_ACK, ns3::Socket::m_boundnetdevice, m_closeOnEmpty, m_delAckCount, m_delAckEvent, m_ecnCWRSeq, m_ecnEchoSeq, m_endPoint, m_endPoint6, m_highRxAckMark, m_pacingTimer, m_rateOps, m_recoveryOps, m_retransmissionTrace, m_retxEvent, m_rto, m_rWnd, m_state, m_tcb, m_tcp, m_txBuffer, m_txTrace, ns3::Socket::NotifyDataSent(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, RE_XMT, ReTxTimeout(), ns3::Simulator::Schedule(), ns3::Timer::Schedule(), ns3::Simulator::ScheduleNow(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), and UpdateRttHistory().
Referenced by DoRetransmit(), EnterRecovery(), and SendPendingData().
|
protectedvirtual |
Send a empty packet that carries a flag, e.g., ACK.
flags | the packet's flags |
Reimplemented in ns3::TcpSocketSmallAcks.
Definition at line 2779 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, AddOptions(), AddOptionSack(), AddOptionSackPermitted(), AddOptionWScale(), AddSocketTags(), AdvertisedWindowSize(), ns3::EventId::Cancel(), ns3::TcpSocket::CLOSED, ns3::TcpSocket::CLOSING, ns3::Create(), DeallocateEndPoint(), ns3::TcpHeader::FIN, FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpHeader::GetAckNumber(), ns3::Ipv4EndPoint::GetLocalAddress(), ns3::Ipv6EndPoint::GetLocalAddress(), ns3::Ipv4EndPoint::GetLocalPort(), ns3::Ipv6EndPoint::GetLocalPort(), ns3::Ipv4EndPoint::GetPeerAddress(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Ipv4EndPoint::GetPeerPort(), ns3::Ipv6EndPoint::GetPeerPort(), ns3::Time::GetSeconds(), INVALID, IsEct(), ns3::EventId::IsExpired(), ns3::TcpSocket::LAST_ACK, ns3::Socket::m_boundnetdevice, m_clockGranularity, m_cnTimeout, m_delAckCount, m_delAckEvent, m_endPoint, m_endPoint6, m_highTxAck, m_minRto, m_retxEvent, m_rto, m_rtt, m_sackEnabled, m_state, m_synCount, m_synRetries, m_tcb, m_tcp, m_txTrace, m_winScalingEnabled, Max, ns3::Socket::NotifyConnectionFailed(), ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, NS_LOG_WARN, PURE_ACK, ns3::TcpHeader::RST, RST, ns3::Simulator::Schedule(), SendEmptyPacket(), ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::TcpHeader::SetSequenceNumber(), ns3::TcpHeader::SetSourcePort(), ns3::TcpHeader::SetWindowSize(), ns3::TcpHeader::SYN, SYN, SYN_ACK, and UpdateRttHistory().
Referenced by TcpSocketBase(), TcpSocketBase(), CompleteFork(), DelAckTimeout(), DoClose(), DoConnect(), DoPeerClose(), IsValidTcpSegment(), LastAckTimeout(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedData(), ReTxTimeout(), SendEmptyPacket(), SendRST(), SetRcvBufSize(), 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 3385 of file tcp-socket-base.cc.
References AvailableWindow(), ns3::TcpSocketState::CA_DISORDER, ns3::TcpSocketState::CA_EVENT_TX_START, ns3::TcpSocketState::CA_OPEN, ns3::TcpSocketState::CA_RECOVERY, ns3::TcpSocket::FIN_WAIT_1, ns3::Timer::GetDelayLeft(), GetTxAvailable(), ns3::Timer::IsExpired(), IsPacingEnabled(), ns3::Timer::IsRunning(), m_congestionControl, m_endPoint, m_endPoint6, m_limitedTx, m_noDelay, m_pacingTimer, m_rWnd, m_sackEnabled, m_shutdownSend, m_state, m_tcb, m_txBuffer, ns3::Socket::NotifySend(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Timer::Schedule(), SendDataPacket(), and UnAckDataCount().
Referenced by DoForwardUp(), NotifyPacingPerformed(), ProcessSynSent(), ReceivedAck(), ReTxTimeout(), and Send().
|
protected |
Send reset and tear down this socket.
Definition at line 2934 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().
|
overridevirtual |
Send data to a specified peer.
This method has similar semantics to Send () but subclasses may want to provide checks on socket state, so the implementation is pushed to subclasses.
Implements ns3::Socket.
Definition at line 930 of file tcp-socket-base.cc.
References Send().
|
overrideprotectedvirtual |
Configure whether broadcast datagram transmissions are allowed.
This method corresponds to using setsockopt() SO_BROADCAST of real network or BSD sockets. If set on a socket, this option will enable or disable packets to be transmitted to broadcast destination addresses.
allowBroadcast | Whether broadcast is allowed |
Implements ns3::Socket.
Definition at line 4309 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 4560 of file tcp-socket-base.cc.
References m_clockGranularity, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::TcpSocketBase::SetCongestionControlAlgorithm | ( | Ptr< TcpCongestionOps > | algo | ) |
Install a congestion control algorithm on this socket.
algo | Algorithm to be installed |
Definition at line 4661 of file tcp-socket-base.cc.
References m_congestionControl, m_tcb, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Set the connection timeout.
timeout | the connection timeout |
Implements ns3::TcpSocket.
Definition at line 4217 of file tcp-socket-base.cc.
References m_cnTimeout, NS_LOG_FUNCTION, and timeout.
|
overrideprotectedvirtual |
Set the number of data transmission retries before giving up.
retries | the number of data transmission retries |
Implements ns3::TcpSocket.
Definition at line 4243 of file tcp-socket-base.cc.
References m_dataRetries, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
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 4270 of file tcp-socket-base.cc.
References m_delAckMaxCount, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Set the time to delay an ACK.
timeout | the time to delay an ACK |
Implements ns3::TcpSocket.
Definition at line 4257 of file tcp-socket-base.cc.
References m_delAckTimeout, NS_LOG_FUNCTION, and timeout.
|
overrideprotectedvirtual |
Set the initial Congestion Window.
cwnd | the initial congestion window (in segments) |
Implements ns3::TcpSocket.
Definition at line 696 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSED, m_state, m_tcb, and NS_ABORT_MSG_UNLESS.
|
overrideprotectedvirtual |
Set the initial Slow Start Threshold.
threshold | the Slow Start Threshold (in bytes) |
Implements ns3::TcpSocket.
Definition at line 680 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSED, m_state, m_tcb, and NS_ABORT_MSG_UNLESS.
void ns3::TcpSocketBase::SetMinRto | ( | Time | minRto | ) |
Sets the Minimum RTO.
minRto | The minimum RTO. |
Definition at line 4547 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 533 of file tcp-socket-base.cc.
References m_node.
void ns3::TcpSocketBase::SetPaceInitialWindow | ( | bool | paceWindow | ) |
Enable or disable pacing of the initial window.
paceWindow | Boolean to enable or disable pacing of the initial window |
Definition at line 4783 of file tcp-socket-base.cc.
References m_tcb, and NS_LOG_FUNCTION.
void ns3::TcpSocketBase::SetPacingStatus | ( | bool | pacing | ) |
Enable or disable pacing.
pacing | Boolean to enable or disable pacing |
Definition at line 4776 of file tcp-socket-base.cc.
References m_tcb, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Set the timeout for persistent connection.
When the timeout expires, send 1-byte data to probe for the window size at the receiver when the local knowledge tells that the receiver has zero window size
timeout | the persistent timeout |
Implements ns3::TcpSocket.
Definition at line 4296 of file tcp-socket-base.cc.
References m_persistTimeout, NS_LOG_FUNCTION, and timeout.
|
overrideprotectedvirtual |
Set the receive buffer size.
size | the buffer size (in bytes) |
Implements ns3::TcpSocket.
Definition at line 4168 of file tcp-socket-base.cc.
References ns3::TcpHeader::ACK, ns3::TcpHeader::ECE, ns3::TcpSocketState::ECN_CE_RCVD, ns3::TcpSocketState::ECN_SENDING_ECE, ns3::TcpSocketState::EcnStateName, GetRcvBufSize(), m_connected, m_tcb, NS_LOG_DEBUG, NS_LOG_FUNCTION, and SendEmptyPacket().
void ns3::TcpSocketBase::SetRecoveryAlgorithm | ( | Ptr< TcpRecoveryOps > | recovery | ) |
Install a recovery algorithm on this socket.
recovery | Algorithm to be installed |
Definition at line 4669 of file tcp-socket-base.cc.
References m_recoveryOps, and NS_LOG_FUNCTION.
void ns3::TcpSocketBase::SetRetxThresh | ( | uint32_t | retxThresh | ) |
Set the retransmission threshold (dup ack threshold for a fast retransmit)
retxThresh | the threshold |
Definition at line 4585 of file tcp-socket-base.cc.
References m_retxThresh, and m_txBuffer.
Referenced by GetTypeId().
|
virtual |
Set the associated RTT estimator.
rtt | the RTT estimator |
Definition at line 547 of file tcp-socket-base.cc.
References m_rtt.
|
overrideprotectedvirtual |
Set the segment size.
size | the segment size (in bytes) |
Implements ns3::TcpSocket.
Definition at line 4201 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSED, m_state, m_tcb, m_txBuffer, NS_ABORT_MSG_UNLESS, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Set the send buffer size.
size | the buffer size (in bytes) |
Implements ns3::TcpSocket.
Definition at line 4155 of file tcp-socket-base.cc.
References m_txBuffer, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Set the number of connection retries before giving up.
count | the number of connection retries |
Implements ns3::TcpSocket.
Definition at line 4230 of file tcp-socket-base.cc.
References m_synRetries, and NS_LOG_FUNCTION.
|
virtual |
Set the associated TCP L4 protocol.
tcp | the TCP L4 protocol |
Definition at line 540 of file tcp-socket-base.cc.
References m_tcp.
|
overrideprotectedvirtual |
Enable/Disable Nagle's algorithm.
noDelay | true to DISABLE Nagle's algorithm |
Implements ns3::TcpSocket.
Definition at line 4283 of file tcp-socket-base.cc.
References m_noDelay, and NS_LOG_FUNCTION.
|
protected |
Common part of the two Bind(), i.e.
set callback and remembering local addr:port
Definition at line 1061 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(), Bind(), Bind6(), and CompleteFork().
|
protected |
Configure the endpoint to a local address.
Called by Connect() if Bind() didn't specify one.
Definition at line 2971 of file tcp-socket-base.cc.
References ns3::Object::GetObject(), ns3::Ipv4EndPoint::GetPeerAddress(), 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 3001 of file tcp-socket-base.cc.
References ns3::Object::GetObject(), ns3::Ipv6EndPoint::GetPeerAddress(), ns3::Socket::m_boundnetdevice, m_endPoint6, m_errno, m_node, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6Header::SetDestination(), and ns3::Ipv6EndPoint::SetLocalAddress().
Referenced by Connect().
void ns3::TcpSocketBase::SetUseEcn | ( | TcpSocketState::UseEcn_t | useEcn | ) |
Set ECN mode of use on the socket.
useEcn | Mode of ECN to use. |
Definition at line 4806 of file tcp-socket-base.cc.
References m_tcb, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
overridevirtual |
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 870 of file tcp-socket-base.cc.
References m_shutdownRecv, and NS_LOG_FUNCTION.
|
overridevirtual |
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 836 of file tcp-socket-base.cc.
References ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::FIN, ns3::TcpSocket::FIN_WAIT_1, ns3::TcpSocket::LAST_ACK, m_closeOnEmpty, m_shutdownSend, m_state, m_txBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and SendEmptyPacket().
|
protected |
Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state.
Definition at line 4134 of file tcp-socket-base.cc.
References CancelAllTimers(), CloseAndNotify(), m_closeNotified, m_msl, m_state, m_timewaitEvent, ns3::Socket::NotifyNormalClose(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::TcpSocket::TcpStateName, and ns3::TcpSocket::TIME_WAIT.
Referenced by ProcessClosing(), and ProcessWait().
|
protectedvirtual |
Return count of number of unacked bytes.
The difference between SND.UNA and HighTx
Definition at line 3546 of file tcp-socket-base.cc.
References m_tcb, and m_txBuffer.
Referenced by EnterCwr(), EnterRecovery(), and SendPendingData().
Callback function to hook to TcpSocketState bytes inflight.
oldValue | old bytesInFlight value |
newValue | new bytesInFlight value |
Definition at line 4643 of file tcp-socket-base.cc.
References m_bytesInFlightTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
void ns3::TcpSocketBase::UpdateCongState | ( | TcpSocketState::TcpCongState_t | oldValue, |
TcpSocketState::TcpCongState_t | newValue ) const |
Callback function to hook to TcpSocketState congestion state.
oldValue | old congestion state value |
newValue | new congestion state value |
Definition at line 4616 of file tcp-socket-base.cc.
References m_congStateTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
Callback function to hook to TcpSocketState congestion window.
oldValue | old cWnd value |
newValue | new cWnd value |
Definition at line 4598 of file tcp-socket-base.cc.
References m_cWndTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
Callback function to hook to TcpSocketState inflated congestion window.
oldValue | old cWndInfl value |
newValue | new cWndInfl value |
Definition at line 4604 of file tcp-socket-base.cc.
References m_cWndInflTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
void ns3::TcpSocketBase::UpdateEcnState | ( | TcpSocketState::EcnState_t | oldValue, |
TcpSocketState::EcnState_t | newValue ) const |
Callback function to hook to EcnState state.
oldValue | old ecn state value |
newValue | new ecn state value |
Definition at line 4623 of file tcp-socket-base.cc.
References m_ecnStateTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
void ns3::TcpSocketBase::UpdateHighTxMark | ( | SequenceNumber32 | oldValue, |
SequenceNumber32 | newValue ) const |
Callback function to hook to TcpSocketState high tx mark.
oldValue | old high tx mark |
newValue | new high tx mark |
Definition at line 4637 of file tcp-socket-base.cc.
References m_highTxMarkTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
Callback function to hook to TcpSocketState lastRtt.
oldValue | old lastRtt value |
newValue | new lastRtt value |
Definition at line 4655 of file tcp-socket-base.cc.
References m_lastRttTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
void ns3::TcpSocketBase::UpdateNextTxSequence | ( | SequenceNumber32 | oldValue, |
SequenceNumber32 | newValue ) const |
Callback function to hook to TcpSocketState next tx sequence.
oldValue | old nextTxSeq value |
newValue | new nextTxSeq value |
Definition at line 4630 of file tcp-socket-base.cc.
References m_nextTxSequenceTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
|
protected |
Dynamically update the pacing rate.
Definition at line 4723 of file tcp-socket-base.cc.
References ns3::Time::GetSeconds(), m_congestionControl, m_tcb, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ProcessAck(), ProcessSynRcvd(), and ProcessSynSent().
Callback function to hook to TcpSocketState pacing rate.
oldValue | old pacing rate value |
newValue | new pacing rate value |
Definition at line 4592 of file tcp-socket-base.cc.
References m_pacingRateTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
Callback function to hook to TcpSocketState rtt.
oldValue | old rtt value |
newValue | new rtt value |
Definition at line 4649 of file tcp-socket-base.cc.
References m_srttTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
|
protectedvirtual |
Update the RTT history, when we send TCP segments.
seq | The sequence number of the TCP segment |
sz | The segment's size |
isRetransmission | Whether or not the segment is a retransmission |
Reimplemented in ns3::TcpSocketMsgBase.
Definition at line 3360 of file tcp-socket-base.cc.
References m_history, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketMsgBase::UpdateRttHistory().
Callback function to hook to TcpSocketState slow start threshold.
oldValue | old ssTh value |
newValue | new ssTh value |
Definition at line 4610 of file tcp-socket-base.cc.
References m_ssThTrace.
Referenced by TcpSocketBase(), and TcpSocketBase().
|
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 4502 of file tcp-socket-base.cc.
References ns3::TcpSocket::ESTABLISHED, ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::GetWindowSize(), m_highRxAckMark, m_highRxMark, m_rWnd, m_sndWindShift, m_state, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
Referenced by DoForwardUp().
|
protectedvirtual |
Return the max possible number of unacked bytes.
Definition at line 3564 of file tcp-socket-base.cc.
References ns3::TracedValue< T >::Get(), m_rWnd, and m_tcb.
Referenced by AvailableWindow().
|
friend |
TcpGeneralTest friend class (for tests).
Definition at line 228 of file tcp-socket-base.h.
|
protected |
Advertised Window size.
Definition at line 1410 of file tcp-socket-base.h.
Referenced by AdvertisedWindowSize(), and GetTypeId().
|
protected |
Bytes acked, but not processed.
Definition at line 1407 of file tcp-socket-base.h.
Referenced by ProcessAck().
TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_bytesInFlightTrace |
Callback pointer for bytesInFlight trace chaining.
Definition at line 376 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateBytesInFlight().
Clock Granularity used in RTO calcs.
Definition at line 1370 of file tcp-socket-base.h.
Referenced by DoPeerClose(), EstimateRtt(), GetClockGranularity(), LastAckTimeout(), NewAck(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetClockGranularity().
|
protected |
Told app to close socket.
Definition at line 1398 of file tcp-socket-base.h.
Referenced by CloseAndNotify(), DoPeerClose(), ReceivedData(), and TimeWait().
|
protected |
Close socket upon tx buffer emptied.
Definition at line 1399 of file tcp-socket-base.h.
Referenced by Close(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), and ShutdownSend().
Timeout for connection retry.
Definition at line 1373 of file tcp-socket-base.h.
Referenced by GetConnTimeout(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetConnTimeout().
|
protected |
Congestion control.
Definition at line 1435 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), DelAckTimeout(), DupAck(), EnterCwr(), EnterRecovery(), ForwardUp(), ForwardUp6(), GetTypeId(), ProcessAck(), ProcessSynRcvd(), ProcessSynSent(), ReceivedAck(), ReceivedData(), ReTxTimeout(), TcpDctcpCongestedRouter::SendDataPacket(), SendPendingData(), SetCongestionControlAlgorithm(), and UpdatePacingRate().
TracedCallback<TcpSocketState::TcpCongState_t, TcpSocketState::TcpCongState_t> ns3::TcpSocketBase::m_congStateTrace |
Callback pointer for congestion state trace chaining.
Definition at line 356 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateCongState().
|
protected |
Connection established.
Definition at line 1402 of file tcp-socket-base.h.
Referenced by DoForwardUp(), NotifyPacingPerformed(), ProcessSynRcvd(), ProcessSynSent(), ReceivedAck(), ReTxTimeout(), Send(), and SetRcvBufSize().
TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_cWndInflTrace |
Callback pointer for cWndInfl trace chaining.
Definition at line 346 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateCwndInfl().
TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_cWndTrace |
Callback pointer for cWnd trace chaining.
Definition at line 341 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateCwnd().
|
protected |
Count of remaining data retransmission attempts.
Definition at line 1364 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), DoPeerClose(), LastAckTimeout(), NewAck(), and ReTxTimeout().
|
protected |
Number of data retransmission attempts.
Definition at line 1365 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), DoPeerClose(), GetDataRetries(), NewAck(), and SetDataRetries().
|
protected |
Delayed ACK counter.
Definition at line 1355 of file tcp-socket-base.h.
Referenced by DelAckTimeout(), ProcessSynRcvd(), ProcessSynSent(), ReceivedData(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Delayed ACK timeout event.
Definition at line 1349 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), ReceivedData(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Number of packet to fire an ACK before delay timeout.
Definition at line 1356 of file tcp-socket-base.h.
Referenced by GetDelAckMaxCount(), ProcessSynRcvd(), ProcessSynSent(), ReceivedData(), and SetDelAckMaxCount().
Time to delay an ACK.
Definition at line 1371 of file tcp-socket-base.h.
Referenced by GetDelAckTimeout(), ReceivedData(), and SetDelAckTimeout().
|
protected |
Dupack counter.
Definition at line 1354 of file tcp-socket-base.h.
Referenced by DupAck(), EnterCwr(), EnterRecovery(), ProcessAck(), and ReTxTimeout().
|
protected |
Sequence number of the last received Congestion Experienced.
Definition at line 1466 of file tcp-socket-base.h.
Referenced by ForwardUp(), ForwardUp6(), and GetTypeId().
|
protected |
Sequence number of the last sent CWR.
Definition at line 1468 of file tcp-socket-base.h.
Referenced by GetTypeId(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), and TcpDctcpCongestedRouter::SendDataPacket().
|
protected |
Sequence number of the last received ECN Echo.
Definition at line 1464 of file tcp-socket-base.h.
Referenced by GetTypeId(), ReceivedAck(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), and TcpDctcpCongestedRouter::SendDataPacket().
TracedCallback<TcpSocketState::EcnState_t, TcpSocketState::EcnState_t> ns3::TcpSocketBase::m_ecnStateTrace |
Callback pointer for ECN state trace chaining.
Definition at line 361 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateEcnState().
|
protected |
the IPv4 endpoint
Definition at line 1379 of file tcp-socket-base.h.
Referenced by ~TcpSocketBase(), Bind(), Bind(), BindToNetDevice(), CompleteFork(), Connect(), DeallocateEndPoint(), Destroy(), ForwardUp(), GetPeerName(), GetSockName(), PersistTimeout(), ProcessSynRcvd(), RecvFrom(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), SendPendingData(), SetupCallback(), and SetupEndpoint().
|
protected |
the IPv6 endpoint
Definition at line 1380 of file tcp-socket-base.h.
Referenced by ~TcpSocketBase(), Bind(), Bind6(), BindToNetDevice(), CompleteFork(), Connect(), DeallocateEndPoint(), Destroy6(), ForwardUp6(), GetPeerName(), GetSockName(), PersistTimeout(), ProcessSynRcvd(), RecvFrom(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), SendPendingData(), SetupCallback(), and SetupEndpoint6().
|
mutableprotected |
Socket error code.
Definition at line 1396 of file tcp-socket-base.h.
Referenced by Bind(), Bind(), Bind6(), Connect(), GetErrno(), GetPeerName(), Listen(), Send(), SetupEndpoint(), and SetupEndpoint6().
|
protected |
Highest ack received.
Definition at line 1412 of file tcp-socket-base.h.
Referenced by DoForwardUp(), DupAck(), EnterRecovery(), GetHighRxAck(), GetTypeId(), SendDataPacket(), and UpdateWindowSize().
|
protected |
Highest seqno received.
Definition at line 1411 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateWindowSize().
|
protected |
Highest ack sent.
Definition at line 1408 of file tcp-socket-base.h.
Referenced by ProcessOptionTimestamp(), and SendEmptyPacket().
TracedCallback<SequenceNumber32, SequenceNumber32> ns3::TcpSocketBase::m_highTxMarkTrace |
Callback pointer for high tx mark chaining.
Definition at line 366 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateHighTxMark().
|
protected |
List of sent packet.
Definition at line 1376 of file tcp-socket-base.h.
Referenced by EstimateRtt(), ReTxTimeout(), and UpdateRttHistory().
|
protected |
ICMP callback.
Definition at line 1384 of file tcp-socket-base.h.
Referenced by ForwardIcmp(), and GetTypeId().
|
protected |
ICMPv6 callback.
Definition at line 1386 of file tcp-socket-base.h.
Referenced by ForwardIcmp6(), and GetTypeId().
|
protected |
First partial ACK during RECOVERY.
Definition at line 1440 of file tcp-socket-base.h.
Referenced by ProcessAck().
|
protected |
Last ACK timeout event.
Definition at line 1348 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), CloseAndNotify(), DoPeerClose(), and LastAckTimeout().
TracedCallback<Time, Time> ns3::TcpSocketBase::m_lastRttTrace |
Callback pointer for Last RTT trace chaining.
Definition at line 386 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateLastRtt().
|
protected |
perform limited transmit
Definition at line 1431 of file tcp-socket-base.h.
Referenced by DupAck(), GetTypeId(), and SendPendingData().
|
protected |
Maximum window size to advertise.
Definition at line 1406 of file tcp-socket-base.h.
Referenced by AdvertisedWindowSize(), TcpSocketAdvertisedWindowProxy::AdvertisedWindowSize(), CalculateWScale(), GetTypeId(), and TcpSocketAdvertisedWindowProxy::OldAdvertisedWindowSize().
minimum value of the Retransmit timeout
Definition at line 1369 of file tcp-socket-base.h.
Referenced by EstimateRtt(), GetMinRto(), NewAck(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetMinRto().
|
protected |
Max segment lifetime.
Definition at line 1403 of file tcp-socket-base.h.
Referenced by GetTypeId(), and TimeWait().
TracedCallback<SequenceNumber32, SequenceNumber32> ns3::TcpSocketBase::m_nextTxSequenceTrace |
Callback pointer for next tx sequence chaining.
Definition at line 371 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateNextTxSequence().
the associated node
Definition at line 1381 of file tcp-socket-base.h.
Referenced by ~TcpSocketBase(), AddOptionSack(), AddOptionSackPermitted(), AddOptionTimestamp(), AddOptionWScale(), CalculateWScale(), GetNode(), ProcessOptionSackPermitted(), ProcessOptionTimestamp(), ProcessOptionWScale(), SetNode(), SetupEndpoint(), and SetupEndpoint6().
|
protected |
Set to true to disable Nagle's algorithm.
Definition at line 1359 of file tcp-socket-base.h.
Referenced by GetTcpNoDelay(), SendPendingData(), and SetTcpNoDelay().
TracedCallback<DataRate, DataRate> ns3::TcpSocketBase::m_pacingRateTrace |
Callback pointer for pacing rate trace chaining.
Definition at line 336 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdatePacingRateTrace().
|
protected |
Pacing Event.
Definition at line 1461 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), TcpSocketBase(), CancelAllTimers(), ReTxTimeout(), SendDataPacket(), and SendPendingData().
|
protected |
Persist event: Send 1 byte to probe for a non-zero Rx window.
Definition at line 1350 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), DoForwardUp(), and PersistTimeout().
Time between sending 1-byte probes.
Definition at line 1372 of file tcp-socket-base.h.
Referenced by DoForwardUp(), GetPersistTimeout(), PersistTimeout(), and SetPersistTimeout().
|
protected |
Rate operations.
Definition at line 1437 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), TcpSocketBase(), ProcessOptionSack(), ReceivedAck(), Send(), and SendDataPacket().
|
protected |
Window shift to apply to outgoing segments.
Definition at line 1417 of file tcp-socket-base.h.
Referenced by AddOptionWScale(), AdvertisedWindowSize(), TcpSocketAdvertisedWindowProxy::AdvertisedWindowSize(), and TcpSocketAdvertisedWindowProxy::OldAdvertisedWindowSize().
|
protected |
Previous highest Tx seqnum for fast recovery (set it to initial seq number)
Definition at line 1425 of file tcp-socket-base.h.
Referenced by DupAck(), EnterCwr(), EnterRecovery(), ProcessAck(), ReceivedAck(), and ReTxTimeout().
|
protected |
Whether "m_recover" has been set/activated It is used to avoid comparing with the old m_recover value which was set for handling previous congestion event.
Definition at line 1427 of file tcp-socket-base.h.
Referenced by DupAck(), EnterRecovery(), ProcessAck(), and ReTxTimeout().
|
protected |
Recovery Algorithm.
Definition at line 1436 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), DupAck(), EnterCwr(), EnterRecovery(), GetTypeId(), ProcessAck(), ReceivedAck(), SendDataPacket(), and SetRecoveryAlgorithm().
|
protected |
Trace of retransmitted packets.
Definition at line 1453 of file tcp-socket-base.h.
Referenced by GetTypeId(), and SendDataPacket().
|
protected |
Retransmission event.
Definition at line 1347 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), Destroy(), Destroy6(), DoForwardUp(), NewAck(), ProcessSynRcvd(), ProcessSynSent(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Fast Retransmit threshold.
Definition at line 1430 of file tcp-socket-base.h.
Referenced by DupAck(), GetRetxThresh(), and SetRetxThresh().
|
protected |
Retransmit timeout.
Definition at line 1368 of file tcp-socket-base.h.
Referenced by EstimateRtt(), GetTypeId(), NewAck(), ReTxTimeout(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Round trip time estimator.
Definition at line 1388 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), Connect(), DoPeerClose(), EstimateRtt(), LastAckTimeout(), NewAck(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetRtt().
|
protected |
Receiver window (RCV.WND in RFC793)
Definition at line 1409 of file tcp-socket-base.h.
Referenced by DoForwardUp(), GetRWnd(), GetTypeId(), SendDataPacket(), SendPendingData(), UpdateWindowSize(), and Window().
|
protected |
Trace of received packets.
Definition at line 1458 of file tcp-socket-base.h.
Referenced by DoForwardUp(), and GetTypeId().
|
protected |
RFC SACK option enabled.
Definition at line 1415 of file tcp-socket-base.h.
Referenced by DoForwardUp(), DoRetransmit(), DupAck(), EnterRecovery(), GetTypeId(), IsTcpOptionEnabled(), ProcessAck(), ProcessOptionSackPermitted(), ReTxTimeout(), SendEmptyPacket(), and SendPendingData().
|
protected |
micro-delay event to send pending data
Definition at line 1422 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), and Send().
|
protected |
Receive no longer allowed.
Definition at line 1401 of file tcp-socket-base.h.
Referenced by ProcessWait(), ReceivedData(), and ShutdownRecv().
|
protected |
Send no longer allowed.
Definition at line 1400 of file tcp-socket-base.h.
Referenced by DoPeerClose(), Send(), SendPendingData(), and ShutdownSend().
|
protected |
Window shift to apply to incoming segments.
Definition at line 1418 of file tcp-socket-base.h.
Referenced by ProcessOptionWScale(), and UpdateWindowSize().
TracedCallback<Time, Time> ns3::TcpSocketBase::m_srttTrace |
Callback pointer for RTT trace chaining.
Definition at line 381 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateRtt().
TracedCallback<uint32_t, uint32_t> ns3::TcpSocketBase::m_ssThTrace |
Callback pointer for ssTh trace chaining.
Definition at line 351 of file tcp-socket-base.h.
Referenced by GetTypeId(), and UpdateSsThresh().
|
protected |
TCP state.
Definition at line 1394 of file tcp-socket-base.h.
Referenced by Close(), CloseAndNotify(), CompleteFork(), DoClose(), DoConnect(), DoForwardUp(), DoPeerClose(), GetTypeId(), IsValidTcpSegment(), LastAckTimeout(), Listen(), NewAck(), OutOfRange(), PeerClose(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), Recv(), ReTxTimeout(), Send(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), SendPendingData(), SetInitialCwnd(), SetInitialSSThresh(), SetSegSize(), ShutdownSend(), TimeWait(), and UpdateWindowSize().
|
protected |
Count of remaining connection retries.
Definition at line 1362 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), ProcessSynSent(), ReTxTimeout(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Number of connection attempts.
Definition at line 1363 of file tcp-socket-base.h.
Referenced by CompleteFork(), Connect(), GetSynRetries(), ProcessSynSent(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetSynRetries().
|
protected |
Congestion control information.
Definition at line 1434 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), TcpSocketBase(), AddOptionSack(), AddSocketTags(), AdvertisedWindowSize(), TcpSocketAdvertisedWindowProxy::AdvertisedWindowSize(), BytesInFlight(), CalculateWScale(), Close(), CompleteFork(), DelAckTimeout(), DoConnect(), DoForwardUp(), DoRetransmit(), DupAck(), EnterCwr(), EnterRecovery(), EstimateRtt(), ForwardUp(), ForwardUp6(), GetInitialCwnd(), GetInitialSSThresh(), GetRcvBufSize(), GetRxAvailable(), GetRxBuffer(), GetSegSize(), IsEct(), IsPacingEnabled(), IsValidTcpSegment(), NewAck(), TcpSocketAdvertisedWindowProxy::OldAdvertisedWindowSize(), OutOfRange(), PeerClose(), PersistTimeout(), ProcessAck(), ProcessClosing(), ProcessEstablished(), ProcessLastAck(), ProcessOptionTimestamp(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedAck(), ReceivedData(), Recv(), ReTxTimeout(), ns3::TcpSocketMsgBase::ReTxTimeout(), Send(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), SendPendingData(), SetCongestionControlAlgorithm(), SetInitialCwnd(), SetInitialSSThresh(), SetPaceInitialWindow(), SetPacingStatus(), SetRcvBufSize(), SetSegSize(), SetUseEcn(), UnAckDataCount(), UpdatePacingRate(), and Window().
|
protected |
the associated TCP L4 protocol
Definition at line 1382 of file tcp-socket-base.h.
Referenced by ~TcpSocketBase(), Bind(), Bind(), Bind6(), CompleteFork(), DeallocateEndPoint(), Destroy(), Destroy6(), DoForwardUp(), PersistTimeout(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), and SetTcp().
|
protected |
Timestamp option enabled.
Definition at line 1419 of file tcp-socket-base.h.
Referenced by AddOptions(), CalculateRttSample(), DoForwardUp(), GetTypeId(), and IsTcpOptionEnabled().
|
protected |
Timestamp to echo.
Definition at line 1420 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 1351 of file tcp-socket-base.h.
Referenced by CancelAllTimers(), and TimeWait().
|
protected |
Tx buffer.
Definition at line 1391 of file tcp-socket-base.h.
Referenced by TcpSocketBase(), TcpSocketBase(), BytesInFlight(), Close(), DoForwardUp(), DoRetransmit(), DupAck(), EnterRecovery(), GetSndBufSize(), GetTxAvailable(), GetTxBuffer(), NewAck(), PersistTimeout(), ProcessAck(), ProcessEstablished(), ProcessOptionSack(), ProcessSynRcvd(), ProcessSynSent(), ProcessWait(), ReceivedAck(), ReTxTimeout(), Send(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendPendingData(), SetRetxThresh(), SetSegSize(), SetSndBufSize(), ShutdownSend(), and UnAckDataCount().
|
protected |
Trace of transmitted packets.
Definition at line 1446 of file tcp-socket-base.h.
Referenced by DoForwardUp(), GetTypeId(), PersistTimeout(), SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), SendEmptyPacket(), and ns3::TcpSocketSmallAcks::SendEmptyPacket().
|
protected |
Window Scale option enabled (RFC 7323)
Definition at line 1416 of file tcp-socket-base.h.
Referenced by DoForwardUp(), GetTypeId(), IsTcpOptionEnabled(), and SendEmptyPacket().