A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
flent-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 * Copyright (c) 2022 NITK Surathkal
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * This file is adapted from bulk-send-helper.h.
8 *
9 * Author: Ameya Deshpande <ameyanrd@outlook.com>
10 */
11
12#ifndef FLENT_HELPER_H
13#define FLENT_HELPER_H
14
15#include "ns3/application-container.h"
16#include "ns3/attribute.h"
17#include "ns3/nstime.h"
18#include "ns3/object-factory.h"
19
20#include <string>
21
22namespace ns3
23{
24
25/**
26 * @ingroup flent
27 * @brief A helper to make it easier to instantiate an ns3::FlentApplication
28 */
30{
31 public:
32 /**
33 * Create an FlentHelper to make it easier to work with FlentApplication
34 *
35 * @param [in] testname the name of the test to run on FlentApplication
36 * The supported tests are ping, tcp_upload, tcp_download and rrul.
37 * @param [in] address the address of the remote host to send traffic to.
38 */
39 FlentHelper(std::string testname, Address address);
40
41 /**
42 * Helper function used to set the underlying application attributes.
43 *
44 * @param name the name of the application attribute to set
45 * @param value the value of the application attribute to set
46 */
47 void SetAttribute(std::string name, const AttributeValue& value);
48
49 /**
50 * @brief Set the test start time
51 * @param start Test start time
52 */
53 void SetTestStartTime(Time start);
54
55 /**
56 * @brief Set the length of the Flent test
57 * @param length Test length
58 */
59 void SetTestLength(Time length);
60
61 /**
62 * @brief Get the overall stop time of the simulation
63 * @returns Stop time (start + length + 10s cooldown)
64 */
65 Time GetStopTime() const;
66
67 /**
68 * Install an ns3::FlentApplication on the node configured with all the
69 * attributes set with SetAttribute.
70 *
71 * @param node The node on which an FlentApplication will be installed.
72 * @returns Container of Ptr to the applications installed.
73 */
75
76 /**
77 * Install an ns3::FlentApplication on the node configured with all the
78 * attributes set with SetAttribute.
79 *
80 * @param nodeName The node on which an FlentApplication will be installed.
81 * @returns Container of Ptr to the applications installed.
82 */
83 ApplicationContainer Install(std::string nodeName) const;
84
85 private:
86 /**
87 * Install an ns3::FlentApplication on the node configured with all the
88 * attributes set with SetAttribute.
89 *
90 * @param node The node on which an FlentApplication will be installed.
91 * @returns Ptr to the application installed.
92 */
94
95 ObjectFactory m_factory; //!< Object factory.
96 Time m_startTime{0}; //!< The start time of the Flent test
97 Time m_length{Seconds(60)}; //!< The duration of the Flent test
98};
99
100} // namespace ns3
101
102#endif /* FLENT_HELPER_H */
a polymophic address class
Definition address.h:114
holds a vector of ns3::Application pointers.
Hold a value for an Attribute.
Definition attribute.h:59
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
void SetTestLength(Time length)
Set the length of the Flent test.
Time m_length
The duration of the Flent test.
Time m_startTime
The start time of the Flent test.
void SetTestStartTime(Time start)
Set the test start time.
FlentHelper(std::string testname, Address address)
Create an FlentHelper to make it easier to work with FlentApplication.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Time GetStopTime() const
Get the overall stop time of the simulation.
ObjectFactory m_factory
Object factory.
ApplicationContainer Install(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1313
Every class exported by the ns3 library is enclosed in the ns3 namespace.