A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bug-772.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Pavel Boyko <boyko@iitp.ru>
7 */
8
9#ifndef BUG_772_H
10#define BUG_772_H
11
12#include "ns3/node-container.h"
13#include "ns3/nstime.h"
14#include "ns3/socket.h"
15#include "ns3/test.h"
16
17using namespace ns3;
18
19/**
20 * @ingroup aodv
21 *
22 * @brief AODV deferred route lookup test case (see \bugid{772})
23 *
24 * UDP packet transfers are delayed while a route is found and then while
25 * ARP completes. Eight packets should be sent, queued until the path
26 * becomes functional, and then delivered.
27 */
29{
30 public:
31 /**
32 * Create test case
33 *
34 * @param prefix Unique file names prefix
35 * @param proto ns3::UdpSocketFactory or ns3::TcpSocketFactory
36 * @param size Number of nodes in the chain
37 * @param time Simulation time
38 */
39 Bug772ChainTest(const char* const prefix, const char* const proto, Time time, uint32_t size);
40 ~Bug772ChainTest() override;
41
42 private:
43 /// @internal It is important to have pointers here
45
46 /// PCAP file names prefix
47 const std::string m_prefix;
48 /// Socket factory TID
49 const std::string m_proto;
50 /// Total simulation time
51 const Time m_time;
52 /// Chain size
54 /// Chain step, meters
55 const double m_step;
56 /// port number
57 const uint16_t m_port;
58
59 /// Create test topology
60 void CreateNodes();
61 /// Create devices, install TCP/IP stack and applications
62 void CreateDevices();
63 /// Compare traces with reference ones
64 void CheckResults();
65 /// Go
66 void DoRun() override;
67 /**
68 * Receive data function
69 * @param socket the socket to receive from
70 */
71 void HandleRead(Ptr<Socket> socket);
72
73 /// Receiving socket
75 /// Transmitting socket
77
78 /// Received packet count
80
81 /**
82 * Send data
83 * @param socket the sending socket
84 */
85 void SendData(Ptr<Socket> socket);
86};
87
88#endif /* BUG_772_H */
AODV deferred route lookup test case (see Bug 772 )
Definition bug-772.h:29
const std::string m_proto
Socket factory TID.
Definition bug-772.h:49
Bug772ChainTest(const char *const prefix, const char *const proto, Time time, uint32_t size)
Create test case.
Definition bug-772.cc:38
void HandleRead(Ptr< Socket > socket)
Receive data function.
Definition bug-772.cc:74
const uint16_t m_port
port number
Definition bug-772.h:57
void DoRun() override
Go.
Definition bug-772.cc:80
Ptr< Socket > m_recvSocket
Receiving socket.
Definition bug-772.h:74
NodeContainer * m_nodes
Definition bug-772.h:44
const uint32_t m_size
Chain size.
Definition bug-772.h:53
~Bug772ChainTest() override
Definition bug-772.cc:54
const std::string m_prefix
PCAP file names prefix.
Definition bug-772.h:47
void CreateNodes()
Create test topology.
Definition bug-772.cc:101
const double m_step
Chain step, meters.
Definition bug-772.h:55
void CreateDevices()
Create devices, install TCP/IP stack and applications.
Definition bug-772.cc:124
void SendData(Ptr< Socket > socket)
Send data.
Definition bug-772.cc:60
Ptr< Socket > m_sendSocket
Transmitting socket.
Definition bug-772.h:76
const Time m_time
Total simulation time.
Definition bug-772.h:51
void CheckResults()
Compare traces with reference ones.
Definition bug-772.cc:198
uint32_t m_receivedPackets
Received packet count.
Definition bug-772.h:79
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.