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