A Discrete-Event Network Simulator
qkdnetsim_etsi_014 @ (+)
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
l
o
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Examples
▼
ns-3
►
ns-3 Documentation
All ns3::TypeId's
All Attributes
All GlobalValues
All LogComponents
All TraceSources
Todo List
Deprecated List
Bug List
►
Modules
►
Namespaces
►
Classes
▼
Files
►
File List
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
error-channel.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013 Universita' di Firenze, Italy
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
*/
20
#ifndef ERROR_CHANNEL_H
21
#define ERROR_CHANNEL_H
22
23
#include "ns3/channel.h"
24
#include "ns3/simple-channel.h"
25
#include "ns3/error-model.h"
26
#include "ns3/mac48-address.h"
27
#include "ns3/nstime.h"
28
#include <vector>
29
30
namespace
ns3
{
31
32
class
SimpleNetDevice;
33
class
Packet;
34
39
class
ErrorChannel
:
public
SimpleChannel
40
{
41
public
:
46
static
TypeId
GetTypeId
(
void
);
47
ErrorChannel
();
48
49
// inherited from ns3::SimpleChannel
50
virtual
void
Send
(
Ptr<Packet>
p, uint16_t protocol,
Mac48Address
to,
Mac48Address
from,
51
Ptr<SimpleNetDevice>
sender);
52
53
virtual
void
Add
(
Ptr<SimpleNetDevice>
device);
54
55
// inherited from ns3::Channel
56
virtual
std::size_t
GetNDevices
(
void
)
const
;
57
virtual
Ptr<NetDevice>
GetDevice
(std::size_t i)
const
;
58
63
void
SetJumpingTime
(
Time
delay);
64
69
void
SetJumpingMode
(
bool
mode);
70
75
void
SetDuplicateTime
(
Time
delay);
76
81
void
SetDuplicateMode
(
bool
mode);
82
83
private
:
84
std::vector<Ptr<SimpleNetDevice> >
m_devices
;
85
Time
m_jumpingTime
;
86
uint8_t
m_jumpingState
;
87
bool
m_jumping
;
88
Time
m_duplicateTime
;
89
bool
m_duplicate
;
90
uint8_t
m_duplicateState
;
91
};
92
93
}
// namespace ns3
94
95
#endif
/* ERROR_CHANNEL_H */
ns3::ErrorChannel
A Error channel, introducing deterministic delays on even/odd packets.
Definition:
error-channel.h:40
ns3::ErrorChannel::m_duplicateTime
Time m_duplicateTime
Duplicate time in Duplicate mode.
Definition:
error-channel.h:88
ns3::ErrorChannel::GetDevice
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Definition:
error-channel.cc:145
ns3::ErrorChannel::m_duplicateState
uint8_t m_duplicateState
Counter for even/odd packets in Duplicate mode.
Definition:
error-channel.h:90
ns3::ErrorChannel::m_jumping
bool m_jumping
Flag for Jumping mode.
Definition:
error-channel.h:87
ns3::ErrorChannel::m_devices
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
Definition:
error-channel.h:84
ns3::ErrorChannel::ErrorChannel
ErrorChannel()
Definition:
error-channel.cc:45
ns3::ErrorChannel::SetJumpingTime
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
Definition:
error-channel.cc:56
ns3::ErrorChannel::Send
virtual void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
A packet is sent by a net device.
Definition:
error-channel.cc:82
ns3::ErrorChannel::SetJumpingMode
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
Definition:
error-channel.cc:62
ns3::ErrorChannel::Add
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
Definition:
error-channel.cc:133
ns3::ErrorChannel::SetDuplicateMode
void SetDuplicateMode(bool mode)
Set if the odd packets are duplicated (even ones are not duplicated ever)
Definition:
error-channel.cc:75
ns3::ErrorChannel::m_jumpingTime
Time m_jumpingTime
Delay time in Jumping mode.
Definition:
error-channel.h:85
ns3::ErrorChannel::SetDuplicateTime
void SetDuplicateTime(Time delay)
Set the delay for the odd duplicate packets (even ones are not duplicated)
Definition:
error-channel.cc:69
ns3::ErrorChannel::m_jumpingState
uint8_t m_jumpingState
Counter for even/odd packets in Jumping mode.
Definition:
error-channel.h:86
ns3::ErrorChannel::m_duplicate
bool m_duplicate
Flag for Duplicate mode.
Definition:
error-channel.h:89
ns3::ErrorChannel::GetNDevices
virtual std::size_t GetNDevices(void) const
Definition:
error-channel.cc:139
ns3::ErrorChannel::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
error-channel.cc:35
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:44
ns3::Ptr< Packet >
ns3::SimpleChannel
A simple channel, for simple things and testing.
Definition:
simple-channel.h:47
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:103
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
error-channel.h
Generated on Tue Feb 6 2024 19:21:25 for ns-3 by
1.9.1