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
hwmp-simplest-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 dot11s-test
19
*
20
* \brief Peering Management & HWM Protocol regression test
21
* Initiate scenario with 2 stations. Procedure of opening peer link
22
* is the following:
23
* \verbatim
24
* server client
25
* <-----------|-----------> Broadcast frame
26
* |----------->| Unicast frame
27
*
28
* !!! PMP routines:
29
* <-----------|----------->| Beacon
30
* |----------->| Peer Link Open frame
31
* |<-----------| Peer Link Confirm frame
32
* |<-----------| Peer Link Open frame
33
* |----------->| Peer Link Confirm frame
34
* |............| !!! Data started:
35
* |<-----------|-----------> ARP Request (time 2)
36
* <-----------|----------->| PREQ
37
* |<-----------| PREP
38
* |----------->| ARP reply
39
* <-----------|----------->| ARP Request (reflooded after delay)
40
* |<-----------| Data (first UDP datagram)
41
* <-----------|----------->| ARP Request
42
* |<-----------| ARP reply
43
* |----------->| Data
44
* |<-----------|-----------> ARP Request (reflooded after delay)
45
* |............| Some other beacons
46
* |<-----------| Data
47
* |----------->| Data
48
* |............| !!! Route expiration routines:
49
* |............| !!! (after time 7)
50
* |<-----------|-----------> PREQ (route expired)
51
* |----------->| PREP
52
* |<-----------| Data
53
* |----------->| Data
54
* |............|
55
* \endverbatim
56
* At 10 seconds stations become unreachable, so UDP client tries to
57
* close peer link due to TX-fail, and UDP server tries to close peer link
58
* due to beacon loss
59
*/
60
class
HwmpSimplestRegressionTest
:
public
TestCase
61
{
62
public
:
63
HwmpSimplestRegressionTest
();
64
~HwmpSimplestRegressionTest
()
override
;
65
66
void
DoRun
()
override
;
67
/// Check results function
68
void
CheckResults
();
69
70
private
:
71
/// \internal It is important to have pointers here
72
NodeContainer
*
m_nodes
;
73
/// Simulation time
74
Time
m_time
;
75
Ipv4InterfaceContainer
m_interfaces
;
///< interfaces
76
77
/// Create nodes function
78
void
CreateNodes
();
79
/// Create devices function
80
void
CreateDevices
();
81
/// Install application function
82
void
InstallApplications
();
83
/// Reset position
84
void
ResetPosition
();
85
86
/// Server-side socket
87
Ptr<Socket>
m_serverSocket
;
88
/// Client-side socket
89
Ptr<Socket>
m_clientSocket
;
90
91
/// sent packets counter
92
uint32_t
m_sentPktsCounter
;
93
94
/**
95
* Send data
96
* \param socket the sending socket
97
*/
98
void
SendData
(
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
HandleReadServer
(
Ptr<Socket>
socket);
108
109
/**
110
* \brief Handle a packet reception.
111
*
112
* This function is called by lower layers.
113
*
114
* \param socket the socket the packet was received to.
115
*/
116
void
HandleReadClient
(
Ptr<Socket>
socket);
117
};
HwmpSimplestRegressionTest
Peering Management & HWM Protocol regression test Initiate scenario with 2 stations.
Definition
hwmp-simplest-regression.h:61
HwmpSimplestRegressionTest::m_nodes
NodeContainer * m_nodes
Definition
hwmp-simplest-regression.h:72
HwmpSimplestRegressionTest::HandleReadClient
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
Definition
hwmp-simplest-regression.cc:196
HwmpSimplestRegressionTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
hwmp-simplest-regression.cc:47
HwmpSimplestRegressionTest::m_interfaces
Ipv4InterfaceContainer m_interfaces
interfaces
Definition
hwmp-simplest-regression.h:75
HwmpSimplestRegressionTest::ResetPosition
void ResetPosition()
Reset position.
Definition
hwmp-simplest-regression.cc:89
HwmpSimplestRegressionTest::CheckResults
void CheckResults()
Check results function.
Definition
hwmp-simplest-regression.cc:158
HwmpSimplestRegressionTest::HandleReadServer
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
Definition
hwmp-simplest-regression.cc:182
HwmpSimplestRegressionTest::~HwmpSimplestRegressionTest
~HwmpSimplestRegressionTest() override
Definition
hwmp-simplest-regression.cc:41
HwmpSimplestRegressionTest::CreateDevices
void CreateDevices()
Create devices function.
Definition
hwmp-simplest-regression.cc:125
HwmpSimplestRegressionTest::m_time
Time m_time
Simulation time.
Definition
hwmp-simplest-regression.h:74
HwmpSimplestRegressionTest::m_serverSocket
Ptr< Socket > m_serverSocket
Server-side socket.
Definition
hwmp-simplest-regression.h:87
HwmpSimplestRegressionTest::CreateNodes
void CreateNodes()
Create nodes function.
Definition
hwmp-simplest-regression.cc:65
HwmpSimplestRegressionTest::InstallApplications
void InstallApplications()
Install application function.
Definition
hwmp-simplest-regression.cc:101
HwmpSimplestRegressionTest::SendData
void SendData(Ptr< Socket > socket)
Send data.
Definition
hwmp-simplest-regression.cc:167
HwmpSimplestRegressionTest::m_sentPktsCounter
uint32_t m_sentPktsCounter
sent packets counter
Definition
hwmp-simplest-regression.h:92
HwmpSimplestRegressionTest::m_clientSocket
Ptr< Socket > m_clientSocket
Client-side socket.
Definition
hwmp-simplest-regression.h:89
HwmpSimplestRegressionTest::HwmpSimplestRegressionTest
HwmpSimplestRegressionTest()
Definition
hwmp-simplest-regression.cc:33
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
dot11s
hwmp-simplest-regression.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0