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
sixlowpan-simple-flooding.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2026 SRM Institute of Science and Technology, India
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Usham Roy <ushamroy80@gmail.com>
7
*/
8
9
#ifndef SIXLOWPAN_SIMPLE_FLOODING_H
10
#define SIXLOWPAN_SIMPLE_FLOODING_H
11
12
#include "
sixlowpan-mesh-under-routing.h
"
13
14
#include "ns3/random-variable-stream.h"
15
16
namespace
ns3
17
{
18
19
/**
20
* @ingroup sixlowpan
21
*
22
* @brief Default mesh-under forwarding policy: unconditional rebroadcast with jitter.
23
*
24
* SixLowPanSimpleFlooding preserves the historical 6LoWPAN mesh-under
25
* behavior of unconditionally rebroadcasting every received (non-duplicate)
26
* mesh-under packet after a uniform random jitter (default Uniform[0, 10ms]).
27
*
28
* No suppression. No listening. No counters. This policy is the default,
29
* so that the policy framework preserves the behavior of the previous
30
* in-device flooding implementation when no policy is explicitly
31
* selected by the user.
32
*/
33
class
SixLowPanSimpleFlooding
:
public
SixLowPanMeshUnderRouting
34
{
35
public
:
36
/**
37
* @brief Get the type ID.
38
* @return The object TypeId.
39
*/
40
static
TypeId
GetTypeId
();
41
42
SixLowPanSimpleFlooding
();
43
~SixLowPanSimpleFlooding
()
override
;
44
45
// Delete copy constructor and assignment operator to avoid misuse.
46
SixLowPanSimpleFlooding
(
const
SixLowPanSimpleFlooding
&) =
delete
;
47
SixLowPanSimpleFlooding
&
operator=
(
const
SixLowPanSimpleFlooding
&) =
delete
;
48
49
void
OnPacketForward
(
Ptr<Packet>
packet,
50
const
Address
& originator,
51
uint8_t seqNo,
52
uint8_t hopsLeft,
53
ForwardCallback
forwardCb)
override
;
54
55
int64_t
AssignStreams
(int64_t stream)
override
;
56
57
protected
:
58
void
DoDispose
()
override
;
59
60
private
:
61
/// Random variable (in milliseconds) used to schedule each rebroadcast.
62
Ptr<RandomVariableStream>
m_jitter
;
63
};
64
65
}
// namespace ns3
66
67
#endif
/* SIXLOWPAN_SIMPLE_FLOODING_H */
ns3::Address
a polymophic address class
Definition
address.h:114
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::SixLowPanMeshUnderRouting::ForwardCallback
Callback< void, Ptr< Packet > > ForwardCallback
Callback used by a policy to forward a packet.
Definition
sixlowpan-mesh-under-routing.h:59
ns3::SixLowPanMeshUnderRouting::SixLowPanMeshUnderRouting
SixLowPanMeshUnderRouting()
Definition
sixlowpan-mesh-under-routing.cc:37
ns3::SixLowPanSimpleFlooding::SixLowPanSimpleFlooding
SixLowPanSimpleFlooding()
Definition
sixlowpan-simple-flooding.cc:41
ns3::SixLowPanSimpleFlooding::operator=
SixLowPanSimpleFlooding & operator=(const SixLowPanSimpleFlooding &)=delete
ns3::SixLowPanSimpleFlooding::SixLowPanSimpleFlooding
SixLowPanSimpleFlooding(const SixLowPanSimpleFlooding &)=delete
ns3::SixLowPanSimpleFlooding::~SixLowPanSimpleFlooding
~SixLowPanSimpleFlooding() override
Definition
sixlowpan-simple-flooding.cc:46
ns3::SixLowPanSimpleFlooding::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
sixlowpan-simple-flooding.cc:24
ns3::SixLowPanSimpleFlooding::AssignStreams
int64_t AssignStreams(int64_t stream) override
Assign a fixed random stream number to RNGs used by the policy.
Definition
sixlowpan-simple-flooding.cc:74
ns3::SixLowPanSimpleFlooding::OnPacketForward
void OnPacketForward(Ptr< Packet > packet, const Address &originator, uint8_t seqNo, uint8_t hopsLeft, ForwardCallback forwardCb) override
Decide whether (and when) to forward a new mesh-under packet.
Definition
sixlowpan-simple-flooding.cc:60
ns3::SixLowPanSimpleFlooding::m_jitter
Ptr< RandomVariableStream > m_jitter
Random variable (in milliseconds) used to schedule each rebroadcast.
Definition
sixlowpan-simple-flooding.h:62
ns3::SixLowPanSimpleFlooding::DoDispose
void DoDispose() override
Destructor implementation.
Definition
sixlowpan-simple-flooding.cc:52
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
sixlowpan-mesh-under-routing.h
src
sixlowpan
model
sixlowpan-simple-flooding.h
Generated on
for ns-3 by
1.16.1