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#ifndef FLAME_REGRESSION_H
10#define FLAME_REGRESSION_H
11
12#include "ns3/ipv4-interface-container.h"
13#include "ns3/node-container.h"
14#include "ns3/nstime.h"
15#include "ns3/pcap-file.h"
16#include "ns3/test.h"
17
18using namespace ns3;
19
20/**
21 * @ingroup mesh-test
22 * @defgroup flame-test flame sub-module tests
23 */
24
25/**
26 * @ingroup flame-test
27 *
28 * @brief FLAME protocol regression test of three stations:
29 * @verbatim
30 * <-----------|-----------> Broadcast frame
31 * |----------->| Unicast frame
32 * Source Destination
33 * (node ID) 2 1 0
34 * <-----------|----------->| | ARP request
35 * |<-----------|----------->| ARP request
36 * | |<-----------| ARP reply
37 * |<-----------| | ARP reply
38 * |----------->| | Data
39 * | |----------->| Data
40 * | |<-----------|-----------> PATH_UPDATE (no broadcast was sent)
41 * |<-----------|----------->| PATH_UPDATE
42 * <-----------|----------->| | PATH_UPDATE
43 * | |<-----------|-----------> ARP request
44 * |<-----------|----------->| ARP request
45 * <-----------|----------->| | ARP request
46 * |----------->| | ARP reply
47 * | |----------->| ARP reply
48 * | |<-----------| Data
49 * |<-----------| | Data
50 * |............|............|
51 * After five seconds data is transmitted again as
52 * broadcast, and PATH_UPDATE is sent
53 * @endverbatim
54 */
56{
57 public:
59 ~FlameRegressionTest() override;
60
61 void DoRun() override;
62 /// Check results function
63 void CheckResults();
64
65 private:
66 /// @internal It is important to have pointers here
68 /// Simulation time
70 /// Needed to install applications
72
73 /// Create nodes function
74 void CreateNodes();
75 /// Create devices function
76 void CreateDevices();
77 /// Install application function
79
80 /// Server-side socket
82 /// Client-side socket
84
85 /// sent packets counter
87
88 /**
89 * Send data
90 * @param socket the sending socket
91 */
92 void SendData(Ptr<Socket> socket);
93
94 /**
95 * @brief Handle a packet reception.
96 *
97 * This function is called by lower layers.
98 *
99 * @param socket the socket the packet was received to.
100 */
101 void HandleReadServer(Ptr<Socket> socket);
102
103 /**
104 * @brief Handle a packet reception.
105 *
106 * This function is called by lower layers.
107 *
108 * @param socket the socket the packet was received to.
109 */
110 void HandleReadClient(Ptr<Socket> socket);
111};
112
113#endif // FLAME_REGRESSION_H
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.
Definition ptr.h:70
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:96
Every class exported by the ns3 library is enclosed in the ns3 namespace.