A Discrete-Event Network Simulator
API
tcp-general-test.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Natale Patriciello <natale.patriciello@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 #ifndef TCPGENERALTEST_H
20 #define TCPGENERALTEST_H
21 
22 #include "ns3/simple-net-device.h"
23 #include "ns3/error-model.h"
24 #include "ns3/tcp-socket-base.h"
25 #include "ns3/tcp-congestion-ops.h"
26 #include "ns3/tcp-recovery-ops.h"
27 #include "ns3/tcp-rate-ops.h"
28 #include "ns3/test.h"
29 
30 namespace ns3 {
31 
53 {
54 public:
59  static TypeId GetTypeId (void);
60 
62  {
63  }
64 
70  {
71  m_rcvAckCb = other.m_rcvAckCb;
75  m_forkCb = other.m_forkCb;
77  }
78 
87  uint32_t, bool> UpdateRttCallback;
88 
95  void SetRcvAckCb (AckManagementCb cb);
96 
104 
110  void SetAfterRetransmitCb (RetrCb cb);
111 
117  void SetBeforeRetransmitCb (RetrCb cb);
118 
123  void SetForkCb (Callback<void, Ptr<TcpSocketMsgBase> > cb);
124 
131 
132 protected:
133  virtual void ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader);
134  virtual void ReTxTimeout (void);
135  virtual Ptr<TcpSocketBase> Fork (void);
136  virtual void CompleteFork (Ptr<Packet> p, const TcpHeader& tcpHeader,
137  const Address& fromAddress, const Address& toAddress);
138  virtual void UpdateRttHistory (const SequenceNumber32 &seq, uint32_t sz,
139  bool isRetransmission);
140 
141 private:
148 };
149 
150 
169 {
170 public:
175  static TypeId GetTypeId (void);
176 
178  : TcpSocketMsgBase (),
179  m_bytesToAck (125),
181  m_lastAckedSeq (1)
182  {
183  }
184 
190  : TcpSocketMsgBase (other),
191  m_bytesToAck (other.m_bytesToAck),
194  {
195  }
196 
201  void SetBytesToAck (uint32_t bytes)
202  {
203  m_bytesToAck = bytes;
204  }
205 
206 protected:
207  virtual void SendEmptyPacket (uint8_t flags);
208  Ptr<TcpSocketBase> Fork (void);
209 
210  uint32_t m_bytesToAck;
213 };
214 
256 class TcpGeneralTest : public TestCase
257 {
258 public:
267  TcpGeneralTest (const std::string &desc);
268  ~TcpGeneralTest ();
269 
275  {
277  RECEIVER
278  };
279 
280 protected:
287 
294 
301 
308 
315 
324  virtual Ptr<TcpSocketMsgBase> CreateSocket (Ptr<Node> node, TypeId socketType,
325  TypeId congControl);
326 
336  virtual Ptr<TcpSocketMsgBase> CreateSocket (Ptr<Node> node, TypeId socketType,
337  TypeId congControl, TypeId recoveryAlgorithm);
338 
344  {
345  return m_senderSocket;
346  }
347 
353  {
354  return m_receiverSocket;
355  }
356 
373  virtual void DoRun (void);
374 
378  virtual void ConfigureEnvironment (void);
379 
383  virtual void ConfigureProperties (void);
384 
388  virtual void DoTeardown (void);
389 
393  void DoConnect ();
394 
401  virtual void ReceivePacket (Ptr<Socket> socket);
402 
411  void SendPacket (Ptr<Socket> socket, uint32_t pktSize,
412  uint32_t pktCount, Time pktInterval);
413 
421  uint32_t GetSegSize (SocketWho who);
422 
431 
437  uint32_t GetReTxThreshold (SocketWho who);
438 
444  uint32_t GetInitialSsThresh (SocketWho who);
445 
451  uint32_t GetInitialCwnd (SocketWho who);
452 
458  uint32_t GetDupAckCount (SocketWho who);
459 
465  uint32_t GetDelAckCount (SocketWho who);
466 
473 
480  Time GetRto (SocketWho who);
481 
488  Time GetMinRto (SocketWho who);
489 
497 
505 
513 
521 
529 
537 
545 
552  uint32_t GetRWnd (SocketWho who);
553 
561 
569 
576  void SetRcvBufSize (SocketWho who, uint32_t size);
577 
584  void SetSegmentSize (SocketWho who, uint32_t segmentSize);
585 
592  void SetInitialCwnd (SocketWho who, uint32_t initialCwnd);
593 
600  void SetDelAckMaxCount (SocketWho who, uint32_t count);
601 
608  void SetUseEcn (SocketWho who, TcpSocketState::UseEcn_t useEcn);
609 
616  void SetPacingStatus (SocketWho who, bool pacing);
617 
624  void SetPaceInitialWindow (SocketWho who, bool paceWindow);
625 
632  void SetInitialSsThresh (SocketWho who, uint32_t initialSsThresh);
633 
641  void SetAppPktSize (uint32_t pktSize) { m_pktSize = pktSize; }
642 
650  void SetAppPktCount (uint32_t pktCount) { m_pktCount = pktCount; }
651 
657  void SetAppPktInterval (Time pktInterval) { m_interPacketInterval = pktInterval; }
658 
664  void SetPropagationDelay (Time propDelay) { m_propagationDelay = propDelay; }
665 
672 
678  void SetCongestionControl (TypeId congControl) { m_congControlTypeId = congControl; }
679 
685  void SetRecoveryAlgorithm (TypeId recovery) { m_recoveryTypeId = recovery; }
686 
692  void SetMTU (uint32_t mtu) { m_mtu = mtu; }
693 
699  virtual void CongStateTrace (const TcpSocketState::TcpCongState_t oldValue,
700  const TcpSocketState::TcpCongState_t newValue)
701  {
702  NS_UNUSED (oldValue);
703  NS_UNUSED (newValue);
704  }
705 
712  virtual void CWndTrace (uint32_t oldValue, uint32_t newValue)
713  {
714  NS_UNUSED (oldValue);
715  NS_UNUSED (newValue);
716  }
717 
724  virtual void CWndInflTrace (uint32_t oldValue, uint32_t newValue)
725  {
726  NS_UNUSED (oldValue);
727  NS_UNUSED (newValue);
728  }
729 
738  virtual void RttTrace (Time oldTime, Time newTime)
739  {
740  NS_UNUSED (oldTime);
741  NS_UNUSED (newTime);
742  }
743 
752  virtual void SsThreshTrace (uint32_t oldValue, uint32_t newValue)
753  {
754  NS_UNUSED (oldValue);
755  NS_UNUSED (newValue);
756  }
757 
766  virtual void BytesInFlightTrace (uint32_t oldValue, uint32_t newValue)
767  {
768  NS_UNUSED (oldValue);
769  NS_UNUSED (newValue);
770  }
771 
780  virtual void RtoTrace (Time oldValue, Time newValue)
781  {
782  NS_UNUSED (oldValue);
783  NS_UNUSED (newValue);
784  }
785 
794  virtual void NextTxSeqTrace (SequenceNumber32 oldValue, SequenceNumber32 newValue)
795  {
796  NS_UNUSED (oldValue);
797  NS_UNUSED (newValue);
798  }
799 
808  virtual void HighestTxSeqTrace (SequenceNumber32 oldValue, SequenceNumber32 newValue)
809  {
810  NS_UNUSED (oldValue);
811  NS_UNUSED (newValue);
812  }
813 
819  {
820  NS_UNUSED (rate);
821  }
822 
828  {
829  NS_UNUSED (sample);
830  }
831 
836  virtual void NormalClose (SocketWho who)
837  {
838  NS_UNUSED (who);
839  }
840 
846  virtual void ErrorClose (SocketWho who)
847  {
849  NS_UNUSED (who);
850  }
851 
856  virtual void QueueDrop (SocketWho who)
857  {
858  NS_UNUSED (who);
859  }
860 
865  virtual void PhyDrop (SocketWho who)
866  {
867  NS_UNUSED (who);
868  }
869 
879  virtual void RcvAck (const Ptr<const TcpSocketState> tcb,
880  const TcpHeader& h, SocketWho who)
881  {
882  NS_UNUSED (tcb);
883  NS_UNUSED (h);
884  NS_UNUSED (who);
885  }
886 
896  virtual void ProcessedAck (const Ptr<const TcpSocketState> tcb,
897  const TcpHeader& h, SocketWho who)
898  {
899  NS_UNUSED (tcb);
900  NS_UNUSED (h);
901  NS_UNUSED (who);
902  }
903 
911  virtual void Tx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
912 
920  virtual void Rx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
921 
929  {
930  NS_UNUSED (tcb);
931  NS_UNUSED (who);
932  }
933 
941  {
942  NS_UNUSED (tcb);
943  NS_UNUSED (who);
944  }
945 
953  virtual void UpdatedRttHistory (const SequenceNumber32 & seq, uint32_t sz,
954  bool isRetransmission, SocketWho who)
955  {
956  NS_UNUSED (seq);
957  NS_UNUSED (sz);
958  NS_UNUSED (isRetransmission);
959  NS_UNUSED (who);
960  }
961 
968  virtual void DataSent (uint32_t size, SocketWho who)
969  {
970  NS_UNUSED (size);
971  NS_UNUSED (who);
972  }
973 
977  virtual void FinalChecks ()
978  {
979  }
980 
986  {
987  return m_propagationDelay;
988  }
989 
995  {
996  return m_startTime;
997  }
998 
1003  uint32_t GetMtu () const
1004  {
1005  return m_mtu;
1006  }
1007 
1012  uint32_t GetPktSize () const
1013  {
1014  return m_pktSize;
1015  }
1016 
1021  uint32_t GetPktCount () const
1022  {
1023  return m_pktCount;
1024  }
1025 
1032  {
1033  return m_interPacketInterval;
1034  }
1035 
1038 
1039 private:
1040  // Member variables, accessible through getters
1041  // giving write access to subclass can be dangerous
1043 
1045  uint32_t m_mtu;
1046 
1047  uint32_t m_pktSize;
1048  uint32_t m_pktCount;
1050 
1053 
1054 private:
1055  // De-multiplexing callbacks.
1056 
1061  void NormalCloseCb (Ptr<Socket> socket);
1066  void ErrorCloseCb (Ptr<Socket> socket);
1072  void QueueDropCb (std::string context, Ptr<const Packet> p);
1078  void PhyDropCb (std::string context, Ptr<const Packet> p);
1085  void RcvAckCb (Ptr<const Packet> p, const TcpHeader& h,
1093  void ProcessedAckCb (Ptr<const Packet> p, const TcpHeader& h,
1101  void TxPacketCb (const Ptr<const Packet> p, const TcpHeader& h,
1102  const Ptr<const TcpSocketBase> tcp);
1109  void RxPacketCb (const Ptr<const Packet> p, const TcpHeader& h,
1110  const Ptr<const TcpSocketBase> tcp);
1117  const Ptr<const TcpSocketBase> tcp);
1126  uint32_t sz, bool isRetransmission);
1127 
1134  const Ptr<const TcpSocketBase> tcp);
1135 
1142  const Ptr<const TcpSocketBase> tcp);
1143 
1149  void DataSentCb (Ptr<Socket> socket, uint32_t size);
1154  void ForkCb (Ptr<TcpSocketMsgBase> tcp);
1160  void HandleAccept (Ptr<Socket> socket, const Address& from);
1161 
1163 };
1164 
1174 static inline TcpSocketState::TcpCongState_t
1176 {
1177  return tcb->m_congState.Get ();
1178 }
1179 
1180 } // namespace ns3
1181 
1182 #endif // TCPGENERALTEST_H
1183 
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::TcpGeneralTest::TxPacketCb
void TxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Tx packet Callback.
Definition: tcp-general-test.cc:507
ns3::InetSocketAddress
an Inet address class
Definition: inet-socket-address.h:41
ns3::TcpSocketMsgBase::SetProcessedAckCb
void SetProcessedAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received and processed (at the end of the processing)
Definition: tcp-general-test.cc:1065
ns3::TcpGeneralTest::GetReceiverSocket
Ptr< TcpSocketMsgBase > GetReceiverSocket()
Get the pointer to a previously created receiver socket.
Definition: tcp-general-test.h:352
ns3::TcpRateOps::TcpRateSample
Rate Sample structure.
Definition: tcp-rate-ops.h:134
ns3::TcpGeneralTest::SocketWho
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
Definition: tcp-general-test.h:275
ns3::TcpGeneralTest::m_startTime
Time m_startTime
Data transmission time.
Definition: tcp-general-test.h:1044
ns3::TracedValue::Get
T Get(void) const
Get the underlying value.
Definition: traced-value.h:229
ns3::TcpGeneralTest::BytesInFlightTrace
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Bytes in flight changes.
Definition: tcp-general-test.h:766
ns3::TcpGeneralTest::NextTxSeqTrace
virtual void NextTxSeqTrace(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Next tx seq changes.
Definition: tcp-general-test.h:794
ns3::TcpGeneralTest::Rx
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
Definition: tcp-general-test.cc:483
ns3::TcpGeneralTest::FinalChecks
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Definition: tcp-general-test.h:977
ns3::TcpSocketMsgBase::AckManagementCb
Callback< void, Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > AckManagementCb
Callback for the ACK management.
Definition: tcp-general-test.h:81
ns3::TcpGeneralTest::RtoExpiredCb
void RtoExpiredCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
RTO expired Callback.
ns3::TcpGeneralTest::NormalCloseCb
void NormalCloseCb(Ptr< Socket > socket)
Normal Close Callback.
Definition: tcp-general-test.cc:371
ns3::TcpGeneralTest::RxPacketCb
void RxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Rx packet Callback.
Definition: tcp-general-test.cc:525
ns3::TcpGeneralTest::GetPktCount
uint32_t GetPktCount() const
Get the number of application packets.
Definition: tcp-general-test.h:1021
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
ns3::TcpGeneralTest::RcvAck
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
Definition: tcp-general-test.h:879
ns3::Callback
Callback template class.
Definition: callback.h:1279
ns3::TcpGeneralTest::DataSent
virtual void DataSent(uint32_t size, SocketWho who)
Notifying application for sent data.
Definition: tcp-general-test.h:968
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TcpGeneralTest::CreateChannel
virtual Ptr< SimpleChannel > CreateChannel()
Create and return the channel installed between the two socket.
Definition: tcp-general-test.cc:268
ns3::TcpGeneralTest::ProcessedAckCb
void ProcessedAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
ACK processed Callback.
Definition: tcp-general-test.cc:543
ns3::TcpGeneralTest::SENDER
@ SENDER
Sender node.
Definition: tcp-general-test.h:276
ns3::TcpGeneralTest::~TcpGeneralTest
~TcpGeneralTest()
Definition: tcp-general-test.cc:51
ns3::TcpSocketMsgBase::TcpSocketMsgBase
TcpSocketMsgBase(const TcpSocketMsgBase &other)
Constructor.
Definition: tcp-general-test.h:69
ns3::TcpGeneralTest::SetTransmitStart
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
Definition: tcp-general-test.h:671
ns3::TcpGeneralTest::SetCongestionControl
void SetCongestionControl(TypeId congControl)
Congestion control of the sender socket.
Definition: tcp-general-test.h:678
ns3::TcpGeneralTest::m_pktCount
uint32_t m_pktCount
Count of the application packet.
Definition: tcp-general-test.h:1048
ns3::TcpGeneralTest::GetPktSize
uint32_t GetPktSize() const
Get the application packet size.
Definition: tcp-general-test.h:1012
ns3::TcpGeneralTest::TcpGeneralTest
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
Definition: tcp-general-test.cc:42
ns3::TcpGeneralTest::GetTcpState
TcpSocket::TcpStates_t GetTcpState(SocketWho who)
Get the state of the TCP state machine.
Definition: tcp-general-test.cc:779
ns3::TcpGeneralTest::ConfigureProperties
virtual void ConfigureProperties(void)
Change the configuration of the socket properties.
Definition: tcp-general-test.cc:115
ns3::TcpGeneralTest::SetAppPktCount
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
Definition: tcp-general-test.h:650
ns3::GetCongStateFrom
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
Definition: tcp-general-test.h:1175
ns3::TcpGeneralTest::CWndTrace
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
Tracks the congestion window changes.
Definition: tcp-general-test.h:712
ns3::TcpSocketMsgBase::UpdateRttCallback
Callback< void, Ptr< const TcpSocketBase >, const SequenceNumber32 &, uint32_t, bool > UpdateRttCallback
Callback for the RTT update management.
Definition: tcp-general-test.h:87
ns3::TcpGeneralTest::GetConnTimeout
Time GetConnTimeout(SocketWho who)
Get the retransmission time for the SYN segments.
Definition: tcp-general-test.cc:728
ns3::TcpGeneralTest::SetPaceInitialWindow
void SetPaceInitialWindow(SocketWho who, bool paceWindow)
Enable or disable pacing of the initial window.
Definition: tcp-general-test.cc:1005
ns3::TcpSocketMsgBase
Class for inserting callbacks special points of the flow of TCP sockets.
Definition: tcp-general-test.h:53
ns3::TcpSocketMsgBase::m_beforeRetrCallback
RetrCb m_beforeRetrCallback
Before retransmission callback.
Definition: tcp-general-test.h:144
ns3::TcpSocketState::TcpCongState_t
TcpCongState_t
Definition of the Congestion state machine.
Definition: tcp-socket-state.h:77
ns3::TcpGeneralTest::CreateSocket
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
Definition: tcp-general-test.cc:278
ns3::TcpGeneralTest::SetInitialCwnd
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
Definition: tcp-general-test.cc:939
ns3::TcpGeneralTest::ForkCb
void ForkCb(Ptr< TcpSocketMsgBase > tcp)
Fork Callback.
Definition: tcp-general-test.cc:561
ns3::TcpSocketSmallAcks::m_bytesToAck
uint32_t m_bytesToAck
Number of bytes to be ACKed.
Definition: tcp-general-test.h:210
ns3::TcpGeneralTest::GetRWnd
uint32_t GetRWnd(SocketWho who)
Get the rWnd of the selected socket.
Definition: tcp-general-test.cc:797
ns3::TcpSocketMsgBase::RetrCb
Callback< void, Ptr< const TcpSocketState >, Ptr< const TcpSocketBase > > RetrCb
Callback for the packet retransmission management.
Definition: tcp-general-test.h:84
ns3::TcpGeneralTest::Tx
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
Definition: tcp-general-test.cc:477
ns3::TcpGeneralTest::HandleAccept
void HandleAccept(Ptr< Socket > socket, const Address &from)
Handle an accept connection.
Definition: tcp-general-test.cc:258
ns3::TcpSocketMsgBase::Fork
virtual Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
Definition: tcp-general-test.cc:1052
ns3::TcpGeneralTest::SetRcvBufSize
void SetRcvBufSize(SocketWho who, uint32_t size)
Forcefully set a defined size for rx buffer.
Definition: tcp-general-test.cc:905
ns3::TcpGeneralTest::m_pktSize
uint32_t m_pktSize
Size of the application packet.
Definition: tcp-general-test.h:1047
ns3::TcpGeneralTest::GetStartTime
Time GetStartTime() const
Get the data start time.
Definition: tcp-general-test.h:994
ns3::TcpSocketMsgBase::m_rcvAckCb
AckManagementCb m_rcvAckCb
Receive ACK callback.
Definition: tcp-general-test.h:142
ns3::TcpGeneralTest::m_recoveryTypeId
TypeId m_recoveryTypeId
Recovery.
Definition: tcp-general-test.h:1037
ns3::TcpSocketBase
A base class for implementation of a stream socket using TCP.
Definition: tcp-socket-base.h:218
ns3::TcpGeneralTest::GetSenderSocket
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
Definition: tcp-general-test.h:343
ns3::TcpGeneralTest::RateSampleUpdatedTrace
virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
Definition: tcp-general-test.h:827
ns3::TcpGeneralTest::GetSegSize
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
Definition: tcp-general-test.cc:637
ns3::TcpGeneralTest::SetMTU
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
Definition: tcp-general-test.h:692
ns3::TcpGeneralTest::m_receiverSocket
Ptr< TcpSocketMsgBase > m_receiverSocket
Pointer to receiver socket.
Definition: tcp-general-test.h:1052
ns3::TcpSocketMsgBase::ReTxTimeout
virtual void ReTxTimeout(void)
An RTO event happened.
Definition: tcp-general-test.cc:1097
ns3::TcpGeneralTest::GetPropagationDelay
Time GetPropagationDelay() const
Get the channel Propagation Delay.
Definition: tcp-general-test.h:985
ns3::TcpGeneralTest::m_remoteAddr
InetSocketAddress m_remoteAddr
Remote peer address.
Definition: tcp-general-test.h:1162
ns3::TestCase
encapsulates test code
Definition: test.h:1154
ns3::TcpGeneralTest::HighestTxSeqTrace
virtual void HighestTxSeqTrace(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Highest tx seq changes.
Definition: tcp-general-test.h:808
startTime
double startTime
Definition: tcp-nsc-comparison.cc:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::TcpSocketSmallAcks
A TCP socket which sends ACKs smaller than the segment received.
Definition: tcp-general-test.h:169
ns3::TcpSocketState::m_congState
TracedValue< TcpCongState_t > m_congState
State in the Congestion state machine.
Definition: tcp-socket-state.h:180
ns3::TcpGeneralTest::GetInitialCwnd
uint32_t GetInitialCwnd(SocketWho who)
Get the initial congestion window.
Definition: tcp-general-test.cc:660
ns3::TcpGeneralTest::RateUpdatedTrace
virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
Definition: tcp-general-test.h:818
ns3::TcpGeneralTest::BeforeRetransmitCb
void BeforeRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked before a retransmit event.
Definition: tcp-general-test.cc:425
ns3::TcpGeneralTest::m_senderSocket
Ptr< TcpSocketMsgBase > m_senderSocket
Pointer to sender socket.
Definition: tcp-general-test.h:1051
ns3::TcpSocketMsgBase::UpdateRttHistory
virtual void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update the RTT history, when we send TCP segments.
Definition: tcp-general-test.cc:1119
ns3::TcpGeneralTest::CreateSenderErrorModel
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
Definition: tcp-general-test.cc:312
ns3::TcpSocketMsgBase::m_afterRetrCallback
RetrCb m_afterRetrCallback
After retransmission callback.
Definition: tcp-general-test.h:145
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::TcpGeneralTest::PhyDrop
virtual void PhyDrop(SocketWho who)
Link drop.
Definition: tcp-general-test.h:865
ns3::TcpGeneralTest::GetMtu
uint32_t GetMtu() const
Get the MTU of the environment.
Definition: tcp-general-test.h:1003
ns3::TcpGeneralTest::m_mtu
uint32_t m_mtu
MTU of the environment.
Definition: tcp-general-test.h:1045
ns3::TcpSocketSmallAcks::SendEmptyPacket
virtual void SendEmptyPacket(uint8_t flags)
Send a empty packet that carries a flag, e.g., ACK.
Definition: tcp-general-test.cc:1162
ns3::TcpGeneralTest::RtoTrace
virtual void RtoTrace(Time oldValue, Time newValue)
RTO changes.
Definition: tcp-general-test.h:780
ns3::TcpGeneralTest::SetDelAckMaxCount
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
Definition: tcp-general-test.cc:955
ns3::TcpSocketMsgBase::ReceivedAck
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received an ACK packet.
Definition: tcp-general-test.cc:1086
ns3::TcpGeneralTest::GetDelAckTimeout
Time GetDelAckTimeout(SocketWho who)
Get the timeout of delayed ack (if present)
Definition: tcp-general-test.cc:620
ns3::TcpSocketMsgBase::m_updateRttCb
UpdateRttCallback m_updateRttCb
Update RTT callback.
Definition: tcp-general-test.h:147
NS_UNUSED
#define NS_UNUSED(x)
Mark a local variable as unused.
Definition: unused.h:36
ns3::TcpSocketMsgBase::CompleteFork
virtual void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Complete a connection by forking the socket.
Definition: tcp-general-test.cc:1130
ns3::TcpGeneralTest::CWndInflTrace
virtual void CWndInflTrace(uint32_t oldValue, uint32_t newValue)
Tracks the inflated congestion window changes.
Definition: tcp-general-test.h:724
ns3::TcpGeneralTest::SetAppPktInterval
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
Definition: tcp-general-test.h:657
ns3::TcpGeneralTest::ConfigureEnvironment
virtual void ConfigureEnvironment(void)
Change the configuration of the environment.
Definition: tcp-general-test.cc:100
ns3::TcpGeneralTest::ErrorCloseCb
void ErrorCloseCb(Ptr< Socket > socket)
Error Close Callback.
Definition: tcp-general-test.cc:460
ns3::TcpGeneralTest::DoTeardown
virtual void DoTeardown(void)
Teardown the TCP test.
Definition: tcp-general-test.cc:91
ns3::TcpGeneralTest::GetMinRto
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
Definition: tcp-general-test.cc:711
ns3::TcpGeneralTest::RECEIVER
@ RECEIVER
Receiver node.
Definition: tcp-general-test.h:277
ns3::TcpGeneralTest::SetPacingStatus
void SetPacingStatus(SocketWho who, bool pacing)
Enable or disable pacing in the TCP socket.
Definition: tcp-general-test.cc:988
ns3::TcpGeneralTest::ProcessedAck
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
Definition: tcp-general-test.h:896
ns3::TcpGeneralTest::RcvAckCb
void RcvAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
Receive ACK Callback.
Definition: tcp-general-test.cc:489
ns3::TcpSocketSmallAcks::Fork
Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
Definition: tcp-general-test.cc:1321
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::TcpHeader
Header for the Transmission Control Protocol.
Definition: tcp-header.h:45
ns3::TcpGeneralTest::ErrorClose
virtual void ErrorClose(SocketWho who)
Socket closed with an error.
Definition: tcp-general-test.h:846
ns3::TcpGeneralTest::UpdatedRttHistory
virtual void UpdatedRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission, SocketWho who)
Updated the Rtt history.
Definition: tcp-general-test.h:953
ns3::TcpGeneralTest::NormalClose
virtual void NormalClose(SocketWho who)
Socket closed normally.
Definition: tcp-general-test.h:836
ns3::TcpGeneralTest::GetRxBuffer
Ptr< TcpRxBuffer > GetRxBuffer(SocketWho who)
Get the Rx buffer from selected socket.
Definition: tcp-general-test.cc:869
ns3::TcpSocketMsgBase::SetAfterRetransmitCb
void SetAfterRetransmitCb(RetrCb cb)
Set the callback invoked after the processing of a retransmit timeout.
Definition: tcp-general-test.cc:1072
ns3::TcpGeneralTest::CongStateTrace
virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
Definition: tcp-general-test.h:699
ns3::TcpSocketMsgBase::SetRcvAckCb
void SetRcvAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received (at the beginning of the processing)
Definition: tcp-general-test.cc:1058
ns3::TcpGeneralTest::ReceivePacket
virtual void ReceivePacket(Ptr< Socket > socket)
Packet received.
Definition: tcp-general-test.cc:57
ns3::TcpGeneralTest::PhyDropCb
void PhyDropCb(std::string context, Ptr< const Packet > p)
Drop at Phy layer Callback.
Definition: tcp-general-test.cc:353
ns3::TcpSocketMsgBase::SetBeforeRetransmitCb
void SetBeforeRetransmitCb(RetrCb cb)
Set the callback invoked before the processing of a retransmit timeout.
Definition: tcp-general-test.cc:1079
ns3::TcpSocketMsgBase::SetUpdateRttHistoryCb
void SetUpdateRttHistoryCb(UpdateRttCallback cb)
Set the callback invoked when we update rtt history.
Definition: tcp-general-test.cc:1112
ns3::TcpGeneralTest::GetTcb
Ptr< TcpSocketState > GetTcb(SocketWho who)
Get the TCB from selected socket.
Definition: tcp-general-test.cc:851
ns3::TcpGeneralTest::BeforeRTOExpired
virtual void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-general-test.h:940
ns3::TcpSocketSmallAcks::TcpSocketSmallAcks
TcpSocketSmallAcks()
Definition: tcp-general-test.h:177
ns3::TcpGeneralTest
General infrastructure for TCP testing.
Definition: tcp-general-test.h:257
ns3::TcpSocketMsgBase::m_processedAckCb
AckManagementCb m_processedAckCb
Processed ACK callback.
Definition: tcp-general-test.h:143
ns3::TcpGeneralTest::DoRun
virtual void DoRun(void)
Execute the tcp test.
Definition: tcp-general-test.cc:125
ns3::TcpGeneralTest::RttTrace
virtual void RttTrace(Time oldTime, Time newTime)
Rtt changes.
Definition: tcp-general-test.h:738
ns3::TcpGeneralTest::GetPersistentTimeout
Time GetPersistentTimeout(SocketWho who)
Get the persistent timeout of the selected socket.
Definition: tcp-general-test.cc:833
ns3::TcpSocketSmallAcks::m_bytesLeftToBeAcked
uint32_t m_bytesLeftToBeAcked
Number of bytes to be ACKed left.
Definition: tcp-general-test.h:211
ns3::TcpSocketMsgBase::SetForkCb
void SetForkCb(Callback< void, Ptr< TcpSocketMsgBase > > cb)
Set the callback invoked after the forking.
Definition: tcp-general-test.cc:1105
ns3::TcpGeneralTest::GetRto
Time GetRto(SocketWho who)
Get the retransmission time.
Definition: tcp-general-test.cc:694
ns3::TcpGeneralTest::DataSentCb
void DataSentCb(Ptr< Socket > socket, uint32_t size)
Data sent Callback.
Definition: tcp-general-test.cc:443
ns3::TcpGeneralTest::CreateReceiverSocket
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
Definition: tcp-general-test.cc:330
ns3::TcpSocketState::UseEcn_t
UseEcn_t
Parameter value related to ECN enable/disable functionality similar to sysctl for tcp_ecn.
Definition: tcp-socket-state.h:113
ns3::TcpSocketSmallAcks::m_lastAckedSeq
SequenceNumber32 m_lastAckedSeq
Last sequence number ACKed.
Definition: tcp-general-test.h:212
ns3::TcpGeneralTest::GetHighestTxMark
SequenceNumber32 GetHighestTxMark(SocketWho who)
Get the highest tx mark of the node specified.
Definition: tcp-general-test.cc:654
ns3::TcpGeneralTest::SendPacket
void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Send packets to other endpoint.
Definition: tcp-general-test.cc:73
ns3::TcpGeneralTest::QueueDropCb
void QueueDropCb(std::string context, Ptr< const Packet > p)
Queue Drop Callback.
Definition: tcp-general-test.cc:336
ns3::TcpGeneralTest::GetDupAckCount
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
Definition: tcp-general-test.cc:586
ns3::TcpGeneralTest::SsThreshTrace
virtual void SsThreshTrace(uint32_t oldValue, uint32_t newValue)
Slow start threshold changes.
Definition: tcp-general-test.h:752
ns3::TcpGeneralTest::GetDelAckCount
uint32_t GetDelAckCount(SocketWho who)
Get the number of delayed ack (if present)
Definition: tcp-general-test.cc:603
ns3::TcpGeneralTest::GetPersistentEvent
EventId GetPersistentEvent(SocketWho who)
Get the persistent event of the selected socket.
Definition: tcp-general-test.cc:815
ns3::TcpGeneralTest::UpdateRttHistoryCb
void UpdateRttHistoryCb(Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update RTT with new data.
Definition: tcp-general-test.cc:388
ns3::TcpGeneralTest::DoConnect
void DoConnect()
Scheduled at 0.0, SENDER starts the connection to RECEIVER.
Definition: tcp-general-test.cc:251
ns3::TcpSocketMsgBase::m_forkCb
Callback< void, Ptr< TcpSocketMsgBase > > m_forkCb
Fork callback.
Definition: tcp-general-test.h:146
ns3::TcpGeneralTest::QueueDrop
virtual void QueueDrop(SocketWho who)
Drop on the queue.
Definition: tcp-general-test.h:856
ns3::TcpGeneralTest::m_congControlTypeId
TypeId m_congControlTypeId
Congestion control.
Definition: tcp-general-test.h:1036
ns3::TcpGeneralTest::m_interPacketInterval
Time m_interPacketInterval
Time between sending application packet down to tcp socket.
Definition: tcp-general-test.h:1049
pktSize
uint32_t pktSize
packet size used for the simulation (in bytes)
Definition: wifi-bianchi.cc:86
segmentSize
uint32_t segmentSize
Definition: tcp-linux-reno.cc:53
ns3::TcpSocketSmallAcks::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-general-test.cc:1144
ns3::TcpGeneralTest::GetReTxThreshold
uint32_t GetReTxThreshold(SocketWho who)
Get the retransmission threshold.
Definition: tcp-general-test.cc:569
ns3::TcpGeneralTest::SetAppPktSize
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
Definition: tcp-general-test.h:641
ns3::TcpSocketMsgBase::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-general-test.cc:1041
ns3::TcpSocketSmallAcks::SetBytesToAck
void SetBytesToAck(uint32_t bytes)
Set the bytes to be ACKed.
Definition: tcp-general-test.h:201
ns3::TcpGeneralTest::AfterRetransmitCb
void AfterRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked after a retransmit event.
Definition: tcp-general-test.cc:407
ns3::TcpGeneralTest::GetInitialSsThresh
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
Definition: tcp-general-test.cc:677
ns3::TcpRateOps::TcpRateConnection
Information about the connection rate.
Definition: tcp-rate-ops.h:163
ns3::TcpSocketSmallAcks::TcpSocketSmallAcks
TcpSocketSmallAcks(const TcpSocketSmallAcks &other)
Constructor.
Definition: tcp-general-test.h:189
ns3::TcpGeneralTest::GetPktInterval
Time GetPktInterval() const
Get the interval to wait for each packet sent down from application to TCP.
Definition: tcp-general-test.h:1031
ns3::TcpGeneralTest::SetUseEcn
void SetUseEcn(SocketWho who, TcpSocketState::UseEcn_t useEcn)
Forcefully set the ECN mode of use.
Definition: tcp-general-test.cc:971
ns3::TcpSocketMsgBase::TcpSocketMsgBase
TcpSocketMsgBase()
Definition: tcp-general-test.h:61
ns3::TcpGeneralTest::m_propagationDelay
Time m_propagationDelay
Propagation delay of the channel.
Definition: tcp-general-test.h:1042
ns3::TcpGeneralTest::CreateReceiverErrorModel
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
Definition: tcp-general-test.cc:318
ns3::TcpGeneralTest::SetRecoveryAlgorithm
void SetRecoveryAlgorithm(TypeId recovery)
recovery algorithm of the sender socket
Definition: tcp-general-test.h:685
ns3::TcpGeneralTest::AfterRTOExpired
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
Definition: tcp-general-test.h:928
ns3::TcpGeneralTest::SetInitialSsThresh
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
Definition: tcp-general-test.cc:1022
ns3::TcpGeneralTest::GetClockGranularity
Time GetClockGranularity(SocketWho who)
Get the clock granularity attribute.
Definition: tcp-general-test.cc:762
ns3::SequenceNumber< uint32_t, int32_t >
ns3::TcpGeneralTest::GetTxBuffer
Ptr< TcpTxBuffer > GetTxBuffer(SocketWho who)
Get the Tx buffer from selected socket.
Definition: tcp-general-test.cc:887
ns3::TcpGeneralTest::GetRttEstimator
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
Definition: tcp-general-test.cc:745
ns3::TcpSocket::TcpStates_t
TcpStates_t
Names of the 11 TCP states.
Definition: tcp-socket.h:65
ns3::TcpGeneralTest::CreateSenderSocket
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Definition: tcp-general-test.cc:324
ns3::TcpGeneralTest::SetPropagationDelay
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
Definition: tcp-general-test.h:664
ns3::TcpGeneralTest::SetSegmentSize
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
Definition: tcp-general-test.cc:922