A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ns3::aodv::DuplicatePacketDetection Class Reference

Helper class used to remember already seen packets and detect duplicates. More...

#include "aodv-dpd.h"

Public Member Functions

 DuplicatePacketDetection (Time lifetime)
 Constructor. More...
 
Time GetLifetime () const
 Get duplicate record lifetime. More...
 
bool IsDuplicate (Ptr< const Packet > p, const Ipv4Header &header)
 Check if the packet is a duplicate. More...
 
void SetLifetime (Time lifetime)
 Set duplicate record lifetime. More...
 

Private Attributes

IdCache m_idCache
 Impl. More...
 

Detailed Description

Helper class used to remember already seen packets and detect duplicates.

Currently duplicate detection is based on unique packet ID given by Packet::GetUid () This approach is known to be weak (ns3::Packet UID is an internal identifier and not intended for logical uniqueness in models) and should be changed.

Definition at line 41 of file aodv-dpd.h.

Constructor & Destructor Documentation

◆ DuplicatePacketDetection()

ns3::aodv::DuplicatePacketDetection::DuplicatePacketDetection ( Time  lifetime)
inline

Constructor.

Parameters
lifetimethe lifetime for added entries

Definition at line 48 of file aodv-dpd.h.

Member Function Documentation

◆ GetLifetime()

Time ns3::aodv::DuplicatePacketDetection::GetLifetime ( ) const

Get duplicate record lifetime.

Returns
the duplicate record lifetime

Definition at line 40 of file aodv-dpd.cc.

References ns3::aodv::IdCache::GetLifeTime(), and m_idCache.

◆ IsDuplicate()

bool ns3::aodv::DuplicatePacketDetection::IsDuplicate ( Ptr< const Packet p,
const Ipv4Header header 
)

Check if the packet is a duplicate.

If not, save information about this packet.

Parameters
pthe packet to check
headerthe IP header to check
Returns
true if duplicate

Definition at line 29 of file aodv-dpd.cc.

References ns3::Ipv4Header::GetSource(), ns3::Packet::GetUid(), ns3::aodv::IdCache::IsDuplicate(), and m_idCache.

Referenced by ns3::aodv::RoutingProtocol::RouteInput().

◆ SetLifetime()

void ns3::aodv::DuplicatePacketDetection::SetLifetime ( Time  lifetime)

Set duplicate record lifetime.

Parameters
lifetimethe lifetime for duplicate records

Definition at line 34 of file aodv-dpd.cc.

References m_idCache, and ns3::aodv::IdCache::SetLifetime().

Member Data Documentation

◆ m_idCache

IdCache ns3::aodv::DuplicatePacketDetection::m_idCache
private

Impl.

Definition at line 70 of file aodv-dpd.h.

Referenced by GetLifetime(), IsDuplicate(), and SetLifetime().


The documentation for this class was generated from the following files: