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
aodv-dpd.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
* Authors: Elena Buchatskaia <borovkovaes@iitp.ru>
8
* Pavel Boyko <boyko@iitp.ru>
9
*/
10
11
#ifndef AODV_DPD_H
12
#define AODV_DPD_H
13
14
#include "
aodv-id-cache.h
"
15
16
#include "ns3/ipv4-header.h"
17
#include "ns3/nstime.h"
18
#include "ns3/packet.h"
19
20
namespace
ns3
21
{
22
namespace
aodv
23
{
24
/**
25
* \ingroup aodv
26
*
27
* \brief Helper class used to remember already seen packets and detect duplicates.
28
*
29
* Currently duplicate detection is based on unique packet ID given by Packet::GetUid ()
30
* This approach is known to be weak (ns3::Packet UID is an internal identifier and not intended for
31
* logical uniqueness in models) and should be changed.
32
*/
33
class
DuplicatePacketDetection
34
{
35
public
:
36
/**
37
* Constructor
38
* \param lifetime the lifetime for added entries
39
*/
40
DuplicatePacketDetection
(
Time
lifetime)
41
:
m_idCache
(lifetime)
42
{
43
}
44
45
/**
46
* Check if the packet is a duplicate. If not, save information about this packet.
47
* \param p the packet to check
48
* \param header the IP header to check
49
* \returns true if duplicate
50
*/
51
bool
IsDuplicate
(
Ptr<const Packet>
p,
const
Ipv4Header
& header);
52
/**
53
* Set duplicate record lifetime
54
* \param lifetime the lifetime for duplicate records
55
*/
56
void
SetLifetime
(
Time
lifetime);
57
/**
58
* Get duplicate record lifetime
59
* \returns the duplicate record lifetime
60
*/
61
Time
GetLifetime
()
const
;
62
63
private
:
64
/// Impl
65
IdCache
m_idCache
;
66
};
67
68
}
// namespace aodv
69
}
// namespace ns3
70
71
#endif
/* AODV_DPD_H */
aodv-id-cache.h
ns3::Ipv4Header
Packet header for IPv4.
Definition
ipv4-header.h:23
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::aodv::DuplicatePacketDetection
Helper class used to remember already seen packets and detect duplicates.
Definition
aodv-dpd.h:34
ns3::aodv::DuplicatePacketDetection::m_idCache
IdCache m_idCache
Impl.
Definition
aodv-dpd.h:65
ns3::aodv::DuplicatePacketDetection::DuplicatePacketDetection
DuplicatePacketDetection(Time lifetime)
Constructor.
Definition
aodv-dpd.h:40
ns3::aodv::DuplicatePacketDetection::GetLifetime
Time GetLifetime() const
Get duplicate record lifetime.
Definition
aodv-dpd.cc:31
ns3::aodv::DuplicatePacketDetection::IsDuplicate
bool IsDuplicate(Ptr< const Packet > p, const Ipv4Header &header)
Check if the packet is a duplicate.
Definition
aodv-dpd.cc:19
ns3::aodv::DuplicatePacketDetection::SetLifetime
void SetLifetime(Time lifetime)
Set duplicate record lifetime.
Definition
aodv-dpd.cc:25
ns3::aodv::IdCache
Unique packets identification cache used for simple duplicate detection.
Definition
aodv-id-cache.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
aodv
model
aodv-dpd.h
Generated on Fri Nov 8 2024 13:58:58 for ns-3 by
1.11.0