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... | |
uint32_t | GetGwUserCount () const |
NodeContainer | GetGwUsers () const |
TypeId | GetInstanceTypeId (void) const |
Derived from Object. More... | |
Ptr< Node > | GetRouter () const |
std::string | GetRouterInfo () const |
Get router information. More... | |
Ptr< Node > | GetUtNode (Ptr< Node > utUserNode) const |
NodeContainer | GetUtNodes () const |
uint32_t | GetUtUserCount () const |
uint32_t | GetUtUserCount (Ptr< Node > ut) const |
NodeContainer | GetUtUsers () const |
NodeContainer | GetUtUsers (Ptr< Node > ut) const |
NodeContainer | InstallGw (NodeContainer gw, 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 (NodeContainer gw, 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 | |
NodeContainer | m_allUtUsers |
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... | |
NodeContainer | m_gwUsers |
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... | |
UtUsersContainer_t | m_utUsers |
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 323 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 90 of file satellite-user-helper.cc.
|
virtual |
Definition at line 98 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 405 of file satellite-user-helper.cc.
uint32_t ns3::SatUserHelper::GetGwUserCount | ( | ) | const |
Definition at line 347 of file satellite-user-helper.cc.
References m_gwUsers.
NodeContainer ns3::SatUserHelper::GetGwUsers | ( | ) | const |
Definition at line 297 of file satellite-user-helper.cc.
References m_gwUsers.
TypeId ns3::SatUserHelper::GetInstanceTypeId | ( | void | ) | const |
Derived from Object.
Definition at line 85 of file satellite-user-helper.cc.
References GetTypeId().
Ptr< Node > ns3::SatUserHelper::GetRouter | ( | ) | const |
Definition at line 558 of file satellite-user-helper.cc.
References m_router.
std::string ns3::SatUserHelper::GetRouterInfo | ( | ) | const |
Get router information.
Definition at line 530 of file satellite-user-helper.cc.
References m_router.
|
static |
Derived from Object.
Definition at line 49 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().
Ptr< Node > ns3::SatUserHelper::GetUtNode | ( | Ptr< Node > | utUserNode | ) | const |
utUserNode | Pointer to the UT user node |
Definition at line 378 of file satellite-user-helper.cc.
References m_utMap.
NodeContainer ns3::SatUserHelper::GetUtNodes | ( | ) | const |
Definition at line 393 of file satellite-user-helper.cc.
References m_utUsers.
uint32_t ns3::SatUserHelper::GetUtUserCount | ( | ) | const |
Definition at line 355 of file satellite-user-helper.cc.
References m_allUtUsers.
uint32_t ns3::SatUserHelper::GetUtUserCount | ( | Ptr< Node > | ut | ) | const |
ut | Pointer to UT node, which user node count is requested. |
Definition at line 363 of file satellite-user-helper.cc.
References m_utUsers.
NodeContainer ns3::SatUserHelper::GetUtUsers | ( | ) | const |
Definition at line 324 of file satellite-user-helper.cc.
References m_allUtUsers.
NodeContainer ns3::SatUserHelper::GetUtUsers | ( | Ptr< Node > | ut | ) | const |
ut | Pointer to UT node, which user nodes are requested. |
Definition at line 332 of file satellite-user-helper.cc.
References m_utUsers.
|
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 485 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().
NodeContainer ns3::SatUserHelper::InstallGw | ( | NodeContainer | gw, |
uint32_t | users | ||
) |
gw | a set of GW nodes |
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 241 of file satellite-user-helper.cc.
References InstallBackboneNetwork(), InstallRouter(), m_gwUsers, m_ipv4Gw, and m_router.
|
private |
Install IP router to to Gateways.
Creates csma link between gateways and router.
gw | container having GWs |
router | pointer to IP router |
Definition at line 413 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 510 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 460 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 164 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 180 of file satellite-user-helper.cc.
References InstallSubscriberNetwork(), m_allUtUsers, m_ipv4Ut, m_utMap, and m_utUsers.
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 305 of file satellite-user-helper.cc.
References m_gwUsers.
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 566 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 154 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 127 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 120 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 104 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 144 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 134 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 701 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 655 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 |
Definition at line 365 of file satellite-user-helper.h.
Referenced by GetUtUserCount(), GetUtUsers(), and InstallUt().
|
private |
Container of ARP tables to reach a gateway accessible by MAC address.
Used to update routing during handover
Definition at line 410 of file satellite-user-helper.h.
Referenced by PopulateBeamRoutings(), and UpdateUtRoutes().
|
private |
Definition at line 367 of file satellite-user-helper.h.
Referenced by GetTypeId(), and InstallBackboneNetwork().
|
private |
Trace callback for creation traces.
Definition at line 389 of file satellite-user-helper.h.
Referenced by GetTypeId().
|
private |
Definition at line 358 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 403 of file satellite-user-helper.h.
Referenced by PopulateBeamRoutings(), UpdateGwRoutes(), and UpdateUtRoutes().
|
private |
Definition at line 363 of file satellite-user-helper.h.
Referenced by GetGwUserCount(), GetGwUsers(), InstallGw(), and IsGwUser().
|
private |
Definition at line 361 of file satellite-user-helper.h.
Referenced by PopulateBeamRoutings(), and SetBeamBaseAddress().
|
private |
Definition at line 360 of file satellite-user-helper.h.
Referenced by InstallGw(), InstallRouter(), and SetGwBaseAddress().
|
private |
Definition at line 359 of file satellite-user-helper.h.
Referenced by InstallUt(), and SetUtBaseAddress().
|
private |
Definition at line 412 of file satellite-user-helper.h.
Referenced by GetTypeId(), and UpdateUtRoutes().
|
private |
Definition at line 370 of file satellite-user-helper.h.
Referenced by GetRouter(), GetRouterInfo(), InstallGw(), and UpdateGwRoutes().
|
private |
Definition at line 368 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 396 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 384 of file satellite-user-helper.h.
Referenced by GetUtNode(), and InstallUt().
|
private |
Definition at line 364 of file satellite-user-helper.h.
Referenced by GetUtNodes(), GetUtUserCount(), GetUtUsers(), and InstallUt().