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