A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
hwmp-simplest-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_SIMPLEST_REGRESSION_H
10#define HWMP_SIMPLEST_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 Peering Management & HWM Protocol regression test
24 * Initiate scenario with 2 stations. Procedure of opening peer link
25 * is the following:
26 * @verbatim
27 * server client
28 * <-----------|-----------> Broadcast frame
29 * |----------->| Unicast frame
30 *
31 * !!! PMP routines:
32 * <-----------|----------->| Beacon
33 * |----------->| Peer Link Open frame
34 * |<-----------| Peer Link Confirm frame
35 * |<-----------| Peer Link Open frame
36 * |----------->| Peer Link Confirm frame
37 * |............| !!! Data started:
38 * |<-----------|-----------> ARP Request (time 2)
39 * <-----------|----------->| PREQ
40 * |<-----------| PREP
41 * |----------->| ARP reply
42 * <-----------|----------->| ARP Request (reflooded after delay)
43 * |<-----------| Data (first UDP datagram)
44 * <-----------|----------->| ARP Request
45 * |<-----------| ARP reply
46 * |----------->| Data
47 * |<-----------|-----------> ARP Request (reflooded after delay)
48 * |............| Some other beacons
49 * |<-----------| Data
50 * |----------->| Data
51 * |............| !!! Route expiration routines:
52 * |............| !!! (after time 7)
53 * |<-----------|-----------> PREQ (route expired)
54 * |----------->| PREP
55 * |<-----------| Data
56 * |----------->| Data
57 * |............|
58 * @endverbatim
59 * At 10 seconds stations become unreachable, so UDP client tries to
60 * close peer link due to TX-fail, and UDP server tries to close peer link
61 * due to beacon loss
62 */
64{
65 public:
68
69 void DoRun() override;
70 /// Check results function
71 void CheckResults();
72
73 private:
74 /// @internal It is important to have pointers here
76 /// Simulation time
79
80 /// Create nodes function
81 void CreateNodes();
82 /// Create devices function
83 void CreateDevices();
84 /// Install application function
86 /// Reset position
87 void ResetPosition();
88
89 /// Server-side socket
91 /// Client-side socket
93
94 /// sent packets counter
96
97 /**
98 * Send data
99 * @param socket the sending socket
100 */
101 void SendData(Ptr<Socket> socket);
102
103 /**
104 * @brief Handle a packet reception.
105 *
106 * This function is called by lower layers.
107 *
108 * @param socket the socket the packet was received to.
109 */
110 void HandleReadServer(Ptr<Socket> socket);
111
112 /**
113 * @brief Handle a packet reception.
114 *
115 * This function is called by lower layers.
116 *
117 * @param socket the socket the packet was received to.
118 */
119 void HandleReadClient(Ptr<Socket> socket);
120};
121
122#endif // HWMP_SIMPLEST_REGRESSION_H
void HandleReadClient(Ptr< Socket > socket)
Handle a packet reception.
void DoRun() override
Implementation to actually run this TestCase.
Ipv4InterfaceContainer m_interfaces
interfaces
void CheckResults()
Check results function.
void HandleReadServer(Ptr< Socket > socket)
Handle a packet reception.
void CreateDevices()
Create devices function.
Ptr< Socket > m_serverSocket
Server-side socket.
void CreateNodes()
Create nodes function.
void InstallApplications()
Install application function.
void SendData(Ptr< Socket > socket)
Send data.
uint32_t m_sentPktsCounter
sent packets counter
Ptr< Socket > m_clientSocket
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.