A Discrete-Event Network Simulator
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
13
14#include "ns3/random-variable-stream.h"
15
16namespace 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 */
34{
35 public:
36 /**
37 * @brief Get the type ID.
38 * @return The object TypeId.
39 */
40 static TypeId GetTypeId();
41
43 ~SixLowPanSimpleFlooding() override;
44
45 // Delete copy constructor and assignment operator to avoid misuse.
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.
63};
64
65} // namespace ns3
66
67#endif /* SIXLOWPAN_SIMPLE_FLOODING_H */
a polymophic address class
Definition address.h:114
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Callback< void, Ptr< Packet > > ForwardCallback
Callback used by a policy to forward a packet.
SixLowPanSimpleFlooding & operator=(const SixLowPanSimpleFlooding &)=delete
SixLowPanSimpleFlooding(const SixLowPanSimpleFlooding &)=delete
static TypeId GetTypeId()
Get the type ID.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random stream number to RNGs used by the policy.
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.
Ptr< RandomVariableStream > m_jitter
Random variable (in milliseconds) used to schedule each rebroadcast.
void DoDispose() override
Destructor implementation.
a unique identifier for an interface.
Definition type-id.h:50
Every class exported by the ns3 library is enclosed in the ns3 namespace.