A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
15
using 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
*/
52
class
FlameRegressionTest
:
public
TestCase
53
{
54
public
:
55
FlameRegressionTest
();
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
64
NodeContainer
*
m_nodes
;
65
/// Simulation time
66
Time
m_time
;
67
/// Needed to install applications
68
Ipv4InterfaceContainer
m_interfaces
;
69
70
/// Create nodes function
71
void
CreateNodes
();
72
/// Create devices function
73
void
CreateDevices
();
74
/// Install application function
75
void
InstallApplications
();
76
77
/// Server-side socket
78
Ptr<Socket>
m_serverSocket
;
79
/// Client-side socket
80
Ptr<Socket>
m_clientSocket
;
81
82
/// sent packets counter
83
uint32_t
m_sentPktsCounter
;
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
};
FlameRegressionTest
FLAME protocol regression test of three stations:
Definition
flame-regression.h:53
FlameRegressionTest::m_time
Time m_time
Simulation time.
Definition
flame-regression.h:66
FlameRegressionTest::~FlameRegressionTest
~FlameRegressionTest() override
Definition
flame-regression.cc:40
FlameRegressionTest::FlameRegressionTest
FlameRegressionTest()
Definition
flame-regression.cc:32
FlameRegressionTest::CheckResults
void CheckResults()
Check results function.
Definition
flame-regression.cc:150
FlameRegressionTest::InstallApplications
void InstallApplications()
Install application function.
Definition
flame-regression.cc:128
FlameRegressionTest::CreateNodes
void CreateNodes()
Create nodes function.
Definition
flame-regression.cc:64
FlameRegressionTest::m_clientSocket
Ptr< Socket > m_clientSocket
Client-side socket.
Definition
flame-regression.h:80
FlameRegressionTest::m_nodes
NodeContainer * m_nodes
Definition
flame-regression.h:64
FlameRegressionTest::SendData
void SendData(Ptr< Socket > socket)
Send data.
Definition
flame-regression.cc:159
FlameRegressionTest::m_serverSocket
Ptr< Socket > m_serverSocket
Server-side socket.
Definition
flame-regression.h:78
FlameRegressionTest::HandleReadClient
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
Definition
flame-regression.cc:188
FlameRegressionTest::HandleReadServer
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
Definition
flame-regression.cc:174
FlameRegressionTest::m_interfaces
Ipv4InterfaceContainer m_interfaces
Needed to install applications.
Definition
flame-regression.h:68
FlameRegressionTest::CreateDevices
void CreateDevices()
Create devices function.
Definition
flame-regression.cc:87
FlameRegressionTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
flame-regression.cc:46
FlameRegressionTest::m_sentPktsCounter
uint32_t m_sentPktsCounter
sent packets counter
Definition
flame-regression.h:83
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition
ipv4-interface-container.h:45
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TestCase
encapsulates test code
Definition
test.h:1050
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
test
flame
flame-regression.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0