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
62{
63 public:
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
74 /// Simulation time
77
78 /// Create nodes function
79 void CreateNodes();
80 /// Create devices function
81 void CreateDevices();
82 /// Install application function
84 /// Reset position function
86
87 /// Server-side socket
89 /// Server-side socket
91 /// Client-side socket
93 /// Client-side socket
95 /// Client-side socket
97
98 /// sent packets counter A
100 /// sent packets counter B
102 /// sent packets counter C
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};
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.