A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
Cid Allocate (Cid::Type type)
 This function returns the next CID for the specified type.
 
Cid AllocateBasic ()
 This function returns the next basic CID.
 
Cid AllocateMulticast ()
 This function returns the next Multicast CID.
 
Cid AllocatePrimary ()
 This function returns the next primary basic CID.
 
Cid AllocateTransportOrSecondary ()
 This function returns the next Transport (or Secondary) CID.
 
void FreeCid (Cid cid)
 Notify the factory that the connection associated to this cid has been killed and that this cid can be reused.
 
bool IsBasic (Cid cid) const
 This function determines if the CID is basic.
 
bool IsPrimary (Cid cid) const
 This function determines if the CID is primary.
 
bool IsTransport (Cid cid) const
 This function determines if the CID is a transport.
 

Private Attributes

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

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 34 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 20 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 63 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, and ns3::Cid::TRANSPORT.

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 31 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 55 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 39 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 47 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 109 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 102 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 95 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 88 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 97 of file cid-factory.h.

Referenced by AllocateBasic().

◆ m_m

uint16_t ns3::CidFactory::m_m
private

m

Definition at line 95 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 100 of file cid-factory.h.

Referenced by AllocateMulticast().

◆ m_primaryIdentifier

uint16_t ns3::CidFactory::m_primaryIdentifier
private

primary identifier

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

Referenced by AllocatePrimary().

◆ m_transportOrSecondaryIdentifier

uint16_t ns3::CidFactory::m_transportOrSecondaryIdentifier
private

transport or secondary identifier

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

Referenced by AllocateTransportOrSecondary().


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