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
16
namespace
ns3
17
{
18
19
class
NetDevice;
20
class
PropagationLossModel;
21
class
PropagationDelayModel;
22
class
YansWifiPhy;
23
class
Packet;
24
class
Time
;
25
class
WifiPpdu;
26
27
/**
28
* \brief a channel to interconnect ns3::YansWifiPhy objects.
29
* \ingroup wifi
30
*
31
* This class is expected to be used in tandem with the ns3::YansWifiPhy
32
* class and supports an ns3::PropagationLossModel and an
33
* ns3::PropagationDelayModel. By default, no propagation models are set;
34
* it is the caller's responsibility to set them before using the channel.
35
*/
36
class
YansWifiChannel
:
public
Channel
37
{
38
public
:
39
/**
40
* \brief Get the type ID.
41
* \return the object TypeId
42
*/
43
static
TypeId
GetTypeId
();
44
45
YansWifiChannel
();
46
~YansWifiChannel
()
override
;
47
48
std::size_t
GetNDevices
()
const override
;
49
Ptr<NetDevice>
GetDevice
(std::size_t i)
const override
;
50
51
/**
52
* Adds the given YansWifiPhy to the PHY list
53
*
54
* \param phy the YansWifiPhy to be added to the PHY list
55
*/
56
void
Add
(
Ptr<YansWifiPhy>
phy);
57
58
/**
59
* \param loss the new propagation loss model.
60
*/
61
void
SetPropagationLossModel
(
const
Ptr<PropagationLossModel>
loss);
62
/**
63
* \param delay the new propagation delay model.
64
*/
65
void
SetPropagationDelayModel
(
const
Ptr<PropagationDelayModel>
delay);
66
67
/**
68
* \param sender the PHY object from which the packet is originating.
69
* \param ppdu the PPDU to send
70
* \param txPower the TX power associated to the packet
71
*
72
* This method should not be invoked by normal users. It is
73
* currently invoked only from YansWifiPhy::StartTx. The channel
74
* attempts to deliver the PPDU to all other YansWifiPhy objects
75
* on the channel (except for the sender).
76
*/
77
void
Send
(
Ptr<YansWifiPhy>
sender,
Ptr<const WifiPpdu>
ppdu,
dBm_u
txPower)
const
;
78
79
/**
80
* Assign a fixed random variable stream number to the random variables
81
* used by this model. Return the number of streams (possibly zero) that
82
* have been assigned.
83
*
84
* \param stream first stream index to use
85
*
86
* \return the number of stream indices assigned by this model
87
*/
88
int64_t
AssignStreams
(int64_t stream);
89
90
private
:
91
/**
92
* A vector of pointers to YansWifiPhy.
93
*/
94
typedef
std::vector<Ptr<YansWifiPhy>>
PhyList
;
95
96
/**
97
* This method is scheduled by Send for each associated YansWifiPhy.
98
* The method then calls the corresponding YansWifiPhy that the first
99
* bit of the PPDU has arrived.
100
*
101
* \param receiver the device to which the packet is destined
102
* \param ppdu the PPDU being sent
103
* \param txPower the TX power associated to the packet being sent
104
*/
105
static
void
Receive
(
Ptr<YansWifiPhy>
receiver,
Ptr<const WifiPpdu>
ppdu,
dBm_u
txPower);
106
107
PhyList
m_phyList
;
//!< List of YansWifiPhys connected to this YansWifiChannel
108
Ptr<PropagationLossModel>
m_loss
;
//!< Propagation loss model
109
Ptr<PropagationDelayModel>
m_delay
;
//!< Propagation delay model
110
};
111
112
}
// namespace ns3
113
114
#endif
/* YANS_WIFI_CHANNEL_H */
double
ns3::Channel
Abstract Channel Base Class.
Definition
channel.h:34
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::YansWifiChannel
a channel to interconnect ns3::YansWifiPhy objects.
Definition
yans-wifi-channel.h:37
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:109
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::~YansWifiChannel
~YansWifiChannel() override
Definition
yans-wifi-channel.cc:58
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:94
ns3::YansWifiChannel::GetDevice
Ptr< NetDevice > GetDevice(std::size_t i) const override
Definition
yans-wifi-channel.cc:149
ns3::YansWifiChannel::m_phyList
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Definition
yans-wifi-channel.h:107
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:108
ns3::YansWifiChannel::GetNDevices
std::size_t GetNDevices() const override
Definition
yans-wifi-channel.cc:143
ns3::YansWifiChannel::Send
void Send(Ptr< YansWifiPhy > sender, Ptr< const WifiPpdu > ppdu, dBm_u txPower) const
Definition
yans-wifi-channel.cc:79
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:162
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:155
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition
nstime.h:828
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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 Fri Nov 8 2024 13:59:08 for ns-3 by
1.11.0