20 #ifndef __SATELLITE_HELPER_H__
21 #define __SATELLITE_HELPER_H__
29 #include <ns3/csma-helper.h>
30 #include <ns3/ipv4-address-helper.h>
31 #include <ns3/node-container.h>
32 #include <ns3/object.h>
33 #include <ns3/output-stream-wrapper.h>
34 #include <ns3/satellite-antenna-gain-pattern-container.h>
35 #include <ns3/satellite-fading-input-trace-container.h>
36 #include <ns3/satellite-fading-output-trace-container.h>
37 #include <ns3/satellite-interference-input-trace-container.h>
38 #include <ns3/satellite-interference-output-trace-container.h>
39 #include <ns3/satellite-position-allocator.h>
40 #include <ns3/satellite-rx-power-input-trace-container.h>
41 #include <ns3/satellite-rx-power-output-trace-container.h>
42 #include <ns3/satellite-stats-helper-container.h>
43 #include <ns3/trace-helper.h>
143 std::string inputFileUtListPositions,
258 NodeContainer receivers,
259 Ipv4Address sourceAddress,
260 Ipv4Address groupAddress);
485 std::vector<std::pair<uint32_t, uint32_t>>& isls);
558 void SetUtMobility(NodeContainer uts, uint32_t satId, uint32_t beamId);
573 std::vector<std::pair<GeoCoordinate, uint32_t>> positionsAndGroupId);
605 std::pair<Ptr<NetDevice>, Ptr<NetDevice>>& matchingDevices);
630 NodeContainer receivers,
632 Ptr<NetDevice>& routerUserOutputDev);
649 const Ipv4Address& firstNetwork,
650 const Ipv4Mask& mask,
651 const std::set<uint32_t>& networkAddresses,
652 uint32_t networkCount,
653 uint32_t hostCount)
const;
std::set< Ptr< Node > > MulticastBeamInfoItem_t
std::map< uint32_t, std::set< Ptr< Node > > > MulticastBeamInfo_t
Class that holds information for each beam regarding UTs and their users camped in each beam.
Standard_t
The global standard used.
Build a satellite network set with needed objects and configuration.
Ptr< SatUserHelper > GetUserHelper() const
void LoadConstellationTopology(std::vector< std::string > &tles, std::vector< std::pair< uint32_t, uint32_t >> &isls)
Load a constellation topology.
std::string m_waveformConfDirectoryName
void CreatePredefinedScenario(PreDefinedScenario_t scenario)
Create a pre-defined SatHelper to make life easier when creating Satellite topologies.
Ipv4Mask m_beamNetworkMask
Network mask number of satellite devices.
std::string m_utCreationFileName
File name for UT creation trace output.
SatHelper()
Default constructor.
static void CreationDetailsSink(Ptr< OutputStreamWrapper > stream, std::string context, std::string info)
Sink for creation details traces.
SatEnums::Standard_t m_standard
std::multimap< uint32_t, uint32_t > m_mobileUtsUsersByBeam
List of users by mobile UT by beam ID.
void SetUtMobilityFromPosition(NodeContainer uts, uint32_t satId, uint32_t beamId, std::vector< std::pair< GeoCoordinate, uint32_t >> positionsAndGroupId)
Sets mobility to created UT nodes when position is known.
Ptr< SatSpotBeamPositionAllocator > GetBeamAllocator(uint32_t beamId)
Create a SatSpotBeamPositionAllocator able to generate random position within the given beam.
Ipv4Address m_beamNetworkAddress
Initial network number of satellite devices, e.g., 10.1.1.0.
std::string m_wfConfigFileName
File name for Waveform configurations file.
void CreateLargerScenario()
Creates satellite objects according to larger scenario.
bool m_handoversEnabled
Enable handovers for all UTs and GWs.
void SetGwMobility(NodeContainer gwNodes)
Sets mobilities to created GW nodes.
Ipv4Address m_gwNetworkAddress
Initial network number of GW, router, and GW users, e.g., 10.2.1.0.
Callback< uint32_t > GetNextUtUserCountCallback
Get number of Users for a UT.
void CheckNetwork(std::string networkName, const Ipv4Address &firstNetwork, const Ipv4Mask &mask, const std::set< uint32_t > &networkAddresses, uint32_t networkCount, uint32_t hostCount) const
Check validity of the configured network space.
Ipv4Mask m_utNetworkMask
Network mask number of UT and UT users.
void InstallMobilityObserver(uint32_t satId, NodeContainer nodes) const
Install Satellite Mobility Observer to nodes, if observer doesn't exist already in a node.
void ReadStandard(std::string pathName)
Read to standard use from file given in path.
static TypeId GetTypeId(void)
Get the type ID.
void SetGwAddressInUts()
Set the value of GW address for each UT.
std::string m_scenarioCreationFileName
File name for scenario creation trace output.
BeamUserInfoMap_t m_beamUserInfos
Info for beam creation in user defined scenario.
void DoCreateScenario(BeamUserInfoMap_t &info, uint32_t gwUsers)
Creates satellite objects according to given beam info.
uint32_t m_utsInBeam
Number of UTs created per Beam in full or user-defined scenario.
std::string m_scenarioPath
Scenario folder path.
std::string m_gwPosFileName
Ipv4Address GetUserAddress(Ptr< Node > node)
void SetCustomUtPositionAllocator(Ptr< SatListPositionAllocator > posAllocator)
Set custom position allocator.
void SetGroupHelper(Ptr< SatGroupHelper > groupHelper)
set the group helper.
std::string m_fwdConfFileName
bool m_creationTraces
flag to indicate if creation trace should be enabled for scenario creation.
virtual ~SatHelper()
Destructor for SatHelper.
void SetBeamRoutingConstellations()
Populate the routes, when using constellations.
SatBeamHelper::MulticastBeamInfo_t MulticastBeamInfo_t
static const uint16_t MAX_ADDRESS_PREFIX_LENGTH
TypeId GetInstanceTypeId(void) const
Get the type ID of object instance.
Ptr< SatConf > m_satConf
Configuration for satellite network.
void SetAntennaGainPatterns(Ptr< SatAntennaGainPatternContainer > antennaGainPattern)
Set the antenna gain patterns.
Ptr< OutputStreamWrapper > m_creationTraceStream
Stream wrapper used for creation traces.
bool ConstructMulticastInfo(Ptr< Node > sourceUtNode, NodeContainer receivers, MulticastBeamInfo_t &beamInfo, Ptr< NetDevice > &routerUserOutputDev)
Construct multicast information from source UT node and group receivers.
std::string m_rtnConfFileName
Configuration file names as attributes of this class.
void LoadConstellationScenario(BeamUserInfoMap_t &info, GetNextUtUserCountCallback getNextUtUserCountCallback)
Load satellite objects according to constellation parameters.
bool m_packetTraces
flag to indicate if packet trace should be enabled after scenario creation.
void SetSatMobility(Ptr< Node > node)
Sets mobility to created Sat node.
PreDefinedScenario_t
Values for pre-defined scenarios to be used by helper when building satellite network topology base.
@ LARGER
LARGER Larger scenario used as base.
@ FULL
FULL Full scenario used as base.
@ SIMPLE
SIMPLE Simple scenario used as base.
Ptr< SatAntennaGainPatternContainer > GetAntennaGainPatterns()
TracedCallback< std::string > m_creationSummaryTrace
Trace callback for creation traces (summary)
bool IsSatConstellationEnabled()
void SetUtMobility(NodeContainer uts, uint32_t satId, uint32_t beamId)
Sets mobility to created UT nodes.
void EnableCreationTraces()
Enables creation traces to be written in given file.
bool m_detailedCreationTraces
flag to indicate if detailed creation trace should be enabled for scenario creation.
void CreationSummarySink(std::string title)
Sink for creation summary traces.
std::string CreateCreationSummary(std::string title)
Creates trace summary starting with give title.
Ptr< OutputStreamWrapper > m_utTraceStream
Stream wrapper used for UT position traces.
Ptr< SatUserHelper > m_userHelper
User helper.
void SetUtPositionAllocatorForBeam(uint32_t beamId, Ptr< SatListPositionAllocator > posAllocator)
Set custom position allocator for specific beam.
void EnablePacketTrace()
Enable packet traces.
uint32_t GetBeamCount() const
Get count of the beams (configurations).
SatBeamHelper::MulticastBeamInfoItem_t MulticastBeamInfoItem_t
Ptr< SatAntennaGainPatternContainer > m_antennaGainPatterns
Antenna gain patterns for all spot-beams.
void CreateFullScenario()
Creates satellite objects according to full scenario.
std::map< uint32_t, NodeContainer > m_mobileUtsByBeam
List of mobile UTs by beam ID.
Ptr< SatGroupHelper > GetGroupHelper() const
void CreateSimpleScenario()
Creates satellite objects according to simple scenario.
bool m_scenarioCreated
flag to check if scenario is already created.
Ptr< SatGroupHelper > m_groupHelper
Group helper.
std::string m_satPosFileName
void SetNetworkAddresses(BeamUserInfoMap_t &info, uint32_t gwUsers) const
Set configured network addresses to user and beam helpers.
void CreateUserDefinedScenarioFromListPositions(uint32_t satId, BeamUserInfoMap_t &info, std::string inputFileUtListPositions, bool checkBeam)
Creates satellite objects according to user defined scenario.
void SetMulticastRouteToSourceNetwork(Ptr< Node > source, Ptr< Node > destination)
Set multicast traffic to source's nwtwork by finding source network utilizing given destination node.
void LoadMobileUTsFromFolder(const std::string &folderName, Ptr< RandomVariableStream > utUsers)
Load UTs with a SatTracedMobilityModel associated to them from the files found in the given folder.
Ipv4Address m_utNetworkAddress
Initial network number of UT and UT users, e.g., 10.3.1.0.
uint32_t m_utUsers
Number of users created in end user network (behind every UT) in full or user-defined scenario.
Ptr< NetDevice > FindMatchingDevice(Ptr< NetDevice > devA, Ptr< Node > nodeB)
Find given device's counterpart (device belonging to same network) device from given node.
TracedCallback< std::string > m_creationDetailsTrace
Trace callback for creation traces (details)
std::map< std::pair< uint32_t, uint32_t >, SatBeamUserInfo > BeamUserInfoMap_t
definition for beam map key is pair sat ID / beam ID and value is UT/user info.
static const uint16_t MIN_ADDRESS_PREFIX_LENGTH
std::map< uint32_t, Ptr< SatListPositionAllocator > > m_utPositionsByBeam
User defined UT positions by beam ID.
Ipv4Mask m_gwNetworkMask
Network mask number of GW, router, and GW users.
bool FindMatchingDevices(Ptr< Node > nodeA, Ptr< Node > nodeB, std::pair< Ptr< NetDevice >, Ptr< NetDevice >> &matchingDevices)
Find counterpart (device belonging to same network) devices from given nodes.
Ptr< SatBeamHelper > m_beamHelper
Beam helper.
void CreateUserDefinedScenario(BeamUserInfoMap_t &info)
Creates satellite objects according to user defined scenario.
Ptr< Node > LoadMobileUtFromFile(const std::string &filename)
Load an UT with a SatTracedMobilityModel associated to them from the given file.
void DoDispose()
Dispose of this class instance.
std::map< Ptr< NetDevice >, NetDeviceContainer > m_utsDistribution
Map indicating all UT NetDevices associated to each GW NetDevice.
std::map< uint32_t, uint32_t > m_gwSats
Map of closest satellite for each GW.
std::string m_utPosFileName
void SetMulticastGroupRoutes(Ptr< Node > source, NodeContainer receivers, Ipv4Address sourceAddress, Ipv4Address groupAddress)
Set multicast group to satellite network and IP router.
uint32_t m_gwUsers
Number of users created in public network (behind GWs) in full or user-defined scenario.
Ptr< SatBeamHelper > GetBeamHelper() const
bool m_satConstellationEnabled
Use a constellation of satellites.
void EnableDetailedCreationTraces()
Enables creation traces in sub-helpers.
Ptr< SatListPositionAllocator > m_utPositions
User defined UT positions from SatConf (or manually set)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.