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
yans-wifi-channel.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2006,2007 INRIA
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr>
18
*/
19
20
#ifndef YANS_WIFI_CHANNEL_H
21
#define YANS_WIFI_CHANNEL_H
22
23
#include "ns3/channel.h"
24
25
namespace
ns3
26
{
27
28
class
NetDevice;
29
class
PropagationLossModel;
30
class
PropagationDelayModel;
31
class
YansWifiPhy;
32
class
Packet;
33
class
Time
;
34
class
WifiPpdu;
35
36
/**
37
* \brief a channel to interconnect ns3::YansWifiPhy objects.
38
* \ingroup wifi
39
*
40
* This class is expected to be used in tandem with the ns3::YansWifiPhy
41
* class and supports an ns3::PropagationLossModel and an
42
* ns3::PropagationDelayModel. By default, no propagation models are set;
43
* it is the caller's responsibility to set them before using the channel.
44
*/
45
class
YansWifiChannel
:
public
Channel
46
{
47
public
:
48
/**
49
* \brief Get the type ID.
50
* \return the object TypeId
51
*/
52
static
TypeId
GetTypeId
();
53
54
YansWifiChannel
();
55
~YansWifiChannel
()
override
;
56
57
std::size_t
GetNDevices
()
const override
;
58
Ptr<NetDevice>
GetDevice
(std::size_t i)
const override
;
59
60
/**
61
* Adds the given YansWifiPhy to the PHY list
62
*
63
* \param phy the YansWifiPhy to be added to the PHY list
64
*/
65
void
Add
(
Ptr<YansWifiPhy>
phy);
66
67
/**
68
* \param loss the new propagation loss model.
69
*/
70
void
SetPropagationLossModel
(
const
Ptr<PropagationLossModel>
loss);
71
/**
72
* \param delay the new propagation delay model.
73
*/
74
void
SetPropagationDelayModel
(
const
Ptr<PropagationDelayModel>
delay);
75
76
/**
77
* \param sender the PHY object from which the packet is originating.
78
* \param ppdu the PPDU to send
79
* \param txPowerDbm the TX power associated to the packet, in dBm
80
*
81
* This method should not be invoked by normal users. It is
82
* currently invoked only from YansWifiPhy::StartTx. The channel
83
* attempts to deliver the PPDU to all other YansWifiPhy objects
84
* on the channel (except for the sender).
85
*/
86
void
Send
(
Ptr<YansWifiPhy>
sender,
Ptr<const WifiPpdu>
ppdu,
double
txPowerDbm)
const
;
87
88
/**
89
* Assign a fixed random variable stream number to the random variables
90
* used by this model. Return the number of streams (possibly zero) that
91
* have been assigned.
92
*
93
* \param stream first stream index to use
94
*
95
* \return the number of stream indices assigned by this model
96
*/
97
int64_t
AssignStreams
(int64_t stream);
98
99
private
:
100
/**
101
* A vector of pointers to YansWifiPhy.
102
*/
103
typedef
std::vector<Ptr<YansWifiPhy>>
PhyList
;
104
105
/**
106
* This method is scheduled by Send for each associated YansWifiPhy.
107
* The method then calls the corresponding YansWifiPhy that the first
108
* bit of the PPDU has arrived.
109
*
110
* \param receiver the device to which the packet is destined
111
* \param ppdu the PPDU being sent
112
* \param txPowerDbm the TX power associated to the packet being sent (dBm)
113
*/
114
static
void
Receive
(
Ptr<YansWifiPhy>
receiver,
Ptr<const WifiPpdu>
ppdu,
double
txPowerDbm);
115
116
PhyList
m_phyList
;
//!< List of YansWifiPhys connected to this YansWifiChannel
117
Ptr<PropagationLossModel>
m_loss
;
//!< Propagation loss model
118
Ptr<PropagationDelayModel>
m_delay
;
//!< Propagation delay model
119
};
120
121
}
// namespace ns3
122
123
#endif
/* YANS_WIFI_CHANNEL_H */
ns3::Channel
Abstract Channel Base Class.
Definition:
channel.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::YansWifiChannel
a channel to interconnect ns3::YansWifiPhy objects.
Definition:
yans-wifi-channel.h:46
ns3::YansWifiChannel::SetPropagationLossModel
void SetPropagationLossModel(const Ptr< PropagationLossModel > loss)
Definition:
yans-wifi-channel.cc:76
ns3::YansWifiChannel::m_delay
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
Definition:
yans-wifi-channel.h:118
ns3::YansWifiChannel::~YansWifiChannel
~YansWifiChannel() override
Definition:
yans-wifi-channel.cc:69
ns3::YansWifiChannel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
yans-wifi-channel.cc:44
ns3::YansWifiChannel::PhyList
std::vector< Ptr< YansWifiPhy > > PhyList
A vector of pointers to YansWifiPhy.
Definition:
yans-wifi-channel.h:103
ns3::YansWifiChannel::Receive
static void Receive(Ptr< YansWifiPhy > receiver, Ptr< const WifiPpdu > ppdu, double txPowerDbm)
This method is scheduled by Send for each associated YansWifiPhy.
Definition:
yans-wifi-channel.cc:134
ns3::YansWifiChannel::Send
void Send(Ptr< YansWifiPhy > sender, Ptr< const WifiPpdu > ppdu, double txPowerDbm) const
Definition:
yans-wifi-channel.cc:90
ns3::YansWifiChannel::GetDevice
Ptr< NetDevice > GetDevice(std::size_t i) const override
Definition:
yans-wifi-channel.cc:160
ns3::YansWifiChannel::m_phyList
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Definition:
yans-wifi-channel.h:116
ns3::YansWifiChannel::YansWifiChannel
YansWifiChannel()
Definition:
yans-wifi-channel.cc:64
ns3::YansWifiChannel::m_loss
Ptr< PropagationLossModel > m_loss
Propagation loss model.
Definition:
yans-wifi-channel.h:117
ns3::YansWifiChannel::GetNDevices
std::size_t GetNDevices() const override
Definition:
yans-wifi-channel.cc:154
ns3::YansWifiChannel::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
yans-wifi-channel.cc:173
ns3::YansWifiChannel::SetPropagationDelayModel
void SetPropagationDelayModel(const Ptr< PropagationDelayModel > delay)
Definition:
yans-wifi-channel.cc:83
ns3::YansWifiChannel::Add
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
Definition:
yans-wifi-channel.cc:166
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition:
nstime.h:839
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
wifi
model
yans-wifi-channel.h
Generated on Tue May 28 2024 23:40:46 for ns-3 by
1.9.6