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
class
HwmpDoRfRegressionTest
:
public
TestCase
62
{
63
public
:
64
HwmpDoRfRegressionTest
();
65
~HwmpDoRfRegressionTest
()
override
;
66
67
void
DoRun
()
override
;
68
/// Check results function
69
void
CheckResults
();
70
71
private
:
72
/// \internal It is important to have pointers here
73
NodeContainer
*
m_nodes
;
74
/// Simulation time
75
Time
m_time
;
76
Ipv4InterfaceContainer
m_interfaces
;
///< interfaces
77
78
/// Create nodes function
79
void
CreateNodes
();
80
/// Create devices function
81
void
CreateDevices
();
82
/// Install application function
83
void
InstallApplications
();
84
/// Reset position function
85
void
ResetPosition
();
86
87
/// Server-side socket
88
Ptr<Socket>
m_serverSocketA
;
89
/// Server-side socket
90
Ptr<Socket>
m_serverSocketB
;
91
/// Client-side socket
92
Ptr<Socket>
m_clientSocketA
;
93
/// Client-side socket
94
Ptr<Socket>
m_clientSocketB
;
95
/// Client-side socket
96
Ptr<Socket>
m_clientSocketC
;
97
98
/// sent packets counter A
99
uint32_t
m_sentPktsCounterA
;
100
/// sent packets counter B
101
uint32_t
m_sentPktsCounterB
;
102
/// sent packets counter C
103
uint32_t
m_sentPktsCounterC
;
104
105
/**
106
* Send data A
107
* \param socket the sending socket
108
*/
109
void
SendDataA
(
Ptr<Socket>
socket);
110
111
/**
112
* Send data B
113
* \param socket the sending socket
114
*/
115
void
SendDataB
(
Ptr<Socket>
socket);
116
117
/**
118
* Send data C
119
* \param socket the sending socket
120
*/
121
void
SendDataC
(
Ptr<Socket>
socket);
122
123
/**
124
* \brief Handle a packet reception.
125
*
126
* This function is called by lower layers.
127
*
128
* \param socket the socket the packet was received to.
129
*/
130
void
HandleReadServer
(
Ptr<Socket>
socket);
131
132
/**
133
* \brief Handle a packet reception.
134
*
135
* This function is called by lower layers.
136
*
137
* \param socket the socket the packet was received to.
138
*/
139
void
HandleReadClient
(
Ptr<Socket>
socket);
140
};
HwmpDoRfRegressionTest
This is a test for intermediate reply and saving routing information about neighbour.
Definition
hwmp-target-flags-regression.h:62
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:75
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:88
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:99
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:73
HwmpDoRfRegressionTest::m_serverSocketB
Ptr< Socket > m_serverSocketB
Server-side socket.
Definition
hwmp-target-flags-regression.h:90
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:103
HwmpDoRfRegressionTest::m_clientSocketA
Ptr< Socket > m_clientSocketA
Client-side socket.
Definition
hwmp-target-flags-regression.h:92
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:76
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:101
HwmpDoRfRegressionTest::m_clientSocketC
Ptr< Socket > m_clientSocketC
Client-side socket.
Definition
hwmp-target-flags-regression.h:96
HwmpDoRfRegressionTest::m_clientSocketB
Ptr< Socket > m_clientSocketB
Client-side socket.
Definition
hwmp-target-flags-regression.h:94
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 Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0