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 ([[maybe_unused]] const TcpSocketState::TcpCongState_t oldValue,
700  [[maybe_unused]] const TcpSocketState::TcpCongState_t newValue)
701  {
702  }
703 
710  virtual void CWndTrace ([[maybe_unused]] uint32_t oldValue,
711  [[maybe_unused]] uint32_t newValue)
712  {
713  }
714 
721  virtual void CWndInflTrace ([[maybe_unused]] uint32_t oldValue,
722  [[maybe_unused]] uint32_t newValue)
723  {
724  }
725 
734  virtual void RttTrace ([[maybe_unused]] Time oldTime,
735  [[maybe_unused]] Time newTime)
736  {
737  }
738 
747  virtual void SsThreshTrace ([[maybe_unused]] uint32_t oldValue,
748  [[maybe_unused]] uint32_t newValue)
749  {
750  }
751 
760  virtual void BytesInFlightTrace ([[maybe_unused]] uint32_t oldValue,
761  [[maybe_unused]] uint32_t newValue)
762  {
763  }
764 
773  virtual void RtoTrace ([[maybe_unused]] Time oldValue,
774  [[maybe_unused]] Time newValue)
775  {
776  }
777 
786  virtual void NextTxSeqTrace ([[maybe_unused]] SequenceNumber32 oldValue,
787  [[maybe_unused]] SequenceNumber32 newValue)
788  {
789  }
790 
799  virtual void HighestTxSeqTrace ([[maybe_unused]] SequenceNumber32 oldValue,
800  [[maybe_unused]] SequenceNumber32 newValue)
801  {
802  }
803 
808  virtual void RateUpdatedTrace ([[maybe_unused]] const TcpRateLinux::TcpRateConnection &rate)
809  {
810  }
811 
816  virtual void RateSampleUpdatedTrace ([[maybe_unused]] const TcpRateLinux::TcpRateSample &sample)
817  {
818  }
819 
824  virtual void NormalClose ([[maybe_unused]] SocketWho who)
825  {
826  }
827 
833  virtual void ErrorClose ([[maybe_unused]] SocketWho who)
834  {
836  }
837 
842  virtual void QueueDrop ([[maybe_unused]] SocketWho who)
843  {
844  }
845 
850  virtual void PhyDrop ([[maybe_unused]] SocketWho who)
851  {
852  }
853 
863  virtual void RcvAck ([[maybe_unused]] const Ptr<const TcpSocketState> tcb,
864  [[maybe_unused]] const TcpHeader& h,
865  [[maybe_unused]] SocketWho who)
866  {
867  }
868 
878  virtual void ProcessedAck ([[maybe_unused]] const Ptr<const TcpSocketState> tcb,
879  [[maybe_unused]] const TcpHeader& h,
880  [[maybe_unused]] SocketWho who)
881  {
882  }
883 
891  virtual void Tx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
892 
900  virtual void Rx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
901 
908  virtual void AfterRTOExpired ([[maybe_unused]] const Ptr<const TcpSocketState> tcb,
909  [[maybe_unused]] SocketWho who)
910  {
911  }
912 
919  virtual void BeforeRTOExpired ([[maybe_unused]] const Ptr<const TcpSocketState> tcb,
920  [[maybe_unused]] SocketWho who)
921  {
922  }
923 
931  virtual void UpdatedRttHistory ([[maybe_unused]] const SequenceNumber32 & seq,
932  [[maybe_unused]] uint32_t sz,
933  [[maybe_unused]] bool isRetransmission,
934  [[maybe_unused]] SocketWho who)
935  {
936  }
937 
944  virtual void DataSent ([[maybe_unused]] uint32_t size,
945  [[maybe_unused]] SocketWho who)
946  {
947  }
948 
952  virtual void FinalChecks ()
953  {
954  }
955 
961  {
962  return m_propagationDelay;
963  }
964 
970  {
971  return m_startTime;
972  }
973 
978  uint32_t GetMtu () const
979  {
980  return m_mtu;
981  }
982 
987  uint32_t GetPktSize () const
988  {
989  return m_pktSize;
990  }
991 
996  uint32_t GetPktCount () const
997  {
998  return m_pktCount;
999  }
1000 
1007  {
1008  return m_interPacketInterval;
1009  }
1010 
1013 
1014 private:
1015  // Member variables, accessible through getters
1016  // giving write access to subclass can be dangerous
1018 
1020  uint32_t m_mtu;
1021 
1022  uint32_t m_pktSize;
1023  uint32_t m_pktCount;
1025 
1028 
1029 private:
1030  // De-multiplexing callbacks.
1031 
1036  void NormalCloseCb (Ptr<Socket> socket);
1041  void ErrorCloseCb (Ptr<Socket> socket);
1047  void QueueDropCb (std::string context, Ptr<const Packet> p);
1053  void PhyDropCb (std::string context, Ptr<const Packet> p);
1060  void RcvAckCb (Ptr<const Packet> p, const TcpHeader& h,
1068  void ProcessedAckCb (Ptr<const Packet> p, const TcpHeader& h,
1076  void TxPacketCb (const Ptr<const Packet> p, const TcpHeader& h,
1077  const Ptr<const TcpSocketBase> tcp);
1084  void RxPacketCb (const Ptr<const Packet> p, const TcpHeader& h,
1085  const Ptr<const TcpSocketBase> tcp);
1092  const Ptr<const TcpSocketBase> tcp);
1101  uint32_t sz, bool isRetransmission);
1102 
1109  const Ptr<const TcpSocketBase> tcp);
1110 
1117  const Ptr<const TcpSocketBase> tcp);
1118 
1124  void DataSentCb (Ptr<Socket> socket, uint32_t size);
1129  void ForkCb (Ptr<TcpSocketMsgBase> tcp);
1135  void HandleAccept (Ptr<Socket> socket, const Address& from);
1136 
1138 };
1139 
1149 static inline TcpSocketState::TcpCongState_t
1151 {
1152  return tcb->m_congState.Get ();
1153 }
1154 
1155 } // namespace ns3
1156 
1157 #endif // TCPGENERALTEST_H
1158 
a polymophic address class
Definition: address.h:91
Callback template class.
Definition: callback.h:1279
An identifier for simulation events.
Definition: event-id.h:54
an Inet address class
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
General infrastructure for TCP testing.
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.
Ptr< TcpSocketMsgBase > GetReceiverSocket()
Get the pointer to a previously created receiver socket.
uint32_t GetPktCount() const
Get the number of application packets.
void ErrorCloseCb(Ptr< Socket > socket)
Error Close Callback.
virtual void ErrorClose([[maybe_unused]] SocketWho who)
Socket closed with an error.
virtual void RcvAck([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who)
Received ack.
virtual void QueueDrop([[maybe_unused]] SocketWho who)
Drop on the queue.
virtual void CWndTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Tracks the congestion window changes.
TypeId m_recoveryTypeId
Recovery.
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 ProcessedAck([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] const TcpHeader &h, [[maybe_unused]] SocketWho who)
Processed ack.
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.
virtual void RateSampleUpdatedTrace([[maybe_unused]] const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
@ RECEIVER
Receiver node.
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.
virtual void HighestTxSeqTrace([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue)
Highest tx seq changes.
virtual void UpdatedRttHistory([[maybe_unused]] const SequenceNumber32 &seq, [[maybe_unused]] uint32_t sz, [[maybe_unused]] bool isRetransmission, [[maybe_unused]] SocketWho who)
Updated the Rtt history.
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.
uint32_t m_mtu
MTU of the environment.
virtual void RttTrace([[maybe_unused]] Time oldTime, [[maybe_unused]] Time newTime)
Rtt changes.
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
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.
virtual void ConfigureProperties(void)
Change the configuration of the socket properties.
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 void BytesInFlightTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Bytes in flight changes.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
Time GetPktInterval() const
Get the interval to wait for each packet sent down from application to TCP.
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.
virtual void NextTxSeqTrace([[maybe_unused]] SequenceNumber32 oldValue, [[maybe_unused]] SequenceNumber32 newValue)
Next tx seq changes.
virtual void DoRun(void)
Execute the tcp test.
virtual Ptr< SimpleChannel > CreateChannel()
Create and return the channel installed between the two socket.
virtual void DataSent([[maybe_unused]] uint32_t size, [[maybe_unused]] SocketWho who)
Notifying application for sent data.
Time GetDelAckTimeout(SocketWho who)
Get the timeout of delayed ack (if present)
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
Time GetPropagationDelay() const
Get the channel Propagation Delay.
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.
TypeId m_congControlTypeId
Congestion control.
virtual void ReceivePacket(Ptr< Socket > socket)
Packet received.
void DataSentCb(Ptr< Socket > socket, uint32_t size)
Data sent Callback.
Time GetStartTime() const
Get the data start time.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
virtual void PhyDrop([[maybe_unused]] SocketWho who)
Link drop.
void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Send packets to other endpoint.
virtual void NormalClose([[maybe_unused]] SocketWho who)
Socket closed normally.
virtual void SsThreshTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Slow start threshold changes.
uint32_t GetMtu() const
Get the MTU of the environment.
void NormalCloseCb(Ptr< Socket > socket)
Normal Close Callback.
virtual void ConfigureEnvironment(void)
Change the configuration of the environment.
Time m_propagationDelay
Propagation delay of the channel.
void RcvAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
Receive ACK Callback.
TcpSocket::TcpStates_t GetTcpState(SocketWho who)
Get the state of the TCP state machine.
void RtoExpiredCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
RTO expired Callback.
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 CongStateTrace([[maybe_unused]] const TcpSocketState::TcpCongState_t oldValue, [[maybe_unused]] const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
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 BeforeRTOExpired([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who)
Rto has expired.
virtual void DoTeardown(void)
Teardown the TCP test.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
virtual void RateUpdatedTrace([[maybe_unused]] const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
void SetPacingStatus(SocketWho who, bool pacing)
Enable or disable pacing in the TCP socket.
Ptr< TcpSocketMsgBase > m_receiverSocket
Pointer to receiver socket.
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
uint32_t GetInitialCwnd(SocketWho who)
Get the initial congestion window.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
void UpdateRttHistoryCb(Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update RTT with new data.
uint32_t GetPktSize() const
Get the application packet size.
virtual void RtoTrace([[maybe_unused]] Time oldValue, [[maybe_unused]] Time newValue)
RTO changes.
void ProcessedAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
ACK processed Callback.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
virtual void CWndInflTrace([[maybe_unused]] uint32_t oldValue, [[maybe_unused]] uint32_t newValue)
Tracks the inflated congestion window changes.
InetSocketAddress m_remoteAddr
Remote peer address.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
virtual void AfterRTOExpired([[maybe_unused]] const Ptr< const TcpSocketState > tcb, [[maybe_unused]] SocketWho who)
Rto has expired.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:45
A base class for implementation of a stream socket using TCP.
Class for inserting callbacks special points of the flow of TCP sockets.
UpdateRttCallback m_updateRttCb
Update RTT callback.
virtual void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update the RTT history, when we send TCP segments.
AckManagementCb m_processedAckCb
Processed ACK callback.
virtual void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Complete a connection by forking the socket.
void SetAfterRetransmitCb(RetrCb cb)
Set the callback invoked after the processing of a retransmit timeout.
Callback< void, Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > AckManagementCb
Callback for the ACK management.
void SetForkCb(Callback< void, Ptr< TcpSocketMsgBase > > cb)
Set the callback invoked after the forking.
Callback< void, Ptr< const TcpSocketState >, Ptr< const TcpSocketBase > > RetrCb
Callback for the packet retransmission management.
TcpSocketMsgBase(const TcpSocketMsgBase &other)
Constructor.
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.
virtual Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
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.
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received an ACK packet.
Callback< void, Ptr< const TcpSocketBase >, const SequenceNumber32 &, uint32_t, bool > UpdateRttCallback
Callback for the RTT update management.
RetrCb m_beforeRetrCallback
Before retransmission callback.
Callback< void, Ptr< TcpSocketMsgBase > > m_forkCb
Fork callback.
RetrCb m_afterRetrCallback
After retransmission callback.
static TypeId GetTypeId(void)
Get the type ID.
virtual void ReTxTimeout(void)
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(void)
Get the type ID.
SequenceNumber32 m_lastAckedSeq
Last sequence number ACKed.
uint32_t m_bytesToAck
Number of bytes to be ACKed.
Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
virtual void SendEmptyPacket(uint8_t flags)
Send a empty packet that carries a flag, e.g., ACK.
TcpSocketSmallAcks(const TcpSocketSmallAcks &other)
Constructor.
uint32_t m_bytesLeftToBeAcked
Number of bytes to be ACKed left.
void SetBytesToAck(uint32_t bytes)
Set the bytes to be ACKed.
UseEcn_t
Parameter value related to ECN enable/disable functionality similar to sysctl for tcp_ecn.
TcpCongState_t
Definition of the Congestion state machine.
encapsulates test code
Definition: test.h:994
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
uint32_t segmentSize
TcpStates_t
Names of the 11 TCP states.
Definition: tcp-socket.h:65
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Information about the connection rate.
Definition: tcp-rate-ops.h:163
Rate Sample structure.
Definition: tcp-rate-ops.h:134
double startTime
uint32_t pktSize
packet size used for the simulation (in bytes)
Definition: wifi-bianchi.cc:89