A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::zigbee::NeighborTable Class Reference

The network layer Network Table See Zigbee specification r22.1.0, 3.6.1.5. More...

#include "zigbee-nwk-tables.h"

+ Collaboration diagram for ns3::zigbee::NeighborTable:

Public Member Functions

 NeighborTable ()
 The neighbor table constructor.
 
bool AddEntry (Ptr< NeighborTableEntry > entry)
 Add an entry to the neighbor table.
 
void Delete (Mac64Address extAddr)
 Delete the specified entry from the neighbor table.
 
void Dispose ()
 Dispose of the table and all its elements.
 
uint32_t GetMaxTableSize () const
 Get the maximum size of the neighbor table.
 
bool GetParent (Ptr< NeighborTableEntry > &entryFound)
 Look for this device Parent neighbor (A.K.A coordinator).
 
uint32_t GetSize ()
 Get the size of the neighbor table.
 
bool LookUpEntry (Mac16Address nwkAddr, Ptr< NeighborTableEntry > &entryFound)
 Look and return and entry if exists in the neighbor table.
 
bool LookUpEntry (Mac64Address extAddr, Ptr< NeighborTableEntry > &entryFound)
 Look and return and entry if exists in the neighbor table.
 
bool LookUpForBestParent (uint64_t epid, Ptr< NeighborTableEntry > &entryFound)
 Perform a search for the best candidate parent based on some attributes.
 
void Print (Ptr< OutputStreamWrapper > stream) const
 Print the neighbor table.
 
void Purge ()
 Remove old entries from the neighbor table.
 
void SetMaxTableSize (uint32_t size)
 Set the maximum size of the neighbor table.
 

Private Member Functions

uint8_t GetLinkCost (uint8_t lqi) const
 Get the link cost based on the link quality indicator (LQI) value.
 

Private Attributes

uint32_t m_maxTableSize
 The maximum size of the neighbor table.
 
std::deque< Ptr< NeighborTableEntry > > m_neighborTable
 The neighbor table object.
 

Detailed Description

The network layer Network Table See Zigbee specification r22.1.0, 3.6.1.5.

Definition at line 1089 of file zigbee-nwk-tables.h.

Constructor & Destructor Documentation

◆ NeighborTable()

ns3::zigbee::NeighborTable::NeighborTable ( )

The neighbor table constructor.

Definition at line 999 of file zigbee-nwk-tables.cc.

References m_maxTableSize.

Member Function Documentation

◆ AddEntry()

bool ns3::zigbee::NeighborTable::AddEntry ( Ptr< NeighborTableEntry > entry)

Add an entry to the neighbor table.

Parameters
entryThe entry to be added to the neighbor table.
Returns
True if the entry was added to the table.

Definition at line 1005 of file zigbee-nwk-tables.cc.

References m_maxTableSize, and m_neighborTable.

Referenced by ns3::zigbee::ZigbeeNwk::MlmeAssociateIndication(), ns3::zigbee::ZigbeeNwk::MlmeBeaconNotifyIndication(), and ns3::zigbee::ZigbeeNwk::NlmeDirectJoinRequest().

+ Here is the caller graph for this function:

◆ Delete()

void ns3::zigbee::NeighborTable::Delete ( Mac64Address extAddr)

Delete the specified entry from the neighbor table.

Parameters
extAddrThe EUI-64 of the entry to be removed from the neighbor table

Definition at line 1027 of file zigbee-nwk-tables.cc.

References m_neighborTable.

Referenced by ns3::zigbee::ZigbeeNwk::MlmeAssociateIndication().

+ Here is the caller graph for this function:

◆ Dispose()

void ns3::zigbee::NeighborTable::Dispose ( )

Dispose of the table and all its elements.

Definition at line 1205 of file zigbee-nwk-tables.cc.

References m_neighborTable.

Referenced by ns3::zigbee::ZigbeeNwk::DoDispose().

+ Here is the caller graph for this function:

◆ GetLinkCost()

uint8_t ns3::zigbee::NeighborTable::GetLinkCost ( uint8_t lqi) const
private

Get the link cost based on the link quality indicator (LQI) value.

The calculation of the link cost is based on a non-linear mapping of the lqi. A link cost of 1 is the best possible value (equivalent to 255 LQI).

Parameters
lqiThe link quality indicator value (0-255)
Returns
The link cost value (1-7)

Definition at line 1166 of file zigbee-nwk-tables.cc.

References NS_ASSERT_MSG.

Referenced by LookUpForBestParent().

+ Here is the caller graph for this function:

◆ GetMaxTableSize()

uint32_t ns3::zigbee::NeighborTable::GetMaxTableSize ( ) const

Get the maximum size of the neighbor table.

Returns
The maximum size of the neighbor table.

Definition at line 1160 of file zigbee-nwk-tables.cc.

References m_maxTableSize.

◆ GetParent()

bool ns3::zigbee::NeighborTable::GetParent ( Ptr< NeighborTableEntry > & entryFound)

Look for this device Parent neighbor (A.K.A coordinator).

Parameters
entryFoundThe returned entry if found in the neighbor table.
Returns
True if the parent was found in the neighbor table.

Definition at line 1071 of file zigbee-nwk-tables.cc.

References m_neighborTable, ns3::zigbee::NBR_PARENT, and NS_LOG_FUNCTION.

Referenced by ns3::zigbee::ZigbeeNwk::NldeDataRequest().

+ Here is the caller graph for this function:

◆ GetSize()

uint32_t ns3::zigbee::NeighborTable::GetSize ( )

Get the size of the neighbor table.

Returns
The current size of the neighbor table

Definition at line 1148 of file zigbee-nwk-tables.cc.

References m_neighborTable.

Referenced by ns3::zigbee::ZigbeeNwk::NlmeDirectJoinRequest().

+ Here is the caller graph for this function:

◆ LookUpEntry() [1/2]

bool ns3::zigbee::NeighborTable::LookUpEntry ( Mac16Address nwkAddr,
Ptr< NeighborTableEntry > & entryFound )

Look and return and entry if exists in the neighbor table.

Parameters
nwkAddrThe network address used to look for an element in the table.
entryFoundThe returned entry if found in the neighbor table.
Returns
True if the entry was found false otherwise.

Definition at line 1035 of file zigbee-nwk-tables.cc.

References m_neighborTable, and NS_LOG_FUNCTION.

Referenced by ns3::zigbee::ZigbeeNwk::FindNextHop(), ns3::zigbee::ZigbeeNwk::FindRoute(), ns3::zigbee::ZigbeeNwk::McpsDataIndication(), ns3::zigbee::ZigbeeNwk::MlmeAssociateConfirm(), ns3::zigbee::ZigbeeNwk::MlmeAssociateIndication(), ns3::zigbee::ZigbeeNwk::MlmeBeaconNotifyIndication(), ns3::zigbee::ZigbeeNwk::MlmeOrphanIndication(), and ns3::zigbee::ZigbeeNwk::NlmeDirectJoinRequest().

+ Here is the caller graph for this function:

◆ LookUpEntry() [2/2]

bool ns3::zigbee::NeighborTable::LookUpEntry ( Mac64Address extAddr,
Ptr< NeighborTableEntry > & entryFound )

Look and return and entry if exists in the neighbor table.

Parameters
extAddrThe extended address (EUI-64) used to look for an element in the table.
entryFoundThe returned entry if found in the neighbor table.
Returns
True if the entry was found false otherwise.

Definition at line 1053 of file zigbee-nwk-tables.cc.

References m_neighborTable, and NS_LOG_FUNCTION.

◆ LookUpForBestParent()

bool ns3::zigbee::NeighborTable::LookUpForBestParent ( uint64_t epid,
Ptr< NeighborTableEntry > & entryFound )

Perform a search for the best candidate parent based on some attributes.

See Association Join process , Zigbee specification R21, Section 3.6.1.4.1

Parameters
epidThe extended PAN id of the network in which we look for parent candidates.
entryFoundThe returned entry if found
Returns
True if element found

Definition at line 1088 of file zigbee-nwk-tables.cc.

References GetLinkCost(), m_neighborTable, ns3::zigbee::ZIGBEE_COORDINATOR, and ns3::zigbee::ZIGBEE_ROUTER.

Referenced by ns3::zigbee::ZigbeeNwk::NlmeJoinRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Print()

void ns3::zigbee::NeighborTable::Print ( Ptr< OutputStreamWrapper > stream) const

Print the neighbor table.

Parameters
streamThe output stream where the table is printed

Definition at line 1119 of file zigbee-nwk-tables.cc.

References m_neighborTable.

Referenced by ns3::zigbee::ZigbeeNwk::PrintNeighborTable().

+ Here is the caller graph for this function:

◆ Purge()

void ns3::zigbee::NeighborTable::Purge ( )

Remove old entries from the neighbor table.

Definition at line 1019 of file zigbee-nwk-tables.cc.

References m_neighborTable, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ SetMaxTableSize()

void ns3::zigbee::NeighborTable::SetMaxTableSize ( uint32_t size)

Set the maximum size of the neighbor table.

Parameters
sizeThe size of the neighbor table.

Definition at line 1154 of file zigbee-nwk-tables.cc.

References m_maxTableSize.

Member Data Documentation

◆ m_maxTableSize

uint32_t ns3::zigbee::NeighborTable::m_maxTableSize
private

The maximum size of the neighbor table.

Definition at line 1198 of file zigbee-nwk-tables.h.

Referenced by NeighborTable(), AddEntry(), GetMaxTableSize(), and SetMaxTableSize().

◆ m_neighborTable

std::deque<Ptr<NeighborTableEntry> > ns3::zigbee::NeighborTable::m_neighborTable
private

The neighbor table object.

Definition at line 1197 of file zigbee-nwk-tables.h.

Referenced by AddEntry(), Delete(), Dispose(), GetParent(), GetSize(), LookUpEntry(), LookUpEntry(), LookUpForBestParent(), Print(), and Purge().


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