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
on-off-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#ifndef ON_OFF_HELPER_H
10
#define ON_OFF_HELPER_H
11
12
#include <ns3/application-helper.h>
13
#include <ns3/data-rate.h>
14
15
#include <stdint.h>
16
17
namespace
ns3
18
{
19
20
/**
21
* @ingroup onoff
22
* @brief A helper to make it easier to instantiate an ns3::OnOffApplication
23
* on a set of nodes.
24
*/
25
class
OnOffHelper
:
public
ApplicationHelper
26
{
27
public
:
28
/**
29
* Create an OnOffHelper to make it easier to work with OnOffApplications
30
*
31
* @param protocol the name of the protocol to use to send traffic
32
* by the applications. This string identifies the socket
33
* factory type used to create sockets for the applications.
34
* A typical value would be ns3::UdpSocketFactory.
35
* @param address the address of the remote node to send traffic
36
* to.
37
*/
38
OnOffHelper
(
const
std::string& protocol,
const
Address
& address);
39
40
/**
41
* Helper function to set a constant rate source. Equivalent to
42
* setting the attributes OnTime to constant 1000 seconds, OffTime to
43
* constant 0 seconds, and the DataRate and PacketSize set accordingly
44
*
45
* @param dataRate DataRate object for the sending rate
46
* @param packetSize size in bytes of the packet payloads generated
47
*/
48
void
SetConstantRate
(
DataRate
dataRate,
uint32_t
packetSize
= 512);
49
};
50
51
}
// namespace ns3
52
53
#endif
/* ON_OFF_HELPER_H */
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::ApplicationHelper
A helper to make it easier to instantiate an application on a set of nodes.
Definition
application-helper.h:28
ns3::DataRate
Class for representing data rates.
Definition
data-rate.h:78
ns3::OnOffHelper
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition
on-off-helper.h:26
ns3::OnOffHelper::OnOffHelper
OnOffHelper(const std::string &protocol, const Address &address)
Create an OnOffHelper to make it easier to work with OnOffApplications.
Definition
on-off-helper.cc:18
ns3::OnOffHelper::SetConstantRate
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
Definition
on-off-helper.cc:26
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
packetSize
static const uint32_t packetSize
Packet size generated at the AP.
Definition
wifi-power-adaptation-distance.cc:96
src
applications
helper
on-off-helper.h
Generated on Wed Dec 4 2024 18:20:37 for ns-3 by
1.11.0