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#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
15using 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
63{
64 public:
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
75 /// Simulation time
78
79 /// Create nodes function
80 void CreateNodes();
81 /// Create devices function
82 void CreateDevices();
83 /// Install application function
85 /// Reset position function
87
88 /// Server-side socket
90 /// Server-side socket
92 /// Client-side socket
94 /// Client-side socket
96 /// Client-side socket
98
99 /// sent packets counter A
101 /// sent packets counter B
103 /// sent packets counter C
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};
This is a test for intermediate reply and saving routing information about neighbour.
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.
encapsulates test code
Definition test.h:1050
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Every class exported by the ns3 library is enclosed in the ns3 namespace.