A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
hwmp-reactive-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#include "ns3/ipv4-interface-container.h"
9#include "ns3/node-container.h"
10#include "ns3/nstime.h"
11#include "ns3/pcap-file.h"
12#include "ns3/test.h"
13
14using namespace ns3;
15
16/**
17 * \ingroup dot11s-test
18 *
19 * \brief test for multihop path establishing and path error
20 * procedures
21 * Initiate scenario with 6 stations. Procedure of opening peer link
22 * is the following: (PMP routines are not shown)
23 * \verbatim
24 * 0 1 2 3 4 5
25 * | | | | |<---|---> ARP request (2.002s)
26 * |....|....|....|....|....| ARP requests (continued)
27 * |<---|--->| | | | ARP request
28 * <---|--->| | | | | PREQ } This order is broken
29 * <---|--->| | | | | ARP request} due to BroadcastDca
30 * |<---|--->| | | | PREQ 2.00468s)
31 * |....|....|....|....|....| ARP request
32 * | | | |<---|--->| PREQ (2.00621s)
33 * | | | | |<---| PREP
34 * |....|....|....|....|....| PREP (continued)
35 * |<---| | | | | PREP (2.00808s)
36 * |--->| | | | | ARP reply (2.0084s)
37 * |....|....|....|....|....| ARP replies
38 * | | | | |--->| ARP reply (2.01049s)
39 * | | | | |<---| Data (2.01059s)
40 * |....|....|....|....|....| Data (continued)
41 * |<---| | | | | Data
42 * <---|--->| | | | | ARP request (2.02076s)
43 * |....|....|....|....|....| ARP requests (continued)
44 * | | | | |<---|---> ARP request
45 * | | | | |<---| ARP reply (2.02281s)
46 * |....|....|....|....|....| ARP replies (continued)
47 * |<---| | | | | ARP reply
48 * |--->| | | | | Data
49 * At 5s, station number 3 disappears, and PERR is forwarded from 2 to 0
50 * and from 4 to 5, and station 5 starts path discovery procedure
51 * again:
52 * | |<---| |--->| PERR (one due to beacon loss and one due to TX error)
53 * |<---| | | | PERR
54 * | | | |<---|---> PREQ
55 * | | | <---|--->| PREQ
56 * |....|....|.........|....| Repeated attempts of PREQ
57 * \endverbatim
58 */
59
61{
62 public:
65
66 void DoRun() override;
67 /// Check results function
68 void CheckResults();
69
70 private:
71 /// \internal It is important to have pointers here
73 /// Simulation time
76
77 /// Create nodes function
78 void CreateNodes();
79 /// Create devices function
80 void CreateDevices();
81 /// Install application function
83 /// Reset position function
84 void ResetPosition();
85
86 /// Server-side socket
88 /// Client-side socket
90
91 /// sent packets counter
93
94 /**
95 * Send data
96 * \param socket the sending socket
97 */
98 void SendData(Ptr<Socket> socket);
99
100 /**
101 * \brief Handle a packet reception.
102 *
103 * This function is called by lower layers.
104 *
105 * \param socket the socket the packet was received to.
106 */
107 void HandleReadServer(Ptr<Socket> socket);
108
109 /**
110 * \brief Handle a packet reception.
111 *
112 * This function is called by lower layers.
113 *
114 * \param socket the socket the packet was received to.
115 */
116 void HandleReadClient(Ptr<Socket> socket);
117};
test for multihop path establishing and path error procedures Initiate scenario with 6 stations.
void ResetPosition()
Reset position function.
void SendData(Ptr< Socket > socket)
Send data.
void CreateDevices()
Create devices function.
Ipv4InterfaceContainer m_interfaces
interfaces
void CreateNodes()
Create nodes function.
void CheckResults()
Check results function.
Ptr< Socket > m_clientSocket
Client-side socket.
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
uint32_t m_sentPktsCounter
sent packets counter
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
void DoRun() override
Implementation to actually run this TestCase.
Ptr< Socket > m_serverSocket
Server-side socket.
void InstallApplications()
Install application function.
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.