A Discrete-Event Network Simulator
API
ns3::CidFactory Class Reference

This class is used exclusively by the BS to allocate CIDs to new connections. More...

#include "cid-factory.h"

+ Collaboration diagram for ns3::CidFactory:

Public Member Functions

 CidFactory ()
 Create a cid factory with a default value for m of 0x5500. More...
 
Cid Allocate (Cid::Type type)
 This function returns the next CID for the specified type. More...
 
Cid AllocateBasic ()
 This function returns the next basic CID. More...
 
Cid AllocateMulticast ()
 This function returns the next Multicast CID. More...
 
Cid AllocatePrimary ()
 This function returns the next primary basic CID. More...
 
Cid AllocateTransportOrSecondary ()
 This function returns the next Transport (or Secondary) CID. More...
 
void FreeCid (Cid cid)
 Notify the factory that the connection associated to this cid has been killed and that this cid can be reused. More...
 
bool IsBasic (Cid cid) const
 This function determines if the CID is basic. More...
 
bool IsPrimary (Cid cid) const
 This function determines if the CID is primary. More...
 
bool IsTransport (Cid cid) const
 This function determines if the CID is a transport. More...
 

Private Attributes

uint16_t m_basicIdentifier
 basic identifier More...
 
uint16_t m_m
 m More...
 
uint16_t m_multicastPollingIdentifier
 multicast polling identifier More...
 
uint16_t m_primaryIdentifier
 primary identifier More...
 
uint16_t m_transportOrSecondaryIdentifier
 transport or secondary identifier More...
 

Detailed Description

This class is used exclusively by the BS to allocate CIDs to new connections.

This class uses the definitions from Table 345 in ieee-802.16-2004 to allocate cids in different integer ranges according to their type. The relative allocation of the ranges is controlled by the parameter 'm' introduced in the above-mentioned table.

Note: The current implementation merely allocates cids sequentially from the start of the allowed range. A proper implementation would be able to recycle cids from previous dead connections and should instead look at a bitmap of free cids. Some other day :)

Definition at line 45 of file cid-factory.h.

Constructor & Destructor Documentation

◆ CidFactory()

ns3::CidFactory::CidFactory ( )

Create a cid factory with a default value for m of 0x5500.

Definition at line 31 of file cid-factory.cc.

Member Function Documentation

◆ Allocate()

Cid ns3::CidFactory::Allocate ( Cid::Type  type)

This function returns the next CID for the specified type.

Parameters
typeCID type
Returns
the next CID.

Definition at line 74 of file cid-factory.cc.

References AllocateBasic(), AllocateMulticast(), AllocatePrimary(), AllocateTransportOrSecondary(), ns3::Cid::BASIC, ns3::Cid::BROADCAST, ns3::Cid::Broadcast(), ns3::Cid::INITIAL_RANGING, ns3::Cid::InitialRanging(), ns3::Cid::MULTICAST, NS_FATAL_ERROR, ns3::Cid::PADDING, ns3::Cid::Padding(), ns3::Cid::PRIMARY, ns3::Cid::TRANSPORT, and check-style-clang-format::type.

Referenced by ns3::ConnectionManager::CreateConnection().

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

◆ AllocateBasic()

Cid ns3::CidFactory::AllocateBasic ( )

This function returns the next basic CID.

Returns
the next basic CID.

Definition at line 42 of file cid-factory.cc.

References m_basicIdentifier, m_m, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

◆ AllocateMulticast()

Cid ns3::CidFactory::AllocateMulticast ( )

This function returns the next Multicast CID.

Returns
the next Multicast CID.

Definition at line 66 of file cid-factory.cc.

References m_multicastPollingIdentifier, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

◆ AllocatePrimary()

Cid ns3::CidFactory::AllocatePrimary ( )

This function returns the next primary basic CID.

Returns
the next primary CID.

Definition at line 50 of file cid-factory.cc.

References m_m, m_primaryIdentifier, and NS_ASSERT.

Referenced by Allocate().

+ Here is the caller graph for this function:

◆ AllocateTransportOrSecondary()

Cid ns3::CidFactory::AllocateTransportOrSecondary ( )

This function returns the next Transport (or Secondary) CID.

Returns
the next Transport (or Secondary) CID.

Definition at line 58 of file cid-factory.cc.

References m_transportOrSecondaryIdentifier, and NS_ASSERT.

Referenced by Allocate(), and ns3::ConnectionManager::CreateConnection().

+ Here is the caller graph for this function:

◆ FreeCid()

void ns3::CidFactory::FreeCid ( Cid  cid)

Notify the factory that the connection associated to this cid has been killed and that this cid can be reused.

Parameters
cidCID type
Todo:
We need to update the cid bitmap properly here.

Definition at line 120 of file cid-factory.cc.

References NS_FATAL_ERROR.

◆ IsBasic()

bool ns3::CidFactory::IsBasic ( Cid  cid) const

This function determines if the CID is basic.

Parameters
cidCID type
Returns
true if the CID is basic.

Definition at line 113 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Referenced by ns3::BaseStationNetDevice::DoReceive(), and ns3::BaseStationNetDevice::UplinkAllocationEnd().

+ Here is the caller graph for this function:

◆ IsPrimary()

bool ns3::CidFactory::IsPrimary ( Cid  cid) const

This function determines if the CID is primary.

Parameters
cidCID type
Returns
true if the CID is primary.

Definition at line 106 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Referenced by ns3::BaseStationNetDevice::DoReceive().

+ Here is the caller graph for this function:

◆ IsTransport()

bool ns3::CidFactory::IsTransport ( Cid  cid) const

This function determines if the CID is a transport.

Parameters
cidCID type
Returns
true if the CID is a transport.

Definition at line 99 of file cid-factory.cc.

References ns3::Cid::m_identifier, and m_m.

Member Data Documentation

◆ m_basicIdentifier

uint16_t ns3::CidFactory::m_basicIdentifier
private

basic identifier

Definition at line 108 of file cid-factory.h.

Referenced by AllocateBasic().

◆ m_m

uint16_t ns3::CidFactory::m_m
private

m

Definition at line 106 of file cid-factory.h.

Referenced by AllocateBasic(), AllocatePrimary(), IsBasic(), IsPrimary(), and IsTransport().

◆ m_multicastPollingIdentifier

uint16_t ns3::CidFactory::m_multicastPollingIdentifier
private

multicast polling identifier

Definition at line 111 of file cid-factory.h.

Referenced by AllocateMulticast().

◆ m_primaryIdentifier

uint16_t ns3::CidFactory::m_primaryIdentifier
private

primary identifier

Definition at line 109 of file cid-factory.h.

Referenced by AllocatePrimary().

◆ m_transportOrSecondaryIdentifier

uint16_t ns3::CidFactory::m_transportOrSecondaryIdentifier
private

transport or secondary identifier

Definition at line 110 of file cid-factory.h.

Referenced by AllocateTransportOrSecondary().


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