Build a set of user nodes and links channels between user nodes and satellite nodes. More...
#include "satellite-user-helper.h"
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_t > | PropagationDelayCallback |
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... | |
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.
typedef Callback<Ptr<PropagationDelayModel>, uint32_t, uint32_t, SatEnums::ChannelType_t> ns3::SatUserHelper::PropagationDelayCallback |
Definition at line 276 of file satellite-user-helper.h.
typedef std::map<Ptr<Node>, NodeContainer> ns3::SatUserHelper::UtUsersContainer_t |
Define UT user container.
Definition at line 64 of file satellite-user-helper.h.
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.
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.
|
virtual |
Definition at line 108 of file satellite-user-helper.cc.
void ns3::SatUserHelper::EnableCreationTraces | ( | Ptr< OutputStreamWrapper > | stream, |
CallbackBase & | cb | ||
) |
Enables creation traces to be written in given file.
stream | stream for creation trace outputs |
cb | callback to connect traces |
Definition at line 321 of file satellite-user-helper.cc.
TypeId ns3::SatUserHelper::GetInstanceTypeId | ( | void | ) | const |
Derived from Object.
Definition at line 95 of file satellite-user-helper.cc.
References GetTypeId().
Ptr< Node > ns3::SatUserHelper::GetRouter | ( | ) | const |
Definition at line 476 of file satellite-user-helper.cc.
References m_router.
std::string ns3::SatUserHelper::GetRouterInfo | ( | ) | const |
Get router information.
Definition at line 448 of file satellite-user-helper.cc.
References m_router.
|
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().
|
private |
Install network between GW and Router (or users) or Router and its users.
c | node container having UT and its users |
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().
void ns3::SatUserHelper::InstallGw | ( | uint32_t | users | ) |
users | number 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.
|
private |
Install IP router to to Gateways.
Creates csma link between gateways and router.
router | pointer to IP router |
Definition at line 329 of file satellite-user-helper.cc.
References InstallBackboneNetwork(), and m_ipv4Gw.
Referenced by InstallGw().
|
private |
Install satellite simple network.
c | node container having UT and its users |
Definition at line 428 of file satellite-user-helper.cc.
Referenced by InstallBackboneNetwork(), and InstallSubscriberNetwork().
|
private |
Install network between UT and its users.
c | node container having UT and its users |
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().
NodeContainer ns3::SatUserHelper::InstallUt | ( | NodeContainer | ut, |
uint32_t | users | ||
) |
ut | a set of UT nodes |
users | number 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.
Definition at line 174 of file satellite-user-helper.cc.
NodeContainer ns3::SatUserHelper::InstallUt | ( | Ptr< Node > | ut, |
uint32_t | users | ||
) |
ut | a UT node |
users | number 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.
Definition at line 190 of file satellite-user-helper.cc.
References InstallSubscriberNetwork(), m_ipv4Ut, and m_utMap.
bool ns3::SatUserHelper::IsGwUser | ( | Ptr< Node > | node | ) | const |
Check if node is GW user or not.
node | Pointer to node checked if it is GW user or not |
Definition at line 301 of file satellite-user-helper.cc.
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.
ut | container having UTs of the beam |
utNd | container having UT netdevices of the beam |
gw | pointer to gateway node |
gwNd | pointer to gateway netdevice |
Definition at line 484 of file satellite-user-helper.cc.
References m_arpCachesToGateway, m_gwDevices, m_ipv4Beam, and m_utDevices.
void ns3::SatUserHelper::SetBeamBaseAddress | ( | const Ipv4Address & | network, |
const Ipv4Mask & | mask, | ||
Ipv4Address | base = "0.0.0.1" |
||
) |
network | The Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used. |
mask | The Ipv4Mask containing one bits in each bit position of the network number. |
base | An 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.
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.
name | the name of the attribute to set |
value | the 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.
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.
name | the name of the attribute to set |
value | the 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.
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.
type | the type of queue |
name1 | the name of the attribute to set on the queue |
value1 | the value of the attribute to set on the queue |
name2 | the name of the attribute to set on the queue |
value2 | the value of the attribute to set on the queue |
name3 | the name of the attribute to set on the queue |
value3 | the value of the attribute to set on the queue |
name4 | the name of the attribute to set on the queue |
value4 | the 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.
void ns3::SatUserHelper::SetGwBaseAddress | ( | const Ipv4Address & | network, |
const Ipv4Mask & | mask, | ||
Ipv4Address | base = "0.0.0.1" |
||
) |
network | The Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used. |
mask | The Ipv4Mask containing one bits in each bit position of the network number. |
base | An 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.
void ns3::SatUserHelper::SetUtBaseAddress | ( | const Ipv4Address & | network, |
const Ipv4Mask & | mask, | ||
Ipv4Address | base = "0.0.0.1" |
||
) |
network | The Ipv4Address containing the initial network number to use for satellite network allocation. The bits outside the network mask are not used. |
mask | The Ipv4Mask containing one bits in each bit position of the network number. |
base | An 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.
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.
ut | Address of the UT which was just handed over |
oldGateway | Address of the GW the UT was assigned to |
newGateway | Address 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().
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.
ut | Address of the UT for which tables should be updated |
newGateway | Address of the newly assigned GW for this UT |
ulDelayModel | The 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().
|
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().
|
private |
Definition at line 315 of file satellite-user-helper.h.
Referenced by GetTypeId(), and InstallBackboneNetwork().
|
private |
Trace callback for creation traces.
Definition at line 337 of file satellite-user-helper.h.
Referenced by GetTypeId().
|
private |
Definition at line 310 of file satellite-user-helper.h.
Referenced by InstallBackboneNetwork(), InstallSubscriberNetwork(), SetCsmaChannelAttribute(), SetCsmaDeviceAttribute(), and SetCsmaQueue().
|
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().
|
private |
Definition at line 313 of file satellite-user-helper.h.
Referenced by PopulateBeamRoutings(), and SetBeamBaseAddress().
|
private |
Definition at line 312 of file satellite-user-helper.h.
Referenced by InstallGw(), InstallRouter(), and SetGwBaseAddress().
|
private |
Definition at line 311 of file satellite-user-helper.h.
Referenced by InstallUt(), and SetUtBaseAddress().
|
private |
Definition at line 360 of file satellite-user-helper.h.
Referenced by GetTypeId(), and UpdateUtRoutes().
|
private |
Definition at line 318 of file satellite-user-helper.h.
Referenced by GetRouter(), GetRouterInfo(), InstallGw(), and UpdateGwRoutes().
|
private |
Definition at line 316 of file satellite-user-helper.h.
Referenced by GetTypeId(), and InstallSubscriberNetwork().
|
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().
|
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().