A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
flame-regression.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 */
8
9#include "ns3/ipv4-interface-container.h"
10#include "ns3/node-container.h"
11#include "ns3/nstime.h"
12#include "ns3/pcap-file.h"
13#include "ns3/test.h"
14
15using namespace ns3;
16
17/**
18 * \ingroup mesh-test
19 * \defgroup flame-test flame sub-module tests
20 */
21
22/**
23 * \ingroup flame-test
24 *
25 * \brief FLAME protocol regression test of three stations:
26 * \verbatim
27 * <-----------|-----------> Broadcast frame
28 * |----------->| Unicast frame
29 * Source Destination
30 * (node ID) 2 1 0
31 * <-----------|----------->| | ARP request
32 * |<-----------|----------->| ARP request
33 * | |<-----------| ARP reply
34 * |<-----------| | ARP reply
35 * |----------->| | Data
36 * | |----------->| Data
37 * | |<-----------|-----------> PATH_UPDATE (no broadcast was sent)
38 * |<-----------|----------->| PATH_UPDATE
39 * <-----------|----------->| | PATH_UPDATE
40 * | |<-----------|-----------> ARP request
41 * |<-----------|----------->| ARP request
42 * <-----------|----------->| | ARP request
43 * |----------->| | ARP reply
44 * | |----------->| ARP reply
45 * | |<-----------| Data
46 * |<-----------| | Data
47 * |............|............|
48 * After five seconds data is transmitted again as
49 * broadcast, and PATH_UPDATE is sent
50 * \endverbatim
51 */
53{
54 public:
56 ~FlameRegressionTest() override;
57
58 void DoRun() override;
59 /// Check results function
60 void CheckResults();
61
62 private:
63 /// \internal It is important to have pointers here
65 /// Simulation time
67 /// Needed to install applications
69
70 /// Create nodes function
71 void CreateNodes();
72 /// Create devices function
73 void CreateDevices();
74 /// Install application function
76
77 /// Server-side socket
79 /// Client-side socket
81
82 /// sent packets counter
84
85 /**
86 * Send data
87 * \param socket the sending socket
88 */
89 void SendData(Ptr<Socket> socket);
90
91 /**
92 * \brief Handle a packet reception.
93 *
94 * This function is called by lower layers.
95 *
96 * \param socket the socket the packet was received to.
97 */
98 void HandleReadServer(Ptr<Socket> socket);
99
100 /**
101 * \brief Handle a packet reception.
102 *
103 * This function is called by lower layers.
104 *
105 * \param socket the socket the packet was received to.
106 */
107 void HandleReadClient(Ptr<Socket> socket);
108};
FLAME protocol regression test of three stations:
Time m_time
Simulation time.
~FlameRegressionTest() override
void CheckResults()
Check results function.
void InstallApplications()
Install application function.
void CreateNodes()
Create nodes function.
Ptr< Socket > m_clientSocket
Client-side socket.
NodeContainer * m_nodes
void SendData(Ptr< Socket > socket)
Send data.
Ptr< Socket > m_serverSocket
Server-side socket.
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
Ipv4InterfaceContainer m_interfaces
Needed to install applications.
void CreateDevices()
Create devices function.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_sentPktsCounter
sent packets counter
holds a vector of std::pair of Ptr<Ipv4> and interface index.
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Every class exported by the ns3 library is enclosed in the ns3 namespace.