An implementation of a stream socket using TCP. More...
#include <tcp-reno.h>
Inheritance diagram for ns3::TcpReno:
Collaboration diagram for ns3::TcpReno:Public Member Functions | |
| TcpReno (void) | |
| TcpReno (const TcpReno &sock) | |
| virtual | ~TcpReno (void) |
| virtual int | Connect (const Address &address) |
| virtual int | Listen (void) |
Public Member Functions inherited from ns3::TcpSocketBase | |
| TcpSocketBase (void) | |
| TcpSocketBase (const TcpSocketBase &sock) | |
| virtual | ~TcpSocketBase (void) |
| virtual int | Bind (void) |
| virtual int | Bind (const Address &address) |
| virtual int | Bind6 (void) |
| Allocate a local IPv6 endpoint for this socket. | |
| virtual void | BindToNetDevice (Ptr< NetDevice > netdevice) |
| virtual int | Close (void) |
| virtual enum SocketErrno | GetErrno (void) const |
| virtual Ptr< Node > | GetNode (void) const |
| virtual uint32_t | GetRxAvailable (void) const |
| virtual enum SocketType | GetSocketType (void) const |
| virtual int | GetSockName (Address &address) const |
| virtual uint32_t | GetTxAvailable (void) const |
| virtual Ptr< Packet > | Recv (uint32_t maxSize, uint32_t flags) |
| virtual Ptr< Packet > | RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress) |
| virtual int | Send (Ptr< Packet > p, uint32_t flags) |
| virtual int | SendTo (Ptr< Packet > p, uint32_t flags, const Address &toAddress) |
| virtual void | SetNode (Ptr< Node > node) |
| virtual void | SetRtt (Ptr< RttEstimator > rtt) |
| virtual void | SetTcp (Ptr< TcpL4Protocol > tcp) |
| virtual int | ShutdownRecv (void) |
| virtual int | ShutdownSend (void) |
Public Member Functions inherited from ns3::TcpSocket | |
| TcpSocket (void) | |
| virtual | ~TcpSocket (void) |
Public Member Functions inherited from ns3::Socket | |
| Socket (void) | |
| virtual | ~Socket (void) |
| Ptr< NetDevice > | GetBoundNetDevice () |
| Returns socket's bound netdevice, if any. | |
| bool | IsRecvPktInfo () const |
| Get status indicating whether enable/disable packet information to socket. | |
| Ptr< Packet > | Recv (void) |
| Read a single packet from the socket. | |
| int | Recv (uint8_t *buf, uint32_t size, uint32_t flags) |
| Recv data (or dummy data) from the remote host. | |
| Ptr< 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 (Ptr< Packet > p) |
| Send data (or dummy data) to the remote host. | |
| int | Send (const uint8_t *buf, uint32_t size, uint32_t flags) |
| Send data (or dummy data) to the remote host. | |
| int | SendTo (const uint8_t *buf, uint32_t size, uint32_t flags, const Address &address) |
| Send data to a specified peer. | |
| void | SetAcceptCallback (Callback< bool, Ptr< Socket >, const Address & > connectionRequest, Callback< void, Ptr< Socket >, const Address & > newConnectionCreated) |
| Accept connection requests from remote hosts. | |
| void | SetCloseCallbacks (Callback< void, Ptr< Socket > > normalClose, Callback< void, Ptr< Socket > > errorClose) |
| Detect socket recv() events such as graceful shutdown or error. | |
| void | SetConnectCallback (Callback< void, Ptr< Socket > > connectionSucceeded, Callback< void, Ptr< Socket > > connectionFailed) |
| Specify callbacks to allow the caller to determine if the connection succeeds of fails. | |
| void | SetDataSentCallback (Callback< void, Ptr< Socket >, uint32_t > dataSent) |
| Notify application when a packet has been sent from transport protocol (non-standard socket call) | |
| void | SetRecvCallback (Callback< void, Ptr< Socket > >) |
| Notify application when new data is available to be read. | |
| void | SetRecvPktInfo (bool flag) |
| Enable/Disable receive packet information to socket. | |
| void | SetSendCallback (Callback< void, Ptr< Socket >, uint32_t > sendCb) |
| Notify application when space in transmit buffer is added. | |
Public Member Functions inherited from ns3::Object | |
| Object () | |
| virtual | ~Object () |
| void | AggregateObject (Ptr< Object > other) |
| void | Dispose (void) |
| AggregateIterator | GetAggregateIterator (void) const |
| virtual TypeId | GetInstanceTypeId (void) const |
| template<typename T > | |
| Ptr< T > | GetObject (void) const |
| template<typename T > | |
| Ptr< T > | GetObject (TypeId tid) const |
| void | Start (void) |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| SimpleRefCount (const SimpleRefCount &o) | |
| uint32_t | GetReferenceCount (void) const |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| void | Ref (void) const |
| void | Unref (void) const |
Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| void | GetAttribute (std::string name, AttributeValue &value) const |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
| This method returns the TypeId associated to ns3::TcpReno. | |
Protected Member Functions | |
| virtual void | DupAck (const TcpHeader &t, uint32_t count) |
| virtual Ptr< TcpSocketBase > | Fork (void) |
| virtual uint32_t | GetInitialCwnd (void) const |
| virtual uint32_t | GetSSThresh (void) const |
| virtual void | NewAck (const SequenceNumber32 &seq) |
| virtual void | Retransmit (void) |
| virtual void | SetInitialCwnd (uint32_t cwnd) |
| virtual void | SetSegSize (uint32_t size) |
| virtual void | SetSSThresh (uint32_t threshold) |
| virtual uint32_t | Window (void) |
Protected Member Functions inherited from ns3::TcpSocketBase | |
| virtual void | AddOptions (TcpHeader &) |
| virtual uint16_t | AdvertisedWindowSize (void) |
| virtual uint32_t | AvailableWindow (void) |
| virtual uint32_t | BytesInFlight (void) |
| void | CancelAllTimers (void) |
| void | CloseAndNotify (void) |
| void | CompleteFork (Ptr< Packet >, const TcpHeader &, const Address &fromAddress, const Address &toAdress) |
| void | ConnectionSucceeded (void) |
| void | DeallocateEndPoint (void) |
| virtual void | DelAckTimeout (void) |
| void | Destroy (void) |
| void | Destroy6 (void) |
| int | DoClose (void) |
| int | DoConnect (void) |
| virtual void | DoForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface) |
| virtual void | DoForwardUp (Ptr< Packet > packet, Ipv6Address saddr, Ipv6Address daddr, uint16_t port) |
| void | DoPeerClose (void) |
| virtual void | DoRetransmit (void) |
| virtual void | EstimateRtt (const TcpHeader &) |
| void | ForwardUp (Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface) |
| void | ForwardUp6 (Ptr< Packet > packet, Ipv6Address saddr, Ipv6Address daddr, uint16_t port) |
| virtual bool | GetAllowBroadcast (void) const |
| Query whether broadcast datagram transmissions are allowed. | |
| virtual uint32_t | GetConnCount (void) const |
| virtual Time | GetConnTimeout (void) const |
| virtual uint32_t | GetDelAckMaxCount (void) const |
| virtual Time | GetDelAckTimeout (void) const |
| virtual Time | GetPersistTimeout (void) const |
| virtual uint32_t | GetRcvBufSize (void) const |
| virtual uint32_t | GetSegSize (void) const |
| virtual uint32_t | GetSndBufSize (void) const |
| virtual bool | GetTcpNoDelay (void) const |
| virtual void | LastAckTimeout (void) |
| bool | OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const |
| void | PeerClose (Ptr< Packet >, const TcpHeader &) |
| virtual void | PersistTimeout (void) |
| void | ProcessClosing (Ptr< Packet >, const TcpHeader &) |
| void | ProcessEstablished (Ptr< Packet >, const TcpHeader &) |
| void | ProcessLastAck (Ptr< Packet >, const TcpHeader &) |
| void | ProcessListen (Ptr< Packet >, const TcpHeader &, const Address &, const Address &) |
| void | ProcessSynRcvd (Ptr< Packet >, const TcpHeader &, const Address &, const Address &) |
| void | ProcessSynSent (Ptr< Packet >, const TcpHeader &) |
| void | ProcessWait (Ptr< Packet >, const TcpHeader &) |
| virtual void | ReadOptions (const TcpHeader &) |
| virtual void | ReceivedAck (Ptr< Packet >, const TcpHeader &) |
| virtual void | ReceivedData (Ptr< Packet >, const TcpHeader &) |
| virtual void | ReTxTimeout (void) |
| uint32_t | SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck) |
| void | SendEmptyPacket (uint8_t flags) |
| bool | SendPendingData (bool withAck=false) |
| void | SendRST (void) |
| virtual bool | SetAllowBroadcast (bool allowBroadcast) |
| Configure whether broadcast datagram transmissions are allowed. | |
| virtual void | SetConnCount (uint32_t count) |
| virtual void | SetConnTimeout (Time timeout) |
| virtual void | SetDelAckMaxCount (uint32_t count) |
| virtual void | SetDelAckTimeout (Time timeout) |
| virtual void | SetPersistTimeout (Time timeout) |
| virtual void | SetRcvBufSize (uint32_t size) |
| virtual void | SetSndBufSize (uint32_t size) |
| virtual void | SetTcpNoDelay (bool noDelay) |
| int | SetupCallback (void) |
| int | SetupEndpoint (void) |
| int | SetupEndpoint6 (void) |
| void | TimeWait (void) |
| virtual uint32_t | UnAckDataCount (void) |
Private Member Functions | |
| void | InitializeCwnd (void) |
Additional Inherited Members | |
Public Types inherited from ns3::Socket | |
| enum | SocketErrno { ERROR_NOTERROR, ERROR_ISCONN, ERROR_NOTCONN, ERROR_MSGSIZE, ERROR_AGAIN, ERROR_SHUTDOWN, ERROR_OPNOTSUPP, ERROR_AFNOSUPPORT, ERROR_INVAL, ERROR_BADF, ERROR_NOROUTETOHOST, ERROR_NODEV, ERROR_ADDRNOTAVAIL, ERROR_ADDRINUSE, SOCKET_ERRNO_LAST } |
| enum | SocketType { NS3_SOCK_STREAM, NS3_SOCK_SEQPACKET, NS3_SOCK_DGRAM, NS3_SOCK_RAW } |
Static Public Attributes inherited from ns3::TcpSocket | |
| static const char *const | TcpStateName [LAST_STATE] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "LAST_ACK", "FIN_WAIT_1", "FIN_WAIT_2", "CLOSING", "TIME_WAIT" } |
An implementation of a stream socket using TCP.
This class contains the Reno implementation of TCP, according to RFC2581, except sec.4.1 "re-starting idle connections", which we do not detect for idleness and thus no slow start upon resumption.
Definition at line 38 of file tcp-reno.h.
| ns3::TcpReno::TcpReno | ( | void | ) |
Create an unbound tcp socket.
Definition at line 54 of file tcp-reno.cc.
References NS_LOG_FUNCTION.
| ns3::TcpReno::TcpReno | ( | const TcpReno & | sock | ) |
Definition at line 59 of file tcp-reno.cc.
References NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
virtual |
Definition at line 71 of file tcp-reno.cc.
|
virtual |
We initialize m_cWnd from this function, after attributes initialized
Reimplemented from ns3::TcpSocketBase.
Definition at line 86 of file tcp-reno.cc.
References InitializeCwnd(), and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
protectedvirtual |
Implements ns3::TcpSocketBase.
Definition at line 146 of file tcp-reno.cc.
References ns3::TcpSocketBase::BytesInFlight(), ns3::TcpSocketBase::DoRetransmit(), ns3::TcpSocketBase::m_connected, m_cWnd, m_inFastRec, m_retxThresh, ns3::TcpSocketBase::m_segmentSize, m_ssThresh, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::TcpSocketBase::SendPendingData().
Here is the call graph for this function:
|
protectedvirtual |
Implements ns3::TcpSocketBase.
Definition at line 102 of file tcp-reno.cc.
|
protectedvirtual |
Implements ns3::TcpSocketBase.
Definition at line 216 of file tcp-reno.cc.
References m_initialCWnd.
|
protectedvirtual |
|
static |
This method returns the TypeId associated to ns3::TcpReno.
Attributes defined for this type:
Attributes defined in parent class ns3::TcpSocketBase:
Attributes defined in parent class ns3::TcpSocket:
TraceSources defined for this type:
TraceSources defined in parent class ns3::TcpSocketBase:
Reimplemented from ns3::TcpSocketBase.
Definition at line 38 of file tcp-reno.cc.
References m_cWnd, m_retxThresh, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
Here is the call graph for this function:
|
private |
Definition at line 222 of file tcp-reno.cc.
References m_cWnd, m_initialCWnd, and ns3::TcpSocketBase::m_segmentSize.
Referenced by Connect(), and Listen().
Here is the caller graph for this function:
|
virtual |
We initialize m_cWnd from this function, after attributes initialized
Reimplemented from ns3::TcpSocketBase.
Definition at line 77 of file tcp-reno.cc.
References InitializeCwnd(), and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
protectedvirtual |
New ACK (up to seqnum seq) received. Increase cwnd and call TcpSocketBase::NewAck()
Reimplemented from ns3::TcpSocketBase.
Definition at line 109 of file tcp-reno.cc.
References ns3::TracedValue< T >::Get(), m_cWnd, m_inFastRec, ns3::TcpSocketBase::m_segmentSize, m_ssThresh, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
Here is the call graph for this function:
|
protectedvirtual |
Reimplemented from ns3::TcpSocketBase.
Definition at line 166 of file tcp-reno.cc.
References ns3::TcpSocketBase::BytesInFlight(), ns3::CLOSED, ns3::TcpSocketBase::DoRetransmit(), ns3::ESTABLISHED, ns3::TcpTxBuffer::HeadSequence(), ns3::RttEstimator::IncreaseMultiplier(), m_cWnd, ns3::TcpSocketBase::m_highTxMark, m_inFastRec, ns3::TcpSocketBase::m_nextTxSequence, ns3::TcpSocketBase::m_rtt, ns3::TcpSocketBase::m_segmentSize, m_ssThresh, ns3::TcpSocketBase::m_state, ns3::TcpSocketBase::m_txBuffer, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and ns3::TIME_WAIT.
Here is the call graph for this function:
|
protectedvirtual |
Implements ns3::TcpSocketBase.
Definition at line 209 of file tcp-reno.cc.
References ns3::CLOSED, m_initialCWnd, ns3::TcpSocketBase::m_state, and NS_ABORT_MSG_UNLESS.
|
protectedvirtual |
Reimplemented from ns3::TcpSocketBase.
Definition at line 190 of file tcp-reno.cc.
References ns3::CLOSED, ns3::TcpSocketBase::m_segmentSize, ns3::TcpSocketBase::m_state, and NS_ABORT_MSG_UNLESS.
|
protectedvirtual |
|
protectedvirtual |
Limit the size of in-flight data by cwnd and receiver's rxwin
Reimplemented from ns3::TcpSocketBase.
Definition at line 95 of file tcp-reno.cc.
References ns3::TracedValue< T >::Get(), m_cWnd, ns3::TcpSocketBase::m_rWnd, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
protected |
Definition at line 70 of file tcp-reno.h.
Referenced by DupAck(), GetTypeId(), InitializeCwnd(), NewAck(), Retransmit(), and Window().
|
protected |
Definition at line 74 of file tcp-reno.h.
Referenced by DupAck(), NewAck(), and Retransmit().
|
protected |
Definition at line 72 of file tcp-reno.h.
Referenced by GetInitialCwnd(), InitializeCwnd(), and SetInitialCwnd().
|
protected |
Definition at line 73 of file tcp-reno.h.
Referenced by DupAck(), and GetTypeId().
|
protected |
Definition at line 71 of file tcp-reno.h.
Referenced by DupAck(), GetSSThresh(), NewAck(), Retransmit(), and SetSSThresh().