A Discrete-Event Network Simulator
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
18using 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
66{
67 public:
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
78 /// Simulation time
81
82 /// Create nodes function
83 void CreateNodes();
84 /// Create devices function
85 void CreateDevices();
86 /// Install application function
88 /// Reset position function
90
91 /// Server-side socket
93 /// Server-side socket
95 /// Client-side socket
97 /// Client-side socket
99 /// Client-side socket
101
102 /// sent packets counter A
104 /// sent packets counter B
106 /// sent packets counter C
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
void ResetPosition()
Reset position function.
void SendDataA(Ptr< Socket > socket)
Send data A.
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
void DoRun() override
Implementation to actually run this TestCase.
Ptr< Socket > m_serverSocketA
Server-side socket.
void CreateDevices()
Create devices function.
void SendDataC(Ptr< Socket > socket)
Send data C.
uint32_t m_sentPktsCounterA
sent packets counter A
void CheckResults()
Check results function.
Ptr< Socket > m_serverSocketB
Server-side socket.
void SendDataB(Ptr< Socket > socket)
Send data B.
uint32_t m_sentPktsCounterC
sent packets counter C
Ptr< Socket > m_clientSocketA
Client-side socket.
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
void InstallApplications()
Install application function.
Ipv4InterfaceContainer m_interfaces
interfaces
void CreateNodes()
Create nodes function.
uint32_t m_sentPktsCounterB
sent packets counter B
Ptr< Socket > m_clientSocketC
Client-side socket.
Ptr< Socket > m_clientSocketB
Client-side socket.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:96
Every class exported by the ns3 library is enclosed in the ns3 namespace.