A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
error-channel-sixlow.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_SIXLOW_H
21
#define ERROR_CHANNEL_SIXLOW_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
ErrorChannelSixlow
:
public
SimpleChannel
40
{
41
public
:
42
static
TypeId
GetTypeId
(
void
);
43
ErrorChannelSixlow
();
44
45
virtual
void
Send
(
Ptr<Packet>
p, uint16_t protocol,
Mac48Address
to,
Mac48Address
from,
46
Ptr<SimpleNetDevice>
sender);
47
48
virtual
void
Add
(
Ptr<SimpleNetDevice>
device);
49
50
// inherited from ns3::Channel
51
virtual
uint32_t
GetNDevices
(
void
)
const
;
52
virtual
Ptr<NetDevice>
GetDevice
(uint32_t i)
const
;
53
58
void
SetJumpingTime
(
Time
delay);
59
64
void
SetJumpingMode
(
bool
mode);
65
70
void
SetDuplicateTime
(
Time
delay);
71
76
void
SetDuplicateMode
(
bool
mode);
77
78
private
:
79
std::vector<Ptr<SimpleNetDevice> >
m_devices
;
80
Time
m_jumpingTime
;
81
uint8_t
m_jumpingState
;
82
bool
m_jumping
;
83
Time
m_duplicateTime
;
84
bool
m_duplicate
;
85
uint8_t
m_duplicateState
;
86
};
87
88
class
BinaryErrorSixlowModel
:
public
ErrorModel
89
{
90
public
:
91
static
TypeId
GetTypeId
(
void
);
92
93
BinaryErrorSixlowModel
();
94
virtual
~BinaryErrorSixlowModel
();
95
void
Reset
(
void
);
96
97
private
:
98
virtual
bool
DoCorrupt
(
Ptr<Packet>
p);
99
virtual
void
DoReset
(
void
);
100
101
uint8_t
m_counter
;
102
103
};
104
105
}
// namespace ns3
106
107
#endif
/* ERROR_CHANNEL_SIXLOW_H */
ns3::ErrorChannelSixlow::GetNDevices
virtual uint32_t GetNDevices(void) const
Definition:
error-channel-sixlow.cc:139
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr< Packet >
ns3::BinaryErrorSixlowModel::GetTypeId
static TypeId GetTypeId(void)
Definition:
error-channel-sixlow.cc:152
ns3::ErrorChannelSixlow::SetDuplicateTime
void SetDuplicateTime(Time delay)
Set the delay for the odd duplicate packets (even ones are not duplicated)
Definition:
error-channel-sixlow.cc:68
ns3::ErrorChannelSixlow::m_duplicateState
uint8_t m_duplicateState
Definition:
error-channel-sixlow.h:85
ns3::ErrorChannelSixlow
A Error channel, introducing deterministic delays on even/odd packets.
Definition:
error-channel-sixlow.h:39
ns3::ErrorModel
General error model that can be used to corrupt packets.
Definition:
error-model.h:115
ns3::ErrorChannelSixlow::SetJumpingMode
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
Definition:
error-channel-sixlow.cc:61
ns3::ErrorChannelSixlow::SetJumpingTime
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
Definition:
error-channel-sixlow.cc:55
ns3::BinaryErrorSixlowModel
Definition:
error-channel-sixlow.h:88
ns3::ErrorChannelSixlow::m_jumpingState
uint8_t m_jumpingState
Definition:
error-channel-sixlow.h:81
ns3::BinaryErrorSixlowModel::DoReset
virtual void DoReset(void)
Definition:
error-channel-sixlow.cc:190
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:41
ns3::ErrorChannelSixlow::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-sixlow.cc:82
ns3::BinaryErrorSixlowModel::BinaryErrorSixlowModel
BinaryErrorSixlowModel()
Definition:
error-channel-sixlow.cc:161
ns3::ErrorChannelSixlow::ErrorChannelSixlow
ErrorChannelSixlow()
Definition:
error-channel-sixlow.cc:45
ns3::BinaryErrorSixlowModel::DoCorrupt
virtual bool DoCorrupt(Ptr< Packet > p)
Definition:
error-channel-sixlow.cc:172
ns3::ErrorChannelSixlow::m_jumping
bool m_jumping
Definition:
error-channel-sixlow.h:82
ns3::BinaryErrorSixlowModel::~BinaryErrorSixlowModel
virtual ~BinaryErrorSixlowModel()
Definition:
error-channel-sixlow.cc:166
ns3::ErrorChannelSixlow::m_duplicateTime
Time m_duplicateTime
Definition:
error-channel-sixlow.h:83
ns3::SimpleChannel
A simple channel, for simple things and testing.
Definition:
simple-channel.h:36
ns3::ErrorChannelSixlow::m_duplicate
bool m_duplicate
Definition:
error-channel-sixlow.h:84
ns3::ErrorChannelSixlow::GetDevice
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
Definition:
error-channel-sixlow.cc:144
ns3::ErrorChannelSixlow::GetTypeId
static TypeId GetTypeId(void)
Definition:
error-channel-sixlow.cc:36
ns3::ErrorChannelSixlow::m_jumpingTime
Time m_jumpingTime
Definition:
error-channel-sixlow.h:80
ns3::ErrorChannelSixlow::SetDuplicateMode
void SetDuplicateMode(bool mode)
Set if the odd packets are duplicated (even ones are not duplicated ever)
Definition:
error-channel-sixlow.cc:74
ns3::BinaryErrorSixlowModel::Reset
void Reset(void)
Definition:
error-channel-sixlow.cc:184
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::ErrorChannelSixlow::m_devices
std::vector< Ptr< SimpleNetDevice > > m_devices
Definition:
error-channel-sixlow.h:79
ns3::BinaryErrorSixlowModel::m_counter
uint8_t m_counter
Definition:
error-channel-sixlow.h:101
ns3::ErrorChannelSixlow::Add
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
Definition:
error-channel-sixlow.cc:133
src
sixlowpan
test
error-channel-sixlow.h
Generated on Sat Apr 19 2014 14:07:07 for ns-3 by
1.8.6