ns3::SatUserHelper Class Reference

Build a set of user nodes and links channels between user nodes and satellite nodes. More...

#include "satellite-user-helper.h"

+ Inheritance diagram for ns3::SatUserHelper:
+ Collaboration diagram for ns3::SatUserHelper:

Public Types

enum  NetworkType { NETWORK_TYPE_SAT_SIMPLE , NETWORK_TYPE_CSMA }
 Network types in user networks (subscriber or backbone) More...
 
typedef Callback< Ptr< PropagationDelayModel >, uint32_t, uint32_t, SatEnums::ChannelType_tPropagationDelayCallback
 
typedef std::map< Ptr< Node >, NodeContainer > UtUsersContainer_t
 Define UT user container. More...
 

Public Member Functions

 SatUserHelper ()
 Create a SatUserHelper to make life easier when creating Users and their connections to satellite network. More...
 
virtual ~SatUserHelper ()
 
void EnableCreationTraces (Ptr< OutputStreamWrapper > stream, CallbackBase &cb)
 Enables creation traces to be written in given file. More...
 
TypeId GetInstanceTypeId (void) const
 Derived from Object. More...
 
Ptr< Node > GetRouter () const
 
std::string GetRouterInfo () const
 Get router information. More...
 
void InstallGw (uint32_t users)
 
NodeContainer InstallUt (NodeContainer ut, uint32_t users)
 
NodeContainer InstallUt (Ptr< Node > ut, uint32_t users)
 
bool IsGwUser (Ptr< Node > node) const
 Check if node is GW user or not. More...
 
void PopulateBeamRoutings (NodeContainer ut, NetDeviceContainer utNd, Ptr< Node > gw, Ptr< NetDevice > gwNd)
 Set needed routings of satellite network and fill ARP cache for the network. More...
 
void SetBeamBaseAddress (const Ipv4Address &network, const Ipv4Mask &mask, Ipv4Address base="0.0.0.1")
 
void SetCsmaChannelAttribute (std::string name, const AttributeValue &value)
 Set an attribute value to be propagated to each CsmaChannel object created by the helper. More...
 
void SetCsmaDeviceAttribute (std::string name, const AttributeValue &value)
 Set an attribute value to be propagated to each CsmaNetDevice object created by the helper. More...
 
void SetCsmaQueue (std::string type, std::string name1="", const AttributeValue &value1=EmptyAttributeValue(), std::string name2="", const AttributeValue &value2=EmptyAttributeValue(), std::string name3="", const AttributeValue &value3=EmptyAttributeValue(), std::string name4="", const AttributeValue &value4=EmptyAttributeValue())
 Set the type and the attribute values to be associated with each Queue object in each CsmaNetDevice created by the helper. More...
 
void SetGwBaseAddress (const Ipv4Address &network, const Ipv4Mask &mask, Ipv4Address base="0.0.0.1")
 
void SetUtBaseAddress (const Ipv4Address &network, const Ipv4Mask &mask, Ipv4Address base="0.0.0.1")
 
void UpdateGwRoutes (Address ut, Address oldGateway, Address newGateway)
 Update ARP cache and default route on the terrestrial network so packets are properly routed to the UT handed over. More...
 
void UpdateUtRoutes (Address ut, Address newGateway)
 Update ARP cache and default route on an UT so packets are properly routed to the new GW as their next hop. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Derived from Object. More...
 

Private Member Functions

NetDeviceContainer InstallBackboneNetwork (const NodeContainer &c) const
 Install network between GW and Router (or users) or Router and its users. More...
 
void InstallRouter (Ptr< Node > router)
 Install IP router to to Gateways. More...
 
NetDeviceContainer InstallSatSimpleNetwork (const NodeContainer &c) const
 Install satellite simple network. More...
 
NetDeviceContainer InstallSubscriberNetwork (const NodeContainer &c) const
 Install network between UT and its users. More...
 

Private Attributes

std::map< Address, Ptr< SatArpCache > > m_arpCachesToGateway
 Container of ARP tables to reach a gateway accessible by MAC address. More...
 
NetworkType m_backboneNetworkType
 
TracedCallback< std::string > m_creationTrace
 Trace callback for creation traces. More...
 
CsmaHelper m_csma
 
std::map< Address, Ptr< NetDevice > > m_gwDevices
 Container of GW SatNetDevice accessible by MAC address. More...
 
Ipv4AddressHelper m_ipv4Beam
 
Ipv4AddressHelper m_ipv4Gw
 
Ipv4AddressHelper m_ipv4Ut
 
SatUserHelper::PropagationDelayCallback m_propagationDelayCallback
 
Ptr< Node > m_router
 
NetworkType m_subscriberNetworkType
 
std::map< Address, Ptr< NetDevice > > m_utDevices
 Container of UT SatNetDevice accessible by MAC address. More...
 
std::map< Ptr< Node >, Ptr< Node > > m_utMap
 Container of UT users and their corresponding UT. More...
 

Detailed Description

Build a set of user nodes and links channels between user nodes and satellite nodes.

Definition at line 49 of file satellite-user-helper.h.

Member Typedef Documentation

◆ PropagationDelayCallback

typedef Callback<Ptr<PropagationDelayModel>, uint32_t, uint32_t, SatEnums::ChannelType_t> ns3::SatUserHelper::PropagationDelayCallback

Definition at line 276 of file satellite-user-helper.h.

◆ UtUsersContainer_t

typedef std::map<Ptr<Node>, NodeContainer> ns3::SatUserHelper::UtUsersContainer_t

Define UT user container.

Definition at line 64 of file satellite-user-helper.h.

Member Enumeration Documentation

◆ NetworkType

Network types in user networks (subscriber or backbone)

Enumerator
NETWORK_TYPE_SAT_SIMPLE 
NETWORK_TYPE_CSMA 

Definition at line 55 of file satellite-user-helper.h.

Constructor & Destructor Documentation

◆ SatUserHelper()

ns3::SatUserHelper::SatUserHelper ( )

Create a SatUserHelper to make life easier when creating Users and their connections to satellite network.

Definition at line 100 of file satellite-user-helper.cc.

◆ ~SatUserHelper()

ns3::SatUserHelper::~SatUserHelper ( )
virtual

Definition at line 108 of file satellite-user-helper.cc.

Member Function Documentation

◆ EnableCreationTraces()

void ns3::SatUserHelper::EnableCreationTraces ( Ptr< OutputStreamWrapper >  stream,
CallbackBase &  cb 
)

Enables creation traces to be written in given file.

Parameters
streamstream for creation trace outputs
cbcallback to connect traces

Definition at line 321 of file satellite-user-helper.cc.

◆ GetInstanceTypeId()

TypeId ns3::SatUserHelper::GetInstanceTypeId ( void  ) const

Derived from Object.

Definition at line 95 of file satellite-user-helper.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetRouter()

Ptr< Node > ns3::SatUserHelper::GetRouter ( ) const
Returns
pointer to the router.

Definition at line 476 of file satellite-user-helper.cc.

References m_router.

◆ GetRouterInfo()

std::string ns3::SatUserHelper::GetRouterInfo ( ) const

Get router information.

Returns
Information of router used between GWs and users.

Definition at line 448 of file satellite-user-helper.cc.

References m_router.

◆ GetTypeId()

TypeId ns3::SatUserHelper::GetTypeId ( void  )
static

Derived from Object.

Definition at line 57 of file satellite-user-helper.cc.

References m_backboneNetworkType, m_creationTrace, m_propagationDelayCallback, m_subscriberNetworkType, NETWORK_TYPE_CSMA, and NETWORK_TYPE_SAT_SIMPLE.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ InstallBackboneNetwork()

NetDeviceContainer ns3::SatUserHelper::InstallBackboneNetwork ( const NodeContainer &  c) const
private

Install network between GW and Router (or users) or Router and its users.

Parameters
cnode container having UT and its users
Returns
container of the installed net devices

Definition at line 403 of file satellite-user-helper.cc.

References InstallSatSimpleNetwork(), m_backboneNetworkType, m_csma, NETWORK_TYPE_CSMA, and NETWORK_TYPE_SAT_SIMPLE.

Referenced by InstallGw(), and InstallRouter().

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

◆ InstallGw()

void ns3::SatUserHelper::InstallGw ( uint32_t  users)
Parameters
usersnumber of users to install for GWs. If gw has more than one GWs then IP router is added between GWs and users.

This method creates users with the requested attributes to satellite network and add csma net device on them and csma channel between GW and their users. In case of more than one GW channel is created between GW and router and between router and users.

Definition at line 246 of file satellite-user-helper.cc.

References InstallBackboneNetwork(), InstallRouter(), m_ipv4Gw, and m_router.

+ Here is the call graph for this function:

◆ InstallRouter()

void ns3::SatUserHelper::InstallRouter ( Ptr< Node >  router)
private

Install IP router to to Gateways.

Creates csma link between gateways and router.

Parameters
routerpointer to IP router

Definition at line 329 of file satellite-user-helper.cc.

References InstallBackboneNetwork(), and m_ipv4Gw.

Referenced by InstallGw().

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

◆ InstallSatSimpleNetwork()

NetDeviceContainer ns3::SatUserHelper::InstallSatSimpleNetwork ( const NodeContainer &  c) const
private

Install satellite simple network.

Parameters
cnode container having UT and its users
Returns
container of the installed net devices

Definition at line 428 of file satellite-user-helper.cc.

Referenced by InstallBackboneNetwork(), and InstallSubscriberNetwork().

+ Here is the caller graph for this function:

◆ InstallSubscriberNetwork()

NetDeviceContainer ns3::SatUserHelper::InstallSubscriberNetwork ( const NodeContainer &  c) const
private

Install network between UT and its users.

Parameters
cnode container having UT and its users
Returns
container of the installed net devices

Definition at line 378 of file satellite-user-helper.cc.

References InstallSatSimpleNetwork(), m_csma, m_subscriberNetworkType, NETWORK_TYPE_CSMA, and NETWORK_TYPE_SAT_SIMPLE.

Referenced by InstallUt().

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

◆ InstallUt() [1/2]

NodeContainer ns3::SatUserHelper::InstallUt ( NodeContainer  ut,
uint32_t  users 
)
Parameters
uta set of UT nodes
usersnumber of users to install for every UT

This method creates users with the requested attributes to satellite network and add csma netdevice on them and csma channel between UTs/GW and their users.

Returns
node container of created users for the UT.

Definition at line 174 of file satellite-user-helper.cc.

◆ InstallUt() [2/2]

NodeContainer ns3::SatUserHelper::InstallUt ( Ptr< Node >  ut,
uint32_t  users 
)
Parameters
uta UT node
usersnumber of users to install for the UT

This method creates users with the requested attributes to satellite network and add csma netdevice on them and csma channel between UT/GW and their users.

Returns
node container of created users for the UTs.

Definition at line 190 of file satellite-user-helper.cc.

References InstallSubscriberNetwork(), m_ipv4Ut, and m_utMap.

+ Here is the call graph for this function:

◆ IsGwUser()

bool ns3::SatUserHelper::IsGwUser ( Ptr< Node >  node) const

Check if node is GW user or not.

Parameters
nodePointer to node checked if it is GW user or not
Returns
true when requested node is GW user node, false in other case.

Definition at line 301 of file satellite-user-helper.cc.

◆ PopulateBeamRoutings()

void ns3::SatUserHelper::PopulateBeamRoutings ( NodeContainer  ut,
NetDeviceContainer  utNd,
Ptr< Node >  gw,
Ptr< NetDevice >  gwNd 
)

Set needed routings of satellite network and fill ARP cache for the network.

Parameters
utcontainer having UTs of the beam
utNdcontainer having UT netdevices of the beam
gwpointer to gateway node
gwNdpointer to gateway netdevice

Definition at line 484 of file satellite-user-helper.cc.

References m_arpCachesToGateway, m_gwDevices, m_ipv4Beam, and m_utDevices.

◆ SetBeamBaseAddress()

void ns3::SatUserHelper::SetBeamBaseAddress ( const Ipv4Address &  network,
const Ipv4Mask &  mask,
Ipv4Address  base = "0.0.0.1" 
)
Parameters
networkThe Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used.
maskThe Ipv4Mask containing one bits in each bit position of the network number.
baseAn optional Ipv4Address containing the initial address used for IP address allocation. Will be combined (ORed) with the network number to generate the first IP address. Defaults to 0.0.0.1.

Definition at line 164 of file satellite-user-helper.cc.

References m_ipv4Beam.

◆ SetCsmaChannelAttribute()

void ns3::SatUserHelper::SetCsmaChannelAttribute ( std::string  name,
const AttributeValue &  value 
)

Set an attribute value to be propagated to each CsmaChannel object created by the helper.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Set these attribute on each ns3::CsmaChannel created by SatUserHelper::Install().

Definition at line 137 of file satellite-user-helper.cc.

References m_csma.

◆ SetCsmaDeviceAttribute()

void ns3::SatUserHelper::SetCsmaDeviceAttribute ( std::string  name,
const AttributeValue &  value 
)

Set an attribute value to be propagated to each CsmaNetDevice object created by the helper.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Set these attributes on each ns3::CsmaNetDevice created by SatUserHelper::Install().

Definition at line 130 of file satellite-user-helper.cc.

References m_csma.

◆ SetCsmaQueue()

void ns3::SatUserHelper::SetCsmaQueue ( std::string  type,
std::string  name1 = "",
const AttributeValue &  value1 = EmptyAttributeValue(),
std::string  name2 = "",
const AttributeValue &  value2 = EmptyAttributeValue(),
std::string  name3 = "",
const AttributeValue &  value3 = EmptyAttributeValue(),
std::string  name4 = "",
const AttributeValue &  value4 = EmptyAttributeValue() 
)

Set the type and the attribute values to be associated with each Queue object in each CsmaNetDevice created by the helper.

Parameters
typethe type of queue
name1the name of the attribute to set on the queue
value1the value of the attribute to set on the queue
name2the name of the attribute to set on the queue
value2the value of the attribute to set on the queue
name3the name of the attribute to set on the queue
value3the value of the attribute to set on the queue
name4the name of the attribute to set on the queue
value4the value of the attribute to set on the queue

Set these attributes on each ns3::Queue created by SatUserHelper::Install().

Definition at line 114 of file satellite-user-helper.cc.

References m_csma.

◆ SetGwBaseAddress()

void ns3::SatUserHelper::SetGwBaseAddress ( const Ipv4Address &  network,
const Ipv4Mask &  mask,
Ipv4Address  base = "0.0.0.1" 
)
Parameters
networkThe Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used.
maskThe Ipv4Mask containing one bits in each bit position of the network number.
baseAn optional Ipv4Address containing the initial address used for IP address allocation. Will be combined (ORed) with the network number to generate the first IP address. Defaults to 0.0.0.1.

Definition at line 154 of file satellite-user-helper.cc.

References m_ipv4Gw.

◆ SetUtBaseAddress()

void ns3::SatUserHelper::SetUtBaseAddress ( const Ipv4Address &  network,
const Ipv4Mask &  mask,
Ipv4Address  base = "0.0.0.1" 
)
Parameters
networkThe Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used.
maskThe Ipv4Mask containing one bits in each bit position of the network number.
baseAn optional Ipv4Address containing the initial address used for IP address allocation. Will be combined (ORed) with the network number to generate the first IP address. Defaults to 0.0.0.1.

Definition at line 144 of file satellite-user-helper.cc.

References m_ipv4Ut.

◆ UpdateGwRoutes()

void ns3::SatUserHelper::UpdateGwRoutes ( Address  ut,
Address  oldGateway,
Address  newGateway 
)

Update ARP cache and default route on the terrestrial network so packets are properly routed to the UT handed over.

Parameters
utAddress of the UT which was just handed over
oldGatewayAddress of the GW the UT was assigned to
newGatewayAddress of the GW the UT is newly assigned to

Definition at line 622 of file satellite-user-helper.cc.

References m_gwDevices, m_router, and m_utDevices.

Referenced by ns3::SatHelper::DoCreateScenario().

+ Here is the caller graph for this function:

◆ UpdateUtRoutes()

void ns3::SatUserHelper::UpdateUtRoutes ( Address  ut,
Address  newGateway 
)

Update ARP cache and default route on an UT so packets are properly routed to the new GW as their next hop.

Parameters
utAddress of the UT for which tables should be updated
newGatewayAddress of the newly assigned GW for this UT
ulDelayModelThe delay model used by the UT return link

Definition at line 573 of file satellite-user-helper.cc.

References m_arpCachesToGateway, m_gwDevices, m_propagationDelayCallback, m_utDevices, ns3::SatMobilityObserver::ObserveTimingAdvance(), ns3::SatEnums::RETURN_FEEDER_CH, and ns3::SatEnums::RETURN_USER_CH.

Referenced by ns3::SatHelper::DoCreateScenario().

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

Member Data Documentation

◆ m_arpCachesToGateway

std::map<Address, Ptr<SatArpCache> > ns3::SatUserHelper::m_arpCachesToGateway
private

Container of ARP tables to reach a gateway accessible by MAC address.

Used to update routing during handover

Definition at line 358 of file satellite-user-helper.h.

Referenced by PopulateBeamRoutings(), and UpdateUtRoutes().

◆ m_backboneNetworkType

NetworkType ns3::SatUserHelper::m_backboneNetworkType
private

Definition at line 315 of file satellite-user-helper.h.

Referenced by GetTypeId(), and InstallBackboneNetwork().

◆ m_creationTrace

TracedCallback<std::string> ns3::SatUserHelper::m_creationTrace
private

Trace callback for creation traces.

Definition at line 337 of file satellite-user-helper.h.

Referenced by GetTypeId().

◆ m_csma

CsmaHelper ns3::SatUserHelper::m_csma
private

◆ m_gwDevices

std::map<Address, Ptr<NetDevice> > ns3::SatUserHelper::m_gwDevices
private

Container of GW SatNetDevice accessible by MAC address.

Used to update routing during handover

Definition at line 351 of file satellite-user-helper.h.

Referenced by PopulateBeamRoutings(), UpdateGwRoutes(), and UpdateUtRoutes().

◆ m_ipv4Beam

Ipv4AddressHelper ns3::SatUserHelper::m_ipv4Beam
private

Definition at line 313 of file satellite-user-helper.h.

Referenced by PopulateBeamRoutings(), and SetBeamBaseAddress().

◆ m_ipv4Gw

Ipv4AddressHelper ns3::SatUserHelper::m_ipv4Gw
private

Definition at line 312 of file satellite-user-helper.h.

Referenced by InstallGw(), InstallRouter(), and SetGwBaseAddress().

◆ m_ipv4Ut

Ipv4AddressHelper ns3::SatUserHelper::m_ipv4Ut
private

Definition at line 311 of file satellite-user-helper.h.

Referenced by InstallUt(), and SetUtBaseAddress().

◆ m_propagationDelayCallback

SatUserHelper::PropagationDelayCallback ns3::SatUserHelper::m_propagationDelayCallback
private

Definition at line 360 of file satellite-user-helper.h.

Referenced by GetTypeId(), and UpdateUtRoutes().

◆ m_router

Ptr<Node> ns3::SatUserHelper::m_router
private

Definition at line 318 of file satellite-user-helper.h.

Referenced by GetRouter(), GetRouterInfo(), InstallGw(), and UpdateGwRoutes().

◆ m_subscriberNetworkType

NetworkType ns3::SatUserHelper::m_subscriberNetworkType
private

Definition at line 316 of file satellite-user-helper.h.

Referenced by GetTypeId(), and InstallSubscriberNetwork().

◆ m_utDevices

std::map<Address, Ptr<NetDevice> > ns3::SatUserHelper::m_utDevices
private

Container of UT SatNetDevice accessible by MAC address.

Used to update routing during handover

Definition at line 344 of file satellite-user-helper.h.

Referenced by PopulateBeamRoutings(), UpdateGwRoutes(), and UpdateUtRoutes().

◆ m_utMap

std::map<Ptr<Node>, Ptr<Node> > ns3::SatUserHelper::m_utMap
private

Container of UT users and their corresponding UT.

The data structure is a map which each key is a pointer to the UT user node. The corresponding value is a pointer to the UT node which serves the corresponding UT user node.

The member is redundant, in a sense that #m_utUsers also stores the same set of pointers to UT users. This approach is taken to preserve the ordering of the node pointers in #m_utUsers, which is difficult to be replicated as a map.

Definition at line 332 of file satellite-user-helper.h.

Referenced by InstallUt().


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