A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
uan-channel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Leonard Tracy <lentracy@gmail.com>
7 */
8
9#ifndef UAN_CHANNEL_H
10#define UAN_CHANNEL_H
11
12#include "uan-noise-model.h"
13#include "uan-prop-model.h"
14
15#include "ns3/channel.h"
16#include "ns3/net-device.h"
17#include "ns3/packet.h"
18
19#include <list>
20#include <vector>
21
22namespace ns3
23{
24
25class UanNetDevice;
26class UanPhy;
27class UanTransducer;
28class UanTxMode;
29
30/**
31 * \ingroup uan
32 *
33 * Channel class used by UAN devices.
34 */
35class UanChannel : public Channel
36{
37 public:
38 /**
39 * UanDeviceList is a standard template vector of pairs
40 * (UanNetDevice, UanTransducer)
41 */
42 typedef std::vector<std::pair<Ptr<UanNetDevice>, Ptr<UanTransducer>>> UanDeviceList;
43
44 UanChannel(); //!< Constructor
45 ~UanChannel() override; //!< Dummy destructor, see DoDispose.
46
47 /**
48 * Register this type.
49 * \return The object TypeId.
50 */
51 static TypeId GetTypeId();
52
53 // Inherited methods
54 std::size_t GetNDevices() const override;
55 Ptr<NetDevice> GetDevice(std::size_t i) const override;
56
57 /**
58 * Send a packet out on the channel.
59 *
60 * \param src Transducer transmitting packet.
61 * \param packet Packet to be transmitted.
62 * \param txPowerDb Transmission power in dB.
63 * \param txmode UanTxMode defining modulation of transmitted packet.
64 */
65 virtual void TxPacket(Ptr<UanTransducer> src,
66 Ptr<Packet> packet,
67 double txPowerDb,
68 UanTxMode txmode);
69
70 /**
71 * Adds device to receiver list for this channel.
72 *
73 * \param dev Net Device of node.
74 * \param trans Transducer of net device attached to this channel.
75 */
77
78 /**
79 * Set the propagation model this channel will use
80 * for path loss/propagation delay.
81 *
82 * \param prop The propagation model.
83 */
85
86 /**
87 * Set the noise model this channel will use
88 * to determine ambient channel noise.
89 *
90 * \param noise The noise model.
91 */
93
94 /**
95 * Get the noise level on the channel.
96 *
97 * \param fKhz Frequency in kHz.
98 * \return Ambient noise in dB/Hz on channel at a frequency.
99 */
100 double GetNoiseDbHz(double fKhz);
101
102 /**
103 * Clear all pointer references. */
104 void Clear();
105
106 protected:
107 UanDeviceList m_devList; //!< The list of devices on this channel.
108 Ptr<UanPropModel> m_prop; //!< The propagation model.
109 Ptr<UanNoiseModel> m_noise; //!< The noise model.
110 /** Has Clear ever been called on the channel. */
112
113 /**
114 * Send a packet up to the receiving UanTransducer.
115 *
116 * \param i Device number.
117 * \param packet The received packet.
118 * \param rxPowerDb Signal power in dB of arriving packet.
119 * \param txMode Mode arriving packet is using.
120 * \param pdp PDP of arriving signal.
121 */
122 void SendUp(uint32_t i, Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
123
124 void DoDispose() override;
125
126}; // class UanChannel
127
128} // namespace ns3
129
130#endif /* UAN_CHANNEL_H */
Abstract Channel Base Class.
Definition channel.h:34
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Channel class used by UAN devices.
Definition uan-channel.h:36
void SetNoiseModel(Ptr< UanNoiseModel > noise)
Set the noise model this channel will use to determine ambient channel noise.
double GetNoiseDbHz(double fKhz)
Get the noise level on the channel.
void AddDevice(Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans)
Adds device to receiver list for this channel.
UanChannel()
Constructor.
Ptr< UanPropModel > m_prop
The propagation model.
static TypeId GetTypeId()
Register this type.
Ptr< UanNoiseModel > m_noise
The noise model.
~UanChannel() override
Dummy destructor, see DoDispose.
void DoDispose() override
Destructor implementation.
virtual void TxPacket(Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode)
Send a packet out on the channel.
std::size_t GetNDevices() const override
bool m_cleared
Has Clear ever been called on the channel.
Ptr< NetDevice > GetDevice(std::size_t i) const override
std::vector< std::pair< Ptr< UanNetDevice >, Ptr< UanTransducer > > > UanDeviceList
UanDeviceList is a standard template vector of pairs (UanNetDevice, UanTransducer)
Definition uan-channel.h:42
UanDeviceList m_devList
The list of devices on this channel.
void SendUp(uint32_t i, Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Send a packet up to the receiving UanTransducer.
void Clear()
Clear all pointer references.
void SetPropagationModel(Ptr< UanPropModel > prop)
Set the propagation model this channel will use for path loss/propagation delay.
The power delay profile returned by propagation models.
Abstraction of packet modulation information.
Definition uan-tx-mode.h:32
Every class exported by the ns3 library is enclosed in the ns3 namespace.