A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
17
using 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
*/
28
class
Bug772ChainTest
:
public
TestCase
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
44
NodeContainer
*
m_nodes
;
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
53
const
uint32_t
m_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
74
Ptr<Socket>
m_recvSocket
;
75
/// Transmitting socket
76
Ptr<Socket>
m_sendSocket
;
77
78
/// Received packet count
79
uint32_t
m_receivedPackets
;
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 */
Bug772ChainTest
AODV deferred route lookup test case (see Bug 772 )
Definition
bug-772.h:29
Bug772ChainTest::m_proto
const std::string m_proto
Socket factory TID.
Definition
bug-772.h:49
Bug772ChainTest::Bug772ChainTest
Bug772ChainTest(const char *const prefix, const char *const proto, Time time, uint32_t size)
Create test case.
Definition
bug-772.cc:38
Bug772ChainTest::HandleRead
void HandleRead(Ptr< Socket > socket)
Receive data function.
Definition
bug-772.cc:74
Bug772ChainTest::m_port
const uint16_t m_port
port number
Definition
bug-772.h:57
Bug772ChainTest::DoRun
void DoRun() override
Go.
Definition
bug-772.cc:80
Bug772ChainTest::m_recvSocket
Ptr< Socket > m_recvSocket
Receiving socket.
Definition
bug-772.h:74
Bug772ChainTest::m_nodes
NodeContainer * m_nodes
Definition
bug-772.h:44
Bug772ChainTest::m_size
const uint32_t m_size
Chain size.
Definition
bug-772.h:53
Bug772ChainTest::~Bug772ChainTest
~Bug772ChainTest() override
Definition
bug-772.cc:54
Bug772ChainTest::m_prefix
const std::string m_prefix
PCAP file names prefix.
Definition
bug-772.h:47
Bug772ChainTest::CreateNodes
void CreateNodes()
Create test topology.
Definition
bug-772.cc:101
Bug772ChainTest::m_step
const double m_step
Chain step, meters.
Definition
bug-772.h:55
Bug772ChainTest::CreateDevices
void CreateDevices()
Create devices, install TCP/IP stack and applications.
Definition
bug-772.cc:124
Bug772ChainTest::SendData
void SendData(Ptr< Socket > socket)
Send data.
Definition
bug-772.cc:60
Bug772ChainTest::m_sendSocket
Ptr< Socket > m_sendSocket
Transmitting socket.
Definition
bug-772.h:76
Bug772ChainTest::m_time
const Time m_time
Total simulation time.
Definition
bug-772.h:51
Bug772ChainTest::CheckResults
void CheckResults()
Compare traces with reference ones.
Definition
bug-772.cc:198
Bug772ChainTest::m_receivedPackets
uint32_t m_receivedPackets
Received packet count.
Definition
bug-772.h:79
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TestCase
encapsulates test code
Definition
test.h:1050
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
aodv
test
bug-772.h
Generated on Fri Dec 13 2024 18:20:37 for ns-3 by
1.11.0