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"
42 .AddConstructor<TcpTahoe> ()
43 .AddAttribute (
"ReTxThreshold",
"Threshold for fast retransmit",
46 MakeUintegerChecker<uint32_t> ())
47 .AddTraceSource (
"CongestionWindow",
48 "The TCP connection's congestion window",
50 "ns3::TracedValue::Uint32Callback")
51 .AddTraceSource (
"SlowStartThreshold",
52 "TCP slow start threshold (bytes)",
54 "ns3::TracedValue::Uint32Callback")
67 m_ssThresh (sock.m_ssThresh),
68 m_initialCWnd (sock.m_initialCWnd),
69 m_initialSsThresh (sock.m_initialSsThresh),
70 m_retxThresh (sock.m_retxThresh)
109 return CopyObject<TcpTahoe> (
this);
117 NS_LOG_LOGIC (
"TcpTahoe received ACK for seq " << seq <<
129 adder = std::max (1.0, adder);
130 m_cWnd +=
static_cast<uint32_t
> (adder);
164 if (m_state <= ESTABLISHED && m_txBuffer->HeadSequence () >=
m_highTxMark)
return;
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)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual uint32_t GetInitialSSThresh(void) const
Get the initial Slow Start Threshold.
virtual uint32_t GetInitialCwnd(void) const
Get the initial Congestion Window.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_segmentSize
Segment size.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
T Get(void) const
Get the underlying value.
TracedValue< TcpStates_t > m_state
TCP state.
An implementation of a stream socket using TCP.
a polymophic address class
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
virtual void SetInitialCwnd(uint32_t cwnd)
Set the initial Congestion Window.
virtual void SetInitialSSThresh(uint32_t threshold)
Set the initial Slow Start Threshold.
TracedValue< uint32_t > m_ssThresh
Slow Start Threshold.
Ptr< 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.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
uint32_t m_initialCWnd
Initial cWnd value.
virtual void Retransmit(void)
Halving cwnd and call DoRetransmit()
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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)
static Time Now(void)
Return the current simulation virtual time.
uint32_t m_initialSsThresh
Initial Slow Start Threshold value.
TracedValue< SequenceNumber32 > m_highTxMark
Highest seqno ever sent, regardless of ReTx.
virtual void NewAck(SequenceNumber32 const &seq)
Update buffers w.r.t.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
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.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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.