18 #define __STDC_LIMIT_MACROS
21 #include "ns3/internet-stack-helper.h"
22 #include "ns3/ipv4-address-helper.h"
23 #include "ns3/ipv4-end-point.h"
24 #include "ns3/ipv6-end-point.h"
26 #include "ns3/node-container.h"
27 #include "ns3/queue.h"
28 #include "ns3/rtt-estimator.h"
29 #include "ns3/simple-net-device-helper.h"
30 #include "ns3/tcp-header.h"
31 #include "ns3/tcp-l4-protocol.h"
32 #include "ns3/tcp-rx-buffer.h"
33 #include "ns3/tcp-socket-base.h"
34 #include "ns3/tcp-tx-buffer.h"
62 while ((packet = socket->
RecvFrom(from)))
156 senderDev->SetMtu(
m_mtu);
157 senderDev->GetQueue()->TraceConnect(
"Drop",
162 receiverDev->SetMtu(
m_mtu);
163 receiverDev->GetQueue()->TraceConnect(
"Drop",
166 receiverDev->TraceConnect(
"PhyRxDrop",
170 senderDev->SetReceiveErrorModel(senderEM);
171 receiverDev->SetReceiveErrorModel(receiverEM);
174 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
215 m_senderSocket->TraceConnectWithoutContext(
"CongestionWindowInflated",
241 "TcpRateSampleUpdated",
308 congestionAlgorithmFactory.
SetTypeId(congControl);
309 recoveryAlgorithmFactory.
SetTypeId(recoveryAlgorithm);
317 socket->SetNode(node);
320 socket->SetCongestionControlAlgorithm(algo);
321 socket->SetRecoveryAlgorithm(recovery);
352 if (context ==
"SENDER")
356 else if (context ==
"RECEIVER")
362 NS_FATAL_ERROR(
"Packet dropped in a queue, but queue not recognized");
369 if (context ==
"SENDER")
373 else if (context ==
"RECEIVER")
379 NS_FATAL_ERROR(
"Packet dropped in a queue, but queue not recognized");
404 bool isRetransmission)
591 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_retxThresh;
608 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_dupAckCount;
625 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_delAckMaxCount;
642 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->GetDelAckTimeout();
659 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->GetSegSize();
682 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->GetInitialCwnd();
699 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->GetInitialSSThresh();
703 return DynamicCast<TcpSocketMsgBase>(
m_receiverSocket)->GetInitialSSThresh();
716 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_rto.Get();
750 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_cnTimeout;
784 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_clockGranularity;
801 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_state.Get();
818 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_rWnd.Get();
835 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_persistEvent;
852 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_persistTimeout;
886 return DynamicCast<TcpSocketMsgBase>(
m_senderSocket)->m_tcb->m_rxBuffer;
1058 .SetGroupName(
"Internet")
1066 return CopyObject<TcpSocketMsgBase>(
this);
1161 .SetGroupName(
"Internet")
1216 NS_LOG_WARN(
"Failed to send empty packet due to null endpoint");
1236 if (hasSyn || hasFin)
1302 m_tcp->SendPacket(p,
1310 m_tcp->SendPacket(p,
1326 NS_LOG_LOGIC(
"Schedule retransmission timeout at time "
1336 NS_LOG_DEBUG(
"Recursing to call SendEmptyPacket() again with m_bytesLeftToBeAcked = "
1345 return CopyObject<TcpSocketSmallAcks>(
this);
a polymophic address class
bool IsNull() const
Check for null implementation.
An identifier for simulation events.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsExpired() const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
Ipv4Address GetLocalAddress() const
Get the local address.
uint16_t GetPeerPort() const
Get the peer port.
uint16_t GetLocalPort() const
Get the local port.
Ipv4Address GetPeerAddress() const
Get the peer address.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
uint16_t GetLocalPort() const
Get the local port.
Ipv6Address GetPeerAddress() const
Get the peer address.
Ipv6Address GetLocalAddress() const
Get the local address.
uint16_t GetPeerPort() const
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.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() 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() const
Get a pointer to the requested aggregated Object.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddPacketTag(const Tag &tag) const
Add a packet tag.
static void EnablePrinting()
Enable printing packets metadata.
Base class for all RTT Estimators.
static TypeId GetTypeId()
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 EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
bool IsManualIpTtl() const
Checks if the socket has a specific IPv4 TTL set.
virtual uint8_t GetIpTtl() const
Query the value of IP Time to Live field of this socket.
void SetCloseCallbacks(Callback< void, Ptr< Socket >> normalClose, Callback< void, Ptr< Socket >> errorClose)
Detect socket recv() events such as graceful shutdown or error.
uint8_t GetIpTos() const
Query the value of IP Type of Service of this socket.
void SetRecvCallback(Callback< void, Ptr< Socket >> receivedData)
Notify application when new data is available to be read.
Ptr< NetDevice > m_boundnetdevice
the device this socket is bound to (might be null).
virtual Ptr< Node > GetNode() const =0
Return the node this socket is associated with.
virtual uint8_t GetIpv6HopLimit() const
Query the value of IP Hop Limit field of this socket.
virtual int Close()=0
Close a 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.
uint8_t GetIpv6Tclass() const
Query the value of IPv6 Traffic Class field of this socket.
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.
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.
virtual void PhyDrop(SocketWho who[[maybe_unused]])
Link drop.
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 BeforeRTOExpired(const Ptr< const TcpSocketState > tcb[[maybe_unused]], SocketWho who[[maybe_unused]])
Rto has expired.
TypeId m_recoveryTypeId
Recovery.
virtual void RttTrace(Time oldTime[[maybe_unused]], Time newTime[[maybe_unused]])
Rtt changes.
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 ErrorClose(SocketWho who[[maybe_unused]])
Socket closed with an error.
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.
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.
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.
virtual void NormalClose(SocketWho who[[maybe_unused]])
Socket closed normally.
uint32_t m_mtu
MTU of the environment.
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate[[maybe_unused]])
Track the rate value of TcpRateLinux.
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.
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 Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb[[maybe_unused]], SocketWho who[[maybe_unused]])
Rto has expired.
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
virtual void SsThreshTrace(uint32_t oldValue[[maybe_unused]], uint32_t newValue[[maybe_unused]])
Slow start threshold changes.
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.
~TcpGeneralTest() override
virtual void ConfigureProperties()
Change the configuration of the socket properties.
virtual Ptr< SimpleChannel > CreateChannel()
Create and return the channel installed between the two socket.
void DoRun() override
Execute the tcp test.
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.
virtual void BytesInFlightTrace(uint32_t oldValue[[maybe_unused]], uint32_t newValue[[maybe_unused]])
Bytes in flight changes.
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 UpdatedRttHistory(const SequenceNumber32 &seq[[maybe_unused]], uint32_t sz[[maybe_unused]], bool isRetransmission[[maybe_unused]], SocketWho who[[maybe_unused]])
Updated the Rtt history.
virtual void RtoTrace(Time oldValue[[maybe_unused]], Time newValue[[maybe_unused]])
RTO changes.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Send packets to other endpoint.
void NormalCloseCb(Ptr< Socket > socket)
Normal Close Callback.
virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample[[maybe_unused]])
Track the rate sample value of TcpRateLinux.
Time m_propagationDelay
Propagation delay of the channel.
void RcvAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
Receive ACK Callback.
virtual void RcvAck(const Ptr< const TcpSocketState > tcb[[maybe_unused]], const TcpHeader &h[[maybe_unused]], SocketWho who[[maybe_unused]])
Received ack.
TcpSocket::TcpStates_t GetTcpState(SocketWho who)
Get the state of the TCP state machine.
virtual void NextTxSeqTrace(SequenceNumber32 oldValue[[maybe_unused]], SequenceNumber32 newValue[[maybe_unused]])
Next tx seq changes.
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 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 DataSent(uint32_t size[[maybe_unused]], SocketWho who[[maybe_unused]])
Notifying application for sent data.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
void SetPacingStatus(SocketWho who, bool pacing)
Enable or disable pacing in the TCP socket.
Ptr< TcpSocketMsgBase > m_receiverSocket
Pointer to receiver socket.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
virtual void CWndInflTrace(uint32_t oldValue[[maybe_unused]], uint32_t newValue[[maybe_unused]])
Tracks the inflated congestion window changes.
uint32_t GetInitialCwnd(SocketWho who)
Get the initial congestion window.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb[[maybe_unused]], const TcpHeader &h[[maybe_unused]], SocketWho who[[maybe_unused]])
Processed ack.
virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue[[maybe_unused]], const TcpSocketState::TcpCongState_t newValue[[maybe_unused]])
State on Ack state machine changes.
void UpdateRttHistoryCb(Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update RTT with new data.
virtual void CWndTrace(uint32_t oldValue[[maybe_unused]], uint32_t newValue[[maybe_unused]])
Tracks the congestion window changes.
virtual void QueueDrop(SocketWho who[[maybe_unused]])
Drop on the queue.
void ProcessedAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
ACK processed Callback.
void DoTeardown() override
Teardown the TCP test.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
InetSocketAddress m_remoteAddr
Remote peer address.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
virtual void HighestTxSeqTrace(SequenceNumber32 oldValue[[maybe_unused]], SequenceNumber32 newValue[[maybe_unused]])
Highest tx seq changes.
TCP socket creation and multiplexing/demultiplexing.
The NewReno implementation.
A base class for implementation of a stream socket using TCP.
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.
void CloseAndNotify()
Peacefully close the socket by notifying the upper layer and deallocate end point.
virtual void ReTxTimeout()
An RTO event happened.
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.
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.
void SetForkCb(Callback< void, Ptr< TcpSocketMsgBase >> cb)
Set the callback invoked after the forking.
AckManagementCb m_processedAckCb
Processed ACK callback.
void SetAfterRetransmitCb(RetrCb cb)
Set the callback invoked after the processing of a retransmit timeout.
void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission) override
Update the RTT history, when we send TCP segments.
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.
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.
void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) override
Complete a connection by forking the socket.
Ptr< TcpSocketBase > Fork() override
Call CopyObject<> to clone me.
static TypeId GetTypeId()
Get the type ID.
RetrCb m_beforeRetrCallback
Before retransmission callback.
Callback< void, Ptr< TcpSocketMsgBase > > m_forkCb
Fork callback.
void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader) override
Received an ACK packet.
RetrCb m_afterRetrCallback
After retransmission callback.
void ReTxTimeout() override
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()
Get the type ID.
SequenceNumber32 m_lastAckedSeq
Last sequence number ACKed.
uint32_t m_bytesToAck
Number of bytes to be ACKed.
void SendEmptyPacket(uint8_t flags) override
Send a empty packet that carries a flag, e.g., ACK.
uint32_t m_bytesLeftToBeAcked
Number of bytes to be ACKed left.
Ptr< TcpSocketBase > Fork() override
Call CopyObject<> to clone me.
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() const
Get an approximation of the time stored in this instance in the indicated unit.
T Get() 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, Args... > MakeNullCallback()
#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, Args... > MakeCallback(R(T::*memPtr)(Args...), 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)