A Discrete-Event Network Simulator
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
17namespace 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 */
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 */
a polymophic address class
Definition address.h:90
A helper to make it easier to instantiate an application on a set of nodes.
Class for representing data rates.
Definition data-rate.h:78
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
OnOffHelper(const std::string &protocol, const Address &address)
Create an OnOffHelper to make it easier to work with OnOffApplications.
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize
Packet size generated at the AP.