This documentation is not the Latest Release.
A Discrete-Event Network Simulator
API
tcp-fast-retr-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 TCPFASTRETRTEST_H
20 #define TCPFASTRETRTEST_H
21 
22 #include "tcp-general-test.h"
23 #include "ns3/simple-channel.h"
24 #include "tcp-error-model.h"
25 
26 namespace ns3 {
27 
37 {
38 public:
39  TcpFastRetrTest (TypeId congControl, uint32_t seqToKill, const std::string &msg);
40 
43 
45 
46 protected:
47  virtual void RcvAck (const Ptr<const TcpSocketState> tcb,
48  const TcpHeader& h, SocketWho who);
49  virtual void ProcessedAck (const Ptr<const TcpSocketState> tcb,
50  const TcpHeader& h, SocketWho who);
51 
52  virtual void CongStateTrace (const TcpSocketState::TcpCongState_t oldValue,
53  const TcpSocketState::TcpCongState_t newValue);
54 
55  virtual void Tx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
56  virtual void Rx (const Ptr<const Packet> p, const TcpHeader&h, SocketWho who);
57 
58  virtual void RTOExpired (const Ptr<const TcpSocketState> tcb, SocketWho who);
59 
60  void PktDropped (const Ipv4Header &ipH, const TcpHeader& tcpH);
61  void FinalChecks ();
62 
65  uint32_t m_seqToKill;
66  uint32_t m_dupAckReceived;
67 
71 
72  uint32_t m_countRetr;
73 
75 
77 };
78 
79 } // namespace ns3
80 
81 #endif // TCPFASTRETRTEST_H
void FinalChecks()
Performs the (eventual) final checks through test asserts.
SequenceNumber32 m_sndNextExpSeq
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
virtual void RTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH)
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
Packet header for IPv4.
Definition: ipv4-header.h:31
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
SequenceNumber32 m_previousAck
Test the fast retransmission.
TcpFastRetrTest(TypeId congControl, uint32_t seqToKill, const std::string &msg)
SequenceNumber32 m_rcvNextExpAck
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:44
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
General infrastructure for TCP testing.
Ptr< TcpSeqErrorModel > m_errorModel
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
a unique identifier for an interface.
Definition: type-id.h:58