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#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 Peering Management & HWM Protocol regression test
21 * Initiate scenario with 2 stations. Procedure of opening peer link
22 * is the following:
23 * \verbatim
24 * server client
25 * <-----------|-----------> Broadcast frame
26 * |----------->| Unicast frame
27 *
28 * !!! PMP routines:
29 * <-----------|----------->| Beacon
30 * |----------->| Peer Link Open frame
31 * |<-----------| Peer Link Confirm frame
32 * |<-----------| Peer Link Open frame
33 * |----------->| Peer Link Confirm frame
34 * |............| !!! Data started:
35 * |<-----------|-----------> ARP Request (time 2)
36 * <-----------|----------->| PREQ
37 * |<-----------| PREP
38 * |----------->| ARP reply
39 * <-----------|----------->| ARP Request (reflooded after delay)
40 * |<-----------| Data (first UDP datagram)
41 * <-----------|----------->| ARP Request
42 * |<-----------| ARP reply
43 * |----------->| Data
44 * |<-----------|-----------> ARP Request (reflooded after delay)
45 * |............| Some other beacons
46 * |<-----------| Data
47 * |----------->| Data
48 * |............| !!! Route expiration routines:
49 * |............| !!! (after time 7)
50 * |<-----------|-----------> PREQ (route expired)
51 * |----------->| PREP
52 * |<-----------| Data
53 * |----------->| Data
54 * |............|
55 * \endverbatim
56 * At 10 seconds stations become unreachable, so UDP client tries to
57 * close peer link due to TX-fail, and UDP server tries to close peer link
58 * due to beacon loss
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
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};
Peering Management & HWM Protocol regression test Initiate scenario with 2 stations.
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.
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.