21 #include "ns3/object.h"
23 #include "ns3/uinteger.h"
24 #include "ns3/double.h"
25 #include "ns3/boolean.h"
26 #include "ns3/trace-source-accessor.h"
27 #include "ns3/nstime.h"
37 const char*
const TcpSocket::TcpStateName[
LAST_STATE] = {
"CLOSED",
"LISTEN",
"SYN_SENT",
"SYN_RCVD",
"ESTABLISHED",
"CLOSE_WAIT",
"LAST_ACK",
"FIN_WAIT_1",
"FIN_WAIT_2",
"CLOSING",
"TIME_WAIT" };
44 .AddAttribute (
"SndBufSize",
45 "TcpSocket maximum transmit buffer size (bytes)",
49 MakeUintegerChecker<uint32_t> ())
50 .AddAttribute (
"RcvBufSize",
51 "TcpSocket maximum receive buffer size (bytes)",
55 MakeUintegerChecker<uint32_t> ())
56 .AddAttribute (
"SegmentSize",
57 "TCP maximum segment size in bytes (may be adjusted based on MTU discovery)",
61 MakeUintegerChecker<uint32_t> ())
62 .AddAttribute (
"SlowStartThreshold",
63 "TCP slow start threshold (bytes)",
67 MakeUintegerChecker<uint32_t> ())
68 .AddAttribute (
"InitialCwnd",
69 "TCP initial congestion window size (segments)",
73 MakeUintegerChecker<uint32_t> ())
74 .AddAttribute (
"ConnTimeout",
75 "TCP retransmission timeout when opening connection (seconds)",
80 .AddAttribute (
"ConnCount",
81 "Number of connection attempts (SYN retransmissions) before returning failure",
85 MakeUintegerChecker<uint32_t> ())
86 .AddAttribute (
"DelAckTimeout",
87 "Timeout value for TCP delayed acks, in seconds",
92 .AddAttribute (
"DelAckCount",
93 "Number of packets to wait before sending a TCP ack",
97 MakeUintegerChecker<uint32_t> ())
98 .AddAttribute (
"TcpNoDelay",
"Set to true to disable Nagle's algorithm",
102 MakeBooleanChecker ())
103 .AddAttribute (
"PersistTimeout",
104 "Persist timeout to probe for rx window",
virtual void SetSndBufSize(uint32_t size)=0
Set the send buffer size.
NS_LOG_COMPONENT_DEFINE("TcpSocket")
virtual void SetSSThresh(uint32_t threshold)=0
Set the Slow Start Threshold.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual void SetInitialCwnd(uint32_t cwnd)=0
Set the initial Congestion Window.
virtual void SetRcvBufSize(uint32_t size)=0
Set the receive buffer size.
virtual void SetPersistTimeout(Time timeout)=0
Set the timout for persistent connection.
A low-level Socket API based loosely on the BSD Socket API.
static TypeId GetTypeId(void)
Get the type ID.
static const char *const TcpStateName[LAST_STATE]
Literal names of TCP states for use in log messages.
hold objects of type ns3::Time
Hold an unsigned integer type.
virtual uint32_t GetSndBufSize(void) const =0
Get the send buffer size.
virtual void SetDelAckMaxCount(uint32_t count)=0
Set the number of packet to fire an ACK before delay timeout.
virtual void SetTcpNoDelay(bool noDelay)=0
Enable/Disable Nagle's algorithm.
virtual uint32_t GetSSThresh(void) const =0
Get the Slow Start Threshold.
virtual uint32_t GetRcvBufSize(void) const =0
Get the receive buffer size.
virtual void SetDelAckTimeout(Time timeout)=0
Set the time to delay an ACK.
virtual void SetConnCount(uint32_t count)=0
Set the number of connection retries before giving up.
virtual uint32_t GetSegSize(void) const =0
Get the segment size.
virtual Time GetDelAckTimeout(void) const =0
Get the time to delay an ACK.
virtual bool GetTcpNoDelay(void) const =0
Check if Nagle's algorithm is enabled or not.
virtual void SetConnTimeout(Time timeout)=0
Set the connection timeout.
virtual uint32_t GetDelAckMaxCount(void) const =0
Get the number of packet to fire an ACK before delay timeout.
virtual Time GetConnTimeout(void) const =0
Get the connection timeout.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual void SetSegSize(uint32_t size)=0
Set the segment size.
a unique identifier for an interface.
virtual uint32_t GetInitialCwnd(void) const =0
Get the initial Congestion Window.
TypeId SetParent(TypeId tid)
virtual Time GetPersistTimeout(void) const =0
Get the timout for persistent connection.
virtual uint32_t GetConnCount(void) const =0
Get the number of connection retries before giving up.