19 #define __STDC_LIMIT_MACROS
21 #include "ns3/node-container.h"
22 #include "ns3/tcp-socket-base.h"
23 #include "ns3/simple-net-device-helper.h"
24 #include "ns3/ipv4-address-helper.h"
25 #include "ns3/internet-stack-helper.h"
27 #include "ns3/queue.h"
28 #include "ns3/tcp-l4-protocol.h"
29 #include "ns3/ipv4-end-point.h"
30 #include "ns3/ipv6-end-point.h"
31 #include "ns3/tcp-header.h"
32 #include "ns3/tcp-tx-buffer.h"
33 #include "ns3/tcp-rx-buffer.h"
34 #include "ns3/rtt-estimator.h"
44 m_congControlTypeId (
TcpNewReno::GetTypeId ()),
63 while ((packet = socket->
RecvFrom (from)))
74 uint32_t pktCount,
Time pktInterval )
82 socket,
pktSize, pktCount - 1, pktInterval);
151 senderDev->SetMtu (
m_mtu);
152 senderDev->GetQueue ()->TraceConnect (
"Drop",
"SENDER",
154 senderDev->TraceConnect (
"PhyRxDrop",
"sender",
157 receiverDev->SetMtu (
m_mtu);
158 receiverDev->GetQueue ()->TraceConnect (
"Drop",
"RECEIVER",
160 receiverDev->TraceConnect (
"PhyRxDrop",
"RECEIVER",
163 senderDev->SetReceiveErrorModel (senderEM);
164 receiverDev->SetReceiveErrorModel (receiverEM);
167 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
207 m_senderSocket->TraceConnectWithoutContext (
"CongestionWindowInflated",
227 m_senderSocket->m_rateOps->TraceConnectWithoutContext (
"TcpRateUpdated",
229 m_senderSocket->m_rateOps->TraceConnectWithoutContext (
"TcpRateSampleUpdated",
294 congestionAlgorithmFactory.
SetTypeId (congControl);
295 recoveryAlgorithmFactory.
SetTypeId (recoveryAlgorithm);
303 socket->SetNode (node);
305 socket->SetRtt (rtt);
306 socket->SetCongestionControlAlgorithm (algo);
307 socket->SetRecoveryAlgorithm (recovery);
338 if (context.compare (
"SENDER") == 0)
342 else if (context.compare (
"RECEIVER") == 0)
348 NS_FATAL_ERROR (
"Packet dropped in a queue, but queue not recognized");
355 if (context.compare (
"SENDER") == 0)
359 else if (context.compare (
"RECEIVER") == 0)
365 NS_FATAL_ERROR (
"Packet dropped in a queue, but queue not recognized");
389 bool isRetransmission)
572 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_retxThresh;
589 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_dupAckCount;
606 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_delAckMaxCount;
623 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->GetDelAckTimeout ();
627 return DynamicCast<TcpSocketMsgBase> (
m_receiverSocket)->GetDelAckTimeout ();
640 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->GetSegSize ();
663 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->GetInitialCwnd ();
680 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->GetInitialSSThresh ();
684 return DynamicCast<TcpSocketMsgBase> (
m_receiverSocket)->GetInitialSSThresh ();
697 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_rto.Get ();
731 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_cnTimeout;
765 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_clockGranularity;
769 return DynamicCast<TcpSocketMsgBase> (
m_receiverSocket)->m_clockGranularity;
782 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_state.Get ();
800 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_rWnd.Get ();
818 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_persistEvent;
836 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_persistTimeout;
872 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_tcb->m_rxBuffer;
890 return DynamicCast<TcpSocketMsgBase> (
m_senderSocket)->m_txBuffer;
1044 .SetGroupName (
"Internet")
1053 return CopyObject<TcpSocketMsgBase> (
this);
1119 bool isRetransmission)
1147 .SetGroupName (
"Internet")
1203 NS_LOG_WARN (
"Failed to send empty packet due to null endpoint");
1223 if (hasSyn || hasFin)
1305 NS_LOG_LOGIC (
"Schedule retransmission timeout at time "
1322 return CopyObject<TcpSocketSmallAcks> (
this);
a polymophic address class
bool IsNull(void) const
Check for null implementation.
An identifier for simulation events.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny(void)
uint16_t GetPeerPort(void)
Get the peer port.
Ipv4Address GetPeerAddress(void)
Get the peer address.
uint16_t GetLocalPort(void)
Get the local port.
Ipv4Address GetLocalAddress(void)
Get the local address.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Ipv6Address GetLocalAddress()
Get the local address.
uint16_t GetLocalPort()
Get the local port.
Ipv6Address GetPeerAddress()
Get the peer address.
uint16_t GetPeerPort()
Get the peer port.
holds a vector of ns3::NetDevice pointers
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
static void EnablePrinting(void)
Enable printing packets metadata.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Base class for all RTT Estimators.
static TypeId GetTypeId(void)
Get the type ID.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
build a set of SimpleNetDevice objects
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run(void)
Run the simulation.
static Time Now(void)
Return the current simulation virtual time.
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
bool IsManualIpv6HopLimit(void) const
Checks if the socket has a specific IPv6 Hop Limit set.
uint8_t GetIpv6Tclass(void) const
Query the value of IPv6 Traffic Class field of this socket.
bool IsManualIpTtl(void) const
Checks if the socket has a specific IPv4 TTL set.
Ptr< NetDevice > m_boundnetdevice
the device this socket is bound to (might be null).
virtual uint8_t GetIpTtl(void) const
Query the value of IP Time to Live field of this socket.
virtual uint8_t GetIpv6HopLimit(void) const
Query the value of IP Hop Limit field of this socket.
virtual Ptr< Node > GetNode(void) const =0
Return the node this socket is associated with.
virtual int Close(void)=0
Close a socket.
void SetCloseCallbacks(Callback< void, Ptr< Socket > > normalClose, Callback< void, Ptr< Socket > > errorClose)
Detect socket recv() events such as graceful shutdown or error.
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
bool IsManualIpv6Tclass(void) const
Checks if the socket has a specific IPv6 Tclass set.
uint8_t GetIpTos(void) const
Query the value of IP Type of Service of this socket.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)=0
Read a single packet from the socket and retrieve the sender address.
indicates whether the socket has IP_TOS set.
void SetTos(uint8_t tos)
Set the tag's TOS.
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer.
void SetTtl(uint8_t ttl)
Set the tag's TTL.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer.
void SetHopLimit(uint8_t hopLimit)
Set the tag's Hop Limit.
indicates whether the socket has IPV6_TCLASS set.
void SetTclass(uint8_t tclass)
Set the tag's Tclass.
The Classic recovery implementation.
Congestion control abstract class.
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
void ErrorCloseCb(Ptr< Socket > socket)
Error Close Callback.
virtual void ErrorClose([[maybe_unused]] SocketWho who)
Socket closed with an error.
virtual void RcvAck([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who)
Received ack.
virtual void QueueDrop([[maybe_unused]] SocketWho who)
Drop on the queue.
virtual void CWndTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Tracks the congestion window changes.
TypeId m_recoveryTypeId
Recovery.
uint32_t GetDelAckCount(SocketWho who)
Get the number of delayed ack (if present)
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
virtual void ProcessedAck([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who)
Processed ack.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
virtual void RateSampleUpdatedTrace([[maybe_unused]] const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void BeforeRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked before a retransmit event.
Ptr< TcpTxBuffer > GetTxBuffer(SocketWho who)
Get the Tx buffer from selected socket.
virtual void HighestTxSeqTrace([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue)
Highest tx seq changes.
virtual void UpdatedRttHistory([[maybe_unused]] const SequenceNumber32 &seq, [[maybe_unused]] uint32_t sz, [[maybe_unused]] bool isRetransmission, [[maybe_unused]] SocketWho who)
Updated the Rtt history.
void TxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Tx packet Callback.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
void SetCongestionControl(TypeId congControl)
Congestion control of the sender socket.
uint32_t m_mtu
MTU of the environment.
virtual void RttTrace([[maybe_unused]] Time oldTime, [[maybe_unused]] Time newTime)
Rtt changes.
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
Ptr< TcpSocketState > GetTcb(SocketWho who)
Get the TCB from selected socket.
void SetRcvBufSize(SocketWho who, uint32_t size)
Forcefully set a defined size for rx buffer.
virtual void ConfigureProperties(void)
Change the configuration of the socket properties.
Time m_interPacketInterval
Time between sending application packet down to tcp socket.
uint32_t m_pktSize
Size of the application packet.
EventId GetPersistentEvent(SocketWho who)
Get the persistent event of the selected socket.
uint32_t m_pktCount
Count of the application packet.
void HandleAccept(Ptr< Socket > socket, const Address &from)
Handle an accept connection.
void QueueDropCb(std::string context, Ptr< const Packet > p)
Queue Drop Callback.
void ForkCb(Ptr< TcpSocketMsgBase > tcp)
Fork Callback.
uint32_t GetReTxThreshold(SocketWho who)
Get the retransmission threshold.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
void RxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Rx packet Callback.
virtual void BytesInFlightTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Bytes in flight changes.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
void SetPaceInitialWindow(SocketWho who, bool paceWindow)
Enable or disable pacing of the initial window.
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
virtual void NextTxSeqTrace([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue)
Next tx seq changes.
virtual void DoRun(void)
Execute the tcp test.
virtual Ptr< SimpleChannel > CreateChannel()
Create and return the channel installed between the two socket.
virtual void DataSent([[maybe_unused]] uint32_t size, [[maybe_unused]] SocketWho who)
Notifying application for sent data.
Time GetDelAckTimeout(SocketWho who)
Get the timeout of delayed ack (if present)
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
Time GetClockGranularity(SocketWho who)
Get the clock granularity attribute.
void SetUseEcn(SocketWho who, TcpSocketState::UseEcn_t useEcn)
Forcefully set the ECN mode of use.
Time m_startTime
Data transmission time.
Ptr< TcpSocketMsgBase > m_senderSocket
Pointer to sender socket.
void DoConnect()
Scheduled at 0.0, SENDER starts the connection to RECEIVER.
Time GetRto(SocketWho who)
Get the retransmission time.
Ptr< TcpRxBuffer > GetRxBuffer(SocketWho who)
Get the Rx buffer from selected socket.
Time GetConnTimeout(SocketWho who)
Get the retransmission time for the SYN segments.
void AfterRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked after a retransmit event.
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
uint32_t GetRWnd(SocketWho who)
Get the rWnd of the selected socket.
void PhyDropCb(std::string context, Ptr< const Packet > p)
Drop at Phy layer Callback.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
TypeId m_congControlTypeId
Congestion control.
virtual void ReceivePacket(Ptr< Socket > socket)
Packet received.
void DataSentCb(Ptr< Socket > socket, uint32_t size)
Data sent Callback.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
virtual void PhyDrop([[maybe_unused]] SocketWho who)
Link drop.
void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Send packets to other endpoint.
virtual void NormalClose([[maybe_unused]] SocketWho who)
Socket closed normally.
virtual void SsThreshTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Slow start threshold changes.
void NormalCloseCb(Ptr< Socket > socket)
Normal Close Callback.
virtual void ConfigureEnvironment(void)
Change the configuration of the environment.
Time m_propagationDelay
Propagation delay of the channel.
void RcvAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
Receive ACK Callback.
TcpSocket::TcpStates_t GetTcpState(SocketWho who)
Get the state of the TCP state machine.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
SequenceNumber32 GetHighestTxMark(SocketWho who)
Get the highest tx mark of the node specified.
virtual void CongStateTrace([[maybe_unused]] const TcpSocketState::TcpCongState_t oldValue, [[maybe_unused]] const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Time GetPersistentTimeout(SocketWho who)
Get the persistent timeout of the selected socket.
void SetRecoveryAlgorithm(TypeId recovery)
recovery algorithm of the sender socket
virtual void BeforeRTOExpired([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who)
Rto has expired.
virtual void DoTeardown(void)
Teardown the TCP test.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
virtual void RateUpdatedTrace([[maybe_unused]] const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
void SetPacingStatus(SocketWho who, bool pacing)
Enable or disable pacing in the TCP socket.
Ptr< TcpSocketMsgBase > m_receiverSocket
Pointer to receiver socket.
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
uint32_t GetInitialCwnd(SocketWho who)
Get the initial congestion window.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
void UpdateRttHistoryCb(Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update RTT with new data.
virtual void RtoTrace([[maybe_unused]] Time oldValue, [[maybe_unused]] Time newValue)
RTO changes.
void ProcessedAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
ACK processed Callback.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
virtual void CWndInflTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Tracks the inflated congestion window changes.
InetSocketAddress m_remoteAddr
Remote peer address.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
virtual void AfterRTOExpired([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who)
Rto has expired.
TCP socket creation and multiplexing/demultiplexing.
The NewReno implementation.
A base class for implementation of a stream socket using TCP.
void CloseAndNotify(void)
Peacefully close the socket by notifying the upper layer and deallocate end point.
Time m_minRto
minimum value of the Retransmit timeout
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > m_txTrace
Trace of transmitted packets.
Ptr< TcpL4Protocol > m_tcp
the associated TCP L4 protocol
Ptr< TcpSocketState > m_tcb
Congestion control information.
TracedValue< Time > m_rto
Retransmit timeout.
EventId m_delAckEvent
Delayed ACK timeout event.
void AddOptions(TcpHeader &tcpHeader)
Add options to TcpHeader.
TracedValue< TcpStates_t > m_state
TCP state.
Ptr< RttEstimator > m_rtt
Round trip time estimator.
virtual void ReTxTimeout(void)
An RTO event happened.
EventId m_retxEvent
Retransmission event.
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received an ACK packet.
uint32_t m_delAckCount
Delayed ACK counter.
Ipv4EndPoint * m_endPoint
the IPv4 endpoint
Time m_cnTimeout
Timeout for connection retry.
Time m_clockGranularity
Clock Granularity used in RTO calcs.
virtual uint16_t AdvertisedWindowSize(bool scale=true) const
The amount of Rx window announced to the peer.
Ipv6EndPoint * m_endPoint6
the IPv6 endpoint
virtual void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Complete a connection by forking the socket.
uint32_t m_synRetries
Number of connection attempts.
uint32_t m_synCount
Count of remaining connection retries.
virtual void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update the RTT history, when we send TCP segments.
Class for inserting callbacks special points of the flow of TCP sockets.
UpdateRttCallback m_updateRttCb
Update RTT callback.
virtual void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update the RTT history, when we send TCP segments.
AckManagementCb m_processedAckCb
Processed ACK callback.
virtual void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Complete a connection by forking the socket.
void SetAfterRetransmitCb(RetrCb cb)
Set the callback invoked after the processing of a retransmit timeout.
void SetForkCb(Callback< void, Ptr< TcpSocketMsgBase > > cb)
Set the callback invoked after the forking.
void SetRcvAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received (at the beginning of the processing)
AckManagementCb m_rcvAckCb
Receive ACK callback.
virtual Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
void SetProcessedAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received and processed (at the end of the processing)
void SetBeforeRetransmitCb(RetrCb cb)
Set the callback invoked before the processing of a retransmit timeout.
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received an ACK packet.
RetrCb m_beforeRetrCallback
Before retransmission callback.
Callback< void, Ptr< TcpSocketMsgBase > > m_forkCb
Fork callback.
RetrCb m_afterRetrCallback
After retransmission callback.
static TypeId GetTypeId(void)
Get the type ID.
virtual void ReTxTimeout(void)
An RTO event happened.
void SetUpdateRttHistoryCb(UpdateRttCallback cb)
Set the callback invoked when we update rtt history.
A TCP socket which sends ACKs smaller than the segment received.
static TypeId GetTypeId(void)
Get the type ID.
SequenceNumber32 m_lastAckedSeq
Last sequence number ACKed.
uint32_t m_bytesToAck
Number of bytes to be ACKed.
Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
virtual void SendEmptyPacket(uint8_t flags)
Send a empty packet that carries a flag, e.g., ACK.
uint32_t m_bytesLeftToBeAcked
Number of bytes to be ACKed left.
TracedValue< SequenceNumber32 > m_highTxMark
Highest seqno ever sent, regardless of ReTx.
UseEcn_t
Parameter value related to ECN enable/disable functionality similar to sysctl for tcp_ecn.
Ptr< TcpRxBuffer > m_rxBuffer
Rx buffer (reordering buffer)
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
T Get(void) const
Get the underlying value.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Callback< R, Ts... > MakeNullCallback(void)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
TcpStates_t
Names of the 11 TCP states.
@ FIN_WAIT_1
Our side has shutdown, waiting to complete transmission of remaining buffered data
@ LAST_ACK
Our side has shutdown after remote has shutdown.
@ CLOSING
Both sides have shutdown but we still have data we have to finish sending
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
uint32_t pktSize
packet size used for the simulation (in bytes)