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/trace-helper.h>
179 NodeContainer
GetUtUsers(Ptr<Node> utNode)
const;
185 NodeContainer
GetUtUsers(NodeContainer utNodes)
const;
253 const std::string& folderName,
254 Ptr<RandomVariableStream> utUsers);
273 NodeContainer receivers,
274 Ipv4Address sourceAddress,
275 Ipv4Address groupAddress);
536 std::vector<std::string>& tles,
537 std::vector<std::pair<uint32_t, uint32_t>>& isls);
587 void SetGwMobility(uint32_t satId, Ptr<Node> gw, uint32_t gwIndex);
611 void SetUtMobility(NodeContainer uts, uint32_t satId, uint32_t beamId);
626 std::vector<std::pair<GeoCoordinate, uint32_t>> positionsAndGroupId);
658 std::pair<Ptr<NetDevice>, Ptr<NetDevice>>& matchingDevices);
683 NodeContainer receivers,
685 Ptr<NetDevice>& routerUserOutputDev);
702 const Ipv4Address& firstNetwork,
703 const Ipv4Mask& mask,
704 const std::set<uint32_t>& networkAddresses,
705 uint32_t networkCount,
706 uint32_t hostCount)
const;
GeoCoordinate class is used to store and operate with geodetic coordinates.
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.
void PrintTopology(std::ostream &os) const
Print all the satellite topology.
void CreateConstellationScenario(BeamUserInfoMap_t &info, GetNextUtUserCountCallback getNextUtUserCountCallback)
Creates satellite objects according to constellation parameters.
void LoadMobileUTsFromFolder(uint32_t satId, const std::string &folderName, Ptr< RandomVariableStream > utUsers)
Load UTs with a SatTracedMobilityModel associated to them from the files found in the given folder.
void LoadConstellationTopology(std::string path, std::vector< std::string > &tles, std::vector< std::pair< uint32_t, uint32_t >> &isls)
Load a constellation topology.
Ptr< SatUserHelper > GetUserHelper() const
void CreatePredefinedScenario(PreDefinedScenario_t scenario)
Create a pre-defined SatHelper to make life easier when creating Satellite topologies.
Ptr< Node > LoadMobileUtFromFile(uint32_t satId, const std::string &filename)
Load an UT with a SatTracedMobilityModel associated to them from the given file.
Ipv4Mask m_beamNetworkMask
Network mask number of satellite devices.
std::string m_utCreationFileName
File name for UT creation trace output.
SatHelper()
Create a base SatHelper for creating customized Satellite topologies.
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.
NodeContainer m_gwUser
Gateway container.
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.
static TypeId GetTypeId(void)
Get the type ID.
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.
bool m_satMobilitySGP4Enabled
The satellite moves following a SGP4 model.
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
std::map< Ptr< Node >, Ptr< Node > > m_gwDistribution
Map indicating the GW node associated to each UT node.
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.
bool m_packetTraces
flag to indicate if packet trace should be enabled after scenario creation.
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.
void SetGwMobility(uint32_t satId, Ptr< Node > gw, uint32_t gwIndex)
Sets mobilities to created GW nodes.
Ptr< SatUserHelper > m_userHelper
User helper.
NodeContainer GetGwUsers() const
SatHelper(std::string scenarioName)
Create a base SatHelper for creating customized Satellite topologies.
std::string m_geoPosFileName
void SetUtPositionAllocatorForBeam(uint32_t beamId, Ptr< SatListPositionAllocator > posAllocator)
Set custom position allocator for specific beam.
void EnablePacketTrace()
Enable packet traces.
void SetGeoSatMobility(Ptr< Node > node)
Sets mobility to created Sat Geo node.
uint32_t GetBeamCount() const
Get count of the beams (configurations).
SatBeamHelper::MulticastBeamInfoItem_t MulticastBeamInfoItem_t
void CreateUserDefinedScenarioFromListPositions(uint32_t satId, BeamUserInfoMap_t &info, bool checkBeam)
Creates satellite objects according to user defined scenario.
void SetSatMobility(Ptr< Node > node, std::string tle="")
Sets SGP4 mobility to created Sat node.
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.
void SetNetworkAddresses(BeamUserInfoMap_t &info, uint32_t gwUsers) const
Set configured network addresses to user and beam helpers.
void SetMulticastRouteToSourceNetwork(Ptr< Node > source, Ptr< Node > destination)
Set multicast traffic to source's nwtwork by finding source network utilizing given destination node.
Ipv4Address m_utNetworkAddress
Initial network number of UT and UT users, e.g., 10.3.1.0.
uint32_t GetClosestSat(GeoCoordinate position)
Get closest satellite to a ground station.
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.
void SetGwAddressInUt()
Set the value of GW address for each UT.
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.
NodeContainer GetUtUsers() const
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.
std::string m_waveformConfFileName
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.
std::string m_satMobilitySGP4TleFileName
TLE input filename used for SGP4 mobility.
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.
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.
std::string m_satConstellationFolder
Folder where are stored satellite constellation data.
NodeContainer GeoSatNodes()
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.