21 #define NS_LOG_APPEND_CONTEXT \
22 if (m_node) { std::clog << Simulator::Now ().GetSeconds () << " [node " << m_node->GetId () << "] "; }
26 #include "ns3/trace-source-accessor.h"
27 #include "ns3/simulator.h"
28 #include "ns3/abort.h"
43 .AddConstructor<TcpTahoe> ()
44 .AddAttribute (
"ReTxThreshold",
"Threshold for fast retransmit",
47 MakeUintegerChecker<uint32_t> ())
48 .AddTraceSource (
"CongestionWindow",
49 "The TCP connection's congestion window",
63 m_ssThresh (sock.m_ssThresh),
64 m_initialCWnd (sock.m_initialCWnd),
65 m_retxThresh (sock.m_retxThresh)
104 return CopyObject<TcpTahoe> (
this);
112 NS_LOG_LOGIC (
"TcpTahoe receieved ACK for seq " << seq <<
124 adder = std::max (1.0, adder);
125 m_cWnd +=
static_cast<uint32_t
> (adder);
164 m_rtt->IncreaseMultiplier ();
virtual Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
TracedValue< uint32_t > m_cWnd
Congestion window.
virtual int Listen(void)
Listen for incoming connections.
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
virtual void SetSegSize(uint32_t size)
Set the segment size.
uint32_t m_retxThresh
Fast Retransmit threshold.
virtual uint32_t Window(void)
Return the max possible number of unacked bytes.
SequenceNumber32 HeadSequence(void) const
Returns the first byte's sequence number.
virtual uint32_t GetInitialCwnd(void) const
Get the initial Congestion Window.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint32_t m_segmentSize
Segment size.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
uint32_t m_ssThresh
Slow Start Threshold.
TracedValue< TcpStates_t > m_state
TCP state.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if cond is false.
An implementation of a stream socket using TCP.
a polymophic address class
virtual void SetInitialCwnd(uint32_t cwnd)
Set the initial Congestion Window.
TcpTxBuffer m_txBuffer
Tx buffer.
virtual int Listen(void)
Listen for incoming connections.
Hold an unsigned integer type.
static TypeId GetTypeId(void)
Get the type ID.
A base class for implementation of a stream socket using TCP.
Ptr< RttEstimator > m_rtt
Round trip time estimator.
#define NS_LOG_LOGIC(msg)
uint32_t m_initialCWnd
Initial cWnd value.
virtual void Retransmit(void)
Halving cwnd and call DoRetransmit()
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
virtual int Connect(const Address &address)
Initiate a connection to a remote host.
virtual void DupAck(const TcpHeader &t, uint32_t count)
Received dupack (duplicate ACK)
NS_LOG_COMPONENT_DEFINE("TcpTahoe")
static Time Now(void)
Return the "current simulation time".
TracedValue< SequenceNumber32 > m_highTxMark
Highest seqno ever sent, regardless of ReTx.
virtual void NewAck(SequenceNumber32 const &seq)
Update buffers w.r.t.
virtual uint32_t GetSSThresh(void) const
Get the Slow Start Threshold.
virtual void NewAck(SequenceNumber32 const &seq)
Update buffers w.r.t.
TcpTahoe(void)
Create an unbound tcp socket.
void InitializeCwnd(void)
Set the congestion window when connection starts.
virtual int Connect(const Address &address)
Initiate a connection to a remote host.
virtual void SetSSThresh(uint32_t threshold)
Set the Slow Start Threshold.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
TracedValue< uint32_t > m_rWnd
Flow control window at remote side.
virtual void DoRetransmit(void)
Retransmit the oldest packet.