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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#ifndef YANS_WIFI_CHANNEL_H
10
#define YANS_WIFI_CHANNEL_H
11
12
#include "
wifi-units.h
"
13
14
#include "ns3/channel.h"
15
#include "ns3/wifi-export.h"
16
17
namespace
ns3
18
{
19
20
class
NetDevice
;
21
class
PropagationLossModel
;
22
class
PropagationDelayModel
;
23
class
YansWifiPhy
;
24
class
Packet
;
25
class
Time
;
26
class
WifiPpdu
;
27
28
/**
29
* @brief a channel to interconnect ns3::YansWifiPhy objects.
30
* @ingroup wifi
31
*
32
* This class is expected to be used in tandem with the ns3::YansWifiPhy
33
* class and supports an ns3::PropagationLossModel and an
34
* ns3::PropagationDelayModel. By default, no propagation models are set;
35
* it is the caller's responsibility to set them before using the channel.
36
*/
37
class
WIFI_EXPORT
YansWifiChannel
:
public
Channel
38
{
39
public
:
40
/**
41
* @brief Get the type ID.
42
* @return the object TypeId
43
*/
44
static
TypeId
GetTypeId
();
45
46
YansWifiChannel
();
47
~YansWifiChannel
()
override
;
48
49
std::size_t
GetNDevices
()
const override
;
50
Ptr<NetDevice>
GetDevice
(std::size_t i)
const override
;
51
52
/**
53
* Adds the given YansWifiPhy to the PHY list
54
*
55
* @param phy the YansWifiPhy to be added to the PHY list
56
*/
57
void
Add
(
Ptr<YansWifiPhy>
phy);
58
59
/**
60
* @param loss the new propagation loss model.
61
*/
62
void
SetPropagationLossModel
(
const
Ptr<PropagationLossModel>
loss);
63
/**
64
* @param delay the new propagation delay model.
65
*/
66
void
SetPropagationDelayModel
(
const
Ptr<PropagationDelayModel>
delay);
67
68
/**
69
* @param sender the PHY object from which the packet is originating.
70
* @param ppdu the PPDU to send
71
* @param txPower the TX power associated to the packet
72
*
73
* This method should not be invoked by normal users. It is
74
* currently invoked only from YansWifiPhy::StartTx. The channel
75
* attempts to deliver the PPDU to all other YansWifiPhy objects
76
* on the channel (except for the sender).
77
*/
78
void
Send
(
Ptr<YansWifiPhy>
sender,
Ptr<const WifiPpdu>
ppdu,
dBm_u
txPower)
const
;
79
80
/**
81
* Assign a fixed random variable stream number to the random variables
82
* used by this model. Return the number of streams (possibly zero) that
83
* have been assigned.
84
*
85
* @param stream first stream index to use
86
*
87
* @return the number of stream indices assigned by this model
88
*/
89
int64_t
AssignStreams
(int64_t stream);
90
91
private
:
92
/**
93
* A vector of pointers to YansWifiPhy.
94
*/
95
typedef
std::vector<Ptr<YansWifiPhy>>
PhyList
;
96
97
/**
98
* This method is scheduled by Send for each associated YansWifiPhy.
99
* The method then calls the corresponding YansWifiPhy that the first
100
* bit of the PPDU has arrived.
101
*
102
* @param receiver the device to which the packet is destined
103
* @param ppdu the PPDU being sent
104
* @param txPower the TX power associated to the packet being sent
105
*/
106
static
void
Receive
(
Ptr<YansWifiPhy>
receiver,
Ptr<const WifiPpdu>
ppdu,
dBm_u
txPower);
107
108
PhyList
m_phyList
;
//!< List of YansWifiPhys connected to this YansWifiChannel
109
Ptr<PropagationLossModel>
m_loss
;
//!< Propagation loss model
110
Ptr<PropagationDelayModel>
m_delay
;
//!< Propagation delay model
111
};
112
113
}
// namespace ns3
114
115
#endif
/* YANS_WIFI_CHANNEL_H */
ns3::Channel::Channel
Channel()
Definition
channel.cc:37
ns3::NetDevice
Network layer to device interface.
Definition
net-device.h:87
ns3::Packet
network packets
Definition
packet.h:228
ns3::PropagationDelayModel
calculate a propagation delay.
Definition
propagation-delay-model.h:27
ns3::PropagationLossModel
Models the propagation loss through a transmission medium.
Definition
propagation-loss-model.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3::WifiPpdu
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition
wifi-ppdu.h:48
ns3::YansWifiChannel::SetPropagationLossModel
void SetPropagationLossModel(const Ptr< PropagationLossModel > loss)
Definition
yans-wifi-channel.cc:65
ns3::YansWifiChannel::m_delay
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
Definition
yans-wifi-channel.h:110
ns3::YansWifiChannel::Receive
static void Receive(Ptr< YansWifiPhy > receiver, Ptr< const WifiPpdu > ppdu, dBm_u txPower)
This method is scheduled by Send for each associated YansWifiPhy.
Definition
yans-wifi-channel.cc:123
ns3::YansWifiChannel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
yans-wifi-channel.cc:33
ns3::YansWifiChannel::PhyList
std::vector< Ptr< YansWifiPhy > > PhyList
A vector of pointers to YansWifiPhy.
Definition
yans-wifi-channel.h:95
ns3::YansWifiChannel::GetDevice
Ptr< NetDevice > GetDevice(std::size_t i) const override
Definition
yans-wifi-channel.cc:154
ns3::YansWifiChannel::m_phyList
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Definition
yans-wifi-channel.h:108
ns3::YansWifiChannel::YansWifiChannel
YansWifiChannel()
Definition
yans-wifi-channel.cc:53
ns3::YansWifiChannel::m_loss
Ptr< PropagationLossModel > m_loss
Propagation loss model.
Definition
yans-wifi-channel.h:109
ns3::YansWifiChannel::GetNDevices
std::size_t GetNDevices() const override
Definition
yans-wifi-channel.cc:148
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:167
ns3::YansWifiChannel::SetPropagationDelayModel
void SetPropagationDelayModel(const Ptr< PropagationDelayModel > delay)
Definition
yans-wifi-channel.cc:72
ns3::YansWifiChannel::Add
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
Definition
yans-wifi-channel.cc:160
ns3::YansWifiPhy
802.11 PHY layer model
Definition
yans-wifi-phy.h:39
Send
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
Definition
fd-emu-send.cc:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::dBm_u
double dBm_u
dBm weak type
Definition
wifi-units.h:27
wifi-units.h
Declaration of the SI units (as weak types aliases) used across wifi module.
src
wifi
model
yans-wifi-channel.h
Generated on
for ns-3 by
1.16.1