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
spectrum-error-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Nicola Baldo <nbaldo@cttc.es>
7
*/
8
9
#ifndef SPECTRUM_ERROR_MODEL_H
10
#define SPECTRUM_ERROR_MODEL_H
11
12
#include "
spectrum-value.h
"
13
14
#include <ns3/nstime.h>
15
#include <ns3/object.h>
16
#include <ns3/packet.h>
17
#include <ns3/ptr.h>
18
19
namespace
ns3
20
{
21
22
/**
23
* \ingroup spectrum
24
*
25
*/
26
class
SpectrumErrorModel
:
public
Object
27
{
28
public
:
29
/**
30
* Register this type.
31
* \return The TypeId.
32
*/
33
static
TypeId
GetTypeId
();
34
~SpectrumErrorModel
()
override
;
35
36
/**
37
* Start a packet reception
38
* \param p the packet
39
*/
40
virtual
void
StartRx
(
Ptr<const Packet>
p) = 0;
41
42
/**
43
* Evaluates a chunk
44
* \param sinr the SpectrumValue experienced by the Chunk
45
* \param duration the Chunk length
46
*/
47
virtual
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration) = 0;
48
49
/**
50
* Checks if the packet being received is correct
51
* \returns true if the packet is correct.
52
*/
53
virtual
bool
IsRxCorrect
() = 0;
54
};
55
56
/**
57
* \ingroup spectrum
58
*
59
* This class implements the error model described in this paper:
60
* N. Baldo and M. Miozzo, "Spectrum-aware Channel and PHY layer modeling
61
* for ns3", in Proceedings of International Workshop on Network
62
* Simulation Tools (NSTOOLS 2009), 19 October 2009, Pisa (Italy).
63
*/
64
class
ShannonSpectrumErrorModel
:
public
SpectrumErrorModel
65
{
66
protected
:
67
void
DoDispose
()
override
;
68
69
public
:
70
/**
71
* Register this type.
72
* \return The TypeId.
73
*/
74
static
TypeId
GetTypeId
();
75
// inherited from SpectrumErrorModel
76
void
StartRx
(
Ptr<const Packet>
p)
override
;
77
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration)
override
;
78
bool
IsRxCorrect
()
override
;
79
80
private
:
81
uint32_t
m_bytes
;
//!< Length of the packet being received
82
uint32_t
m_deliverableBytes
;
//!< Bytes that can be received according to the Shnanon's formula
83
};
84
85
}
// namespace ns3
86
87
#endif
/* SPECTRUM_ERROR_MODEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::ShannonSpectrumErrorModel
This class implements the error model described in this paper: N.
Definition
spectrum-error-model.h:65
ns3::ShannonSpectrumErrorModel::StartRx
void StartRx(Ptr< const Packet > p) override
Start a packet reception.
Definition
spectrum-error-model.cc:56
ns3::ShannonSpectrumErrorModel::m_bytes
uint32_t m_bytes
Length of the packet being received.
Definition
spectrum-error-model.h:81
ns3::ShannonSpectrumErrorModel::EvaluateChunk
void EvaluateChunk(const SpectrumValue &sinr, Time duration) override
Evaluates a chunk.
Definition
spectrum-error-model.cc:65
ns3::ShannonSpectrumErrorModel::IsRxCorrect
bool IsRxCorrect() override
Checks if the packet being received is correct.
Definition
spectrum-error-model.cc:88
ns3::ShannonSpectrumErrorModel::m_deliverableBytes
uint32_t m_deliverableBytes
Bytes that can be received according to the Shnanon's formula.
Definition
spectrum-error-model.h:82
ns3::ShannonSpectrumErrorModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
spectrum-error-model.cc:39
ns3::ShannonSpectrumErrorModel::DoDispose
void DoDispose() override
Destructor implementation.
Definition
spectrum-error-model.cc:49
ns3::SpectrumErrorModel
Definition
spectrum-error-model.h:27
ns3::SpectrumErrorModel::StartRx
virtual void StartRx(Ptr< const Packet > p)=0
Start a packet reception.
ns3::SpectrumErrorModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
spectrum-error-model.cc:22
ns3::SpectrumErrorModel::IsRxCorrect
virtual bool IsRxCorrect()=0
Checks if the packet being received is correct.
ns3::SpectrumErrorModel::~SpectrumErrorModel
~SpectrumErrorModel() override
Definition
spectrum-error-model.cc:31
ns3::SpectrumErrorModel::EvaluateChunk
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)=0
Evaluates a chunk.
ns3::SpectrumValue
Set of values corresponding to a given SpectrumModel.
Definition
spectrum-value.h:50
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-value.h
src
spectrum
model
spectrum-error-model.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0