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-target-flags-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_TARGET_FLAGS_REGRESSION_H
10
#define HWMP_TARGET_FLAGS_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 This is a test for intermediate reply and saving routing
24
* information about neighbour. 4 stations and 3 UDP ping streams are initiated.
25
*/
26
// clang-format off
27
/**
28
* \verbatim
29
<-----------|-----------> Broadcast frame
30
|----------->| Unicast frame
31
(Node ID) 0 1 2 3
32
(MAC addr) 10 11 12 13
33
| |<-----------|----------->| ARP request (12 asks who has 10)
34
| | |<-----------|-----------> ARP request
35
|<-----------|----------->| | ARP request
36
<-----------|----------->| | | PREQ
37
|<-----------|----------->| | PREQ
38
| |<-----------| | PREP
39
|<-----------| | | PREP
40
|----------->| | | ARP reply
41
| |----------->| | ARP REPLY
42
| |<-----------| | Data
43
|............|............|............|
44
|<-----------|----------->| | ARP request (11 asks who has 10)
45
|............|............|............|
46
|----------->| | | ARP reply
47
^ Note, that this arp reply goes without route
48
discovery procedure, because route is known from
49
previous PREQ/PREP exchange
50
|<-----------| | | DATA
51
|............|............|............|
52
<-----------|----------->| | | ARP request (10 asks who has 13)
53
|............|............|............|
54
| | |<-----------|-----------> PREQ (13 asks about 10) DO=0 RF=1
55
| | |----------->| PREP (intermediate reply - 12 knows about 10)
56
| |<-----------|----------->| PREQ DO=1 RF=0
57
|............|............|............|
58
|----------->| | | PREP
59
| |----------->| | PREP
60
| | |----------->| PREP
61
\endverbatim
62
*/
63
// clang-format on
64
65
class
HwmpDoRfRegressionTest
:
public
TestCase
66
{
67
public
:
68
HwmpDoRfRegressionTest
();
69
~HwmpDoRfRegressionTest
()
override
;
70
71
void
DoRun
()
override
;
72
/// Check results function
73
void
CheckResults
();
74
75
private
:
76
/// @internal It is important to have pointers here
77
NodeContainer
*
m_nodes
;
78
/// Simulation time
79
Time
m_time
;
80
Ipv4InterfaceContainer
m_interfaces
;
///< interfaces
81
82
/// Create nodes function
83
void
CreateNodes
();
84
/// Create devices function
85
void
CreateDevices
();
86
/// Install application function
87
void
InstallApplications
();
88
/// Reset position function
89
void
ResetPosition
();
90
91
/// Server-side socket
92
Ptr<Socket>
m_serverSocketA
;
93
/// Server-side socket
94
Ptr<Socket>
m_serverSocketB
;
95
/// Client-side socket
96
Ptr<Socket>
m_clientSocketA
;
97
/// Client-side socket
98
Ptr<Socket>
m_clientSocketB
;
99
/// Client-side socket
100
Ptr<Socket>
m_clientSocketC
;
101
102
/// sent packets counter A
103
uint32_t
m_sentPktsCounterA
;
104
/// sent packets counter B
105
uint32_t
m_sentPktsCounterB
;
106
/// sent packets counter C
107
uint32_t
m_sentPktsCounterC
;
108
109
/**
110
* Send data A
111
* @param socket the sending socket
112
*/
113
void
SendDataA
(
Ptr<Socket>
socket);
114
115
/**
116
* Send data B
117
* @param socket the sending socket
118
*/
119
void
SendDataB
(
Ptr<Socket>
socket);
120
121
/**
122
* Send data C
123
* @param socket the sending socket
124
*/
125
void
SendDataC
(
Ptr<Socket>
socket);
126
127
/**
128
* @brief Handle a packet reception.
129
*
130
* This function is called by lower layers.
131
*
132
* @param socket the socket the packet was received to.
133
*/
134
void
HandleReadServer
(
Ptr<Socket>
socket);
135
136
/**
137
* @brief Handle a packet reception.
138
*
139
* This function is called by lower layers.
140
*
141
* @param socket the socket the packet was received to.
142
*/
143
void
HandleReadClient
(
Ptr<Socket>
socket);
144
};
145
146
#endif
// HWMP_TARGET_FLAGS_REGRESSION_H
HwmpDoRfRegressionTest::ResetPosition
void ResetPosition()
Reset position function.
HwmpDoRfRegressionTest::SendDataA
void SendDataA(Ptr< Socket > socket)
Send data A.
Definition
hwmp-target-flags-regression.cc:189
HwmpDoRfRegressionTest::m_time
Time m_time
Simulation time.
Definition
hwmp-target-flags-regression.h:79
HwmpDoRfRegressionTest::HandleReadClient
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
Definition
hwmp-target-flags-regression.cc:248
HwmpDoRfRegressionTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
hwmp-target-flags-regression.cc:50
HwmpDoRfRegressionTest::~HwmpDoRfRegressionTest
~HwmpDoRfRegressionTest() override
Definition
hwmp-target-flags-regression.cc:44
HwmpDoRfRegressionTest::m_serverSocketA
Ptr< Socket > m_serverSocketA
Server-side socket.
Definition
hwmp-target-flags-regression.h:92
HwmpDoRfRegressionTest::CreateDevices
void CreateDevices()
Create devices function.
Definition
hwmp-target-flags-regression.cc:143
HwmpDoRfRegressionTest::SendDataC
void SendDataC(Ptr< Socket > socket)
Send data C.
Definition
hwmp-target-flags-regression.cc:219
HwmpDoRfRegressionTest::m_sentPktsCounterA
uint32_t m_sentPktsCounterA
sent packets counter A
Definition
hwmp-target-flags-regression.h:103
HwmpDoRfRegressionTest::CheckResults
void CheckResults()
Check results function.
Definition
hwmp-target-flags-regression.cc:180
HwmpDoRfRegressionTest::m_nodes
NodeContainer * m_nodes
Definition
hwmp-target-flags-regression.h:77
HwmpDoRfRegressionTest::m_serverSocketB
Ptr< Socket > m_serverSocketB
Server-side socket.
Definition
hwmp-target-flags-regression.h:94
HwmpDoRfRegressionTest::SendDataB
void SendDataB(Ptr< Socket > socket)
Send data B.
Definition
hwmp-target-flags-regression.cc:204
HwmpDoRfRegressionTest::m_sentPktsCounterC
uint32_t m_sentPktsCounterC
sent packets counter C
Definition
hwmp-target-flags-regression.h:107
HwmpDoRfRegressionTest::m_clientSocketA
Ptr< Socket > m_clientSocketA
Client-side socket.
Definition
hwmp-target-flags-regression.h:96
HwmpDoRfRegressionTest::HandleReadServer
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
Definition
hwmp-target-flags-regression.cc:234
HwmpDoRfRegressionTest::InstallApplications
void InstallApplications()
Install application function.
Definition
hwmp-target-flags-regression.cc:91
HwmpDoRfRegressionTest::m_interfaces
Ipv4InterfaceContainer m_interfaces
interfaces
Definition
hwmp-target-flags-regression.h:80
HwmpDoRfRegressionTest::HwmpDoRfRegressionTest
HwmpDoRfRegressionTest()
Definition
hwmp-target-flags-regression.cc:34
HwmpDoRfRegressionTest::CreateNodes
void CreateNodes()
Create nodes function.
Definition
hwmp-target-flags-regression.cc:68
HwmpDoRfRegressionTest::m_sentPktsCounterB
uint32_t m_sentPktsCounterB
sent packets counter B
Definition
hwmp-target-flags-regression.h:105
HwmpDoRfRegressionTest::m_clientSocketC
Ptr< Socket > m_clientSocketC
Client-side socket.
Definition
hwmp-target-flags-regression.h:100
HwmpDoRfRegressionTest::m_clientSocketB
Ptr< Socket > m_clientSocketB
Client-side socket.
Definition
hwmp-target-flags-regression.h:98
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-target-flags-regression.h
Generated on
for ns-3 by
1.15.0