mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 01:53:58 +02:00
Update doxygen documentation
This commit is contained in:
parent
61b6fd7ea1
commit
f17ff6abc6
38 changed files with 1023 additions and 124 deletions
10
doc/leo.rst
10
doc/leo.rst
|
@ -15,12 +15,10 @@ Model Description
|
|||
|
||||
The source code for the module lives in the directory ``contrib/leo``.
|
||||
|
||||
This module provides a mobility model for LEO satellites, propagation loss
|
||||
models for satellite to satellite and satellite to ground transmission. It
|
||||
also includes a simplistic model of the inter-satellite and satellite-ground
|
||||
channels and the associated network devices. It contains required helpers
|
||||
to build a LEO satellite network based on configurable parameters or import
|
||||
mobility data from TLE files.
|
||||
This module provides a mobility model for LEO satellites, propagation loss models for satellite to satellite and satellite to ground transmission.
|
||||
It also includes a simplistic model of the inter-satellite and satellite-ground channels and the associated network devices.
|
||||
It contains helpers to build a LEO satellite network based on configurable parameters or import mobility data from TLE files.
|
||||
|
||||
|
||||
References
|
||||
==========
|
||||
|
|
|
@ -25,12 +25,34 @@
|
|||
#include "ns3/applications-module.h"
|
||||
#include "ns3/node-container.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares ArpCacheHelper
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Prepares the ARP cache, so the addresses do not have to be queried
|
||||
*/
|
||||
class ArpCacheHelper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Install the addresses of the interfaces into the ARP caches of the devices
|
||||
* \param devices devices
|
||||
* \param interfaces interfaces
|
||||
*/
|
||||
void Install (NetDeviceContainer &devices, Ipv4InterfaceContainer &interfaces) const;
|
||||
|
||||
/**
|
||||
* \brief Install the addresses of the interfaces into the ARP caches of the devices
|
||||
* \param deviceSrc devices
|
||||
* \param deviceDst devices
|
||||
* \param interfaces interfaces
|
||||
*/
|
||||
void Install (NetDeviceContainer &devicesSrc, NetDeviceContainer &devicesDst, Ipv4InterfaceContainer &interfaces) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -29,29 +29,35 @@
|
|||
#define LEO_GND_RAD_EARTH 6.371e6
|
||||
|
||||
/**
|
||||
* \brief Builds a node container of nodes with constant positions
|
||||
*
|
||||
* Adds waypoints from file for each node.
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Builds a node container of nodes with constant positions
|
||||
* Adds waypoints from file for each node.
|
||||
*/
|
||||
class LeoGndNodeHelper
|
||||
{
|
||||
public:
|
||||
/// constructor
|
||||
LeoGndNodeHelper ();
|
||||
/// deconstructor
|
||||
virtual ~LeoGndNodeHelper ();
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Create a node container with nodes at the positions in file
|
||||
* \param file path to latitude longitude file
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
*/
|
||||
NodeContainer Install (const std::string &file);
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Create a node container with uniformly distributed nodes
|
||||
* \param latNodes a number of nodes to in latitude direction
|
||||
* \param lonNodes a number of nodes to in longitude direction
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
|
@ -59,7 +65,7 @@ public:
|
|||
NodeContainer Install (uint32_t latNodes, uint32_t lonNodes);
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Install two nodes at two locations
|
||||
* \param location1 first location
|
||||
* \param location2 second location
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
|
@ -68,16 +74,17 @@ public:
|
|||
const LeoLatLong &location2);
|
||||
|
||||
/**
|
||||
* Set an attribute for each node
|
||||
*
|
||||
* \brief Set an attribute for each node
|
||||
* \param name name of the attribute
|
||||
* \param value value of the attribute
|
||||
*/
|
||||
void SetAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
private:
|
||||
/// Fatory for nodes
|
||||
ObjectFactory m_gndNodeFactory;
|
||||
|
||||
/// Convert the latitude and longitude to a position on a sphere
|
||||
static Vector3D GetEarthPosition (const LeoLatLong &loc);
|
||||
};
|
||||
|
||||
|
|
|
@ -27,17 +27,20 @@
|
|||
|
||||
#include <ns3/trace-helper.h>
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares IslNetDevice
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class NetDevice;
|
||||
class Node;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Build a set of IslNetDevice objects
|
||||
*
|
||||
* Normally we eschew multiple inheritance, however, the classes
|
||||
* PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are
|
||||
* "mixins".
|
||||
*/
|
||||
class IslHelper : public PcapHelperForDevice,
|
||||
public AsciiTraceHelperForDevice
|
||||
|
@ -158,7 +161,6 @@ public:
|
|||
bool explicitFilename);
|
||||
|
||||
private:
|
||||
|
||||
ObjectFactory m_queueFactory; //!< Queue Factory
|
||||
ObjectFactory m_channelFactory; //!< Channel Factory
|
||||
ObjectFactory m_deviceFactory; //!< Device Factory
|
||||
|
|
|
@ -27,38 +27,136 @@
|
|||
|
||||
#include <ns3/trace-helper.h>
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares LeoChannelHelper
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Build a channel for transmissions between ns3::LeoMockNetDevice s
|
||||
*/
|
||||
class LeoChannelHelper : public PcapHelperForDevice,
|
||||
public AsciiTraceHelperForDevice
|
||||
{
|
||||
public:
|
||||
/// constructor
|
||||
LeoChannelHelper ();
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* \param constellation name of the link parameter preset
|
||||
*/
|
||||
LeoChannelHelper (std::string constellation);
|
||||
|
||||
/// destructor
|
||||
virtual ~LeoChannelHelper ()
|
||||
{};
|
||||
|
||||
/**
|
||||
* \brief Install the satellites and stations into the channel
|
||||
* \param satellites satellites
|
||||
* \param stations ground stations
|
||||
* \return container of network devices attached to the channel
|
||||
*/
|
||||
NetDeviceContainer Install (NodeContainer &satellites, NodeContainer &stations);
|
||||
|
||||
/**
|
||||
* \brief Install the satellites and stations into the channel
|
||||
* \param satellites satellites
|
||||
* \param stations ground stations
|
||||
* \return container of network devices attached to the channel
|
||||
*/
|
||||
NetDeviceContainer Install (std::vector<Ptr<Node> > &satellites, std::vector<Ptr<Node> > &stations);
|
||||
|
||||
/**
|
||||
* \brief Install the satellites and stations into the channel
|
||||
* \param satellites satellites
|
||||
* \param stations ground stations
|
||||
* \return container of network devices attached to the channel
|
||||
*/
|
||||
NetDeviceContainer Install (std::vector<std::string> &satellites, std::vector<std::string> &stations);
|
||||
|
||||
/**
|
||||
* \brief Set the type and attributes of the queues of the ground stations
|
||||
* \param type type of the queue
|
||||
* \param n1 name of an attribute of the queue
|
||||
* \param v1 value of an attribute of the queue
|
||||
* \param n2 name of an attribute of the queue
|
||||
* \param v2 value of an attribute of the queue
|
||||
* \param n3 name of an attribute of the queue
|
||||
* \param v3 value of an attribute of the queue
|
||||
* \param n4 name of an attribute of the queue
|
||||
* \param v4 value of an attribute of the queue
|
||||
*/
|
||||
void SetGndQueue (std::string type,
|
||||
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
|
||||
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
|
||||
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
|
||||
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
|
||||
|
||||
/**
|
||||
* \brief Set the type and attributes of the queues of the satellite devices
|
||||
* \param type type of the queue
|
||||
* \param n1 name of an attribute of the queue
|
||||
* \param v1 value of an attribute of the queue
|
||||
* \param n2 name of an attribute of the queue
|
||||
* \param v2 value of an attribute of the queue
|
||||
* \param n3 name of an attribute of the queue
|
||||
* \param v3 value of an attribute of the queue
|
||||
* \param n4 name of an attribute of the queue
|
||||
* \param v4 value of an attribute of the queue
|
||||
*/
|
||||
void SetSatQueue (std::string type,
|
||||
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
|
||||
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
|
||||
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
|
||||
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
|
||||
|
||||
/**
|
||||
* \brief Set the type and attributes of the devices of the ground devices
|
||||
* \param type type of the device
|
||||
* \param n1 name of an attribute of the device
|
||||
* \param v1 value of an attribute of the device
|
||||
* \param n2 name of an attribute of the device
|
||||
* \param v2 value of an attribute of the device
|
||||
* \param n3 name of an attribute of the device
|
||||
* \param v3 value of an attribute of the device
|
||||
* \param n4 name of an attribute of the device
|
||||
* \param v4 value of an attribute of the device
|
||||
*/
|
||||
void SetGndDeviceAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
/**
|
||||
* \brief Set the type and attributes of the devices of the satellite devices
|
||||
* \param type type of the device
|
||||
* \param n1 name of an attribute of the device
|
||||
* \param v1 value of an attribute of the device
|
||||
* \param n2 name of an attribute of the device
|
||||
* \param v2 value of an attribute of the device
|
||||
* \param n3 name of an attribute of the device
|
||||
* \param v3 value of an attribute of the device
|
||||
* \param n4 name of an attribute of the device
|
||||
* \param v4 value of an attribute of the device
|
||||
*/
|
||||
void SetSatDeviceAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
/**
|
||||
* \brief Set the type and attributes of the channel
|
||||
* \param type type of the channel
|
||||
* \param n1 name of an attribute of the channel
|
||||
* \param v1 value of an attribute of the channel
|
||||
* \param n2 name of an attribute of the channel
|
||||
* \param v2 value of an attribute of the channel
|
||||
* \param n3 name of an attribute of the channel
|
||||
* \param v3 value of an attribute of the channel
|
||||
* \param n4 name of an attribute of the channel
|
||||
* \param v4 value of an attribute of the channel
|
||||
*/
|
||||
void SetChannelAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
|
||||
|
@ -67,20 +165,44 @@ public:
|
|||
Ptr<NetDevice> nd,
|
||||
bool explicitFilename);
|
||||
|
||||
/**
|
||||
* \brief Set the link parameter preset
|
||||
* \param constellation name of the link parameter preset
|
||||
*/
|
||||
void SetConstellation (std::string constellation);
|
||||
|
||||
private:
|
||||
/// Satellite queues
|
||||
ObjectFactory m_satQueueFactory;
|
||||
/// Ground station queues
|
||||
ObjectFactory m_gndDeviceFactory;
|
||||
|
||||
/// Satellite devices
|
||||
ObjectFactory m_satDeviceFactory;
|
||||
/// Ground station devices
|
||||
ObjectFactory m_gndQueueFactory;
|
||||
|
||||
/// Channel
|
||||
ObjectFactory m_channelFactory;
|
||||
|
||||
/// Propagation loss models
|
||||
ObjectFactory m_propagationLossFactory;
|
||||
//
|
||||
/// Propagation delay models
|
||||
ObjectFactory m_propagationDelayFactory;
|
||||
|
||||
/**
|
||||
* \brief Set the factory and attributes of the queue
|
||||
* \param factory queue factory
|
||||
* \param n1 name of an attribute of the factory
|
||||
* \param v1 value of an attribute of the factory
|
||||
* \param n2 name of an attribute of the factory
|
||||
* \param v2 value of an attribute of the factory
|
||||
* \param n3 name of an attribute of the factory
|
||||
* \param v3 value of an attribute of the factory
|
||||
* \param n4 name of an attribute of the factory
|
||||
* \param v4 value of an attribute of the factory
|
||||
*/
|
||||
void SetQueue (ObjectFactory &factory,
|
||||
std::string type,
|
||||
std::string n1, const AttributeValue &v1,
|
||||
|
@ -89,6 +211,17 @@ private:
|
|||
std::string n4, const AttributeValue &v4);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Set the attributes of the link and propagation loss model
|
||||
* \param eirp EIRP
|
||||
* \param elevationAngle elevation angle of satellite beam
|
||||
* \param fspl free space loss
|
||||
* \param atmosphericLoss atmospheric loss
|
||||
* \param linkMargin link margin
|
||||
* \param dataRate data rate
|
||||
* \param rxGain receiver gain
|
||||
* \param rxLoss receiver loss
|
||||
*/
|
||||
void SetConstellationAttributes (double eirp,
|
||||
double elevationAngle,
|
||||
double fspl,
|
||||
|
|
|
@ -23,32 +23,82 @@
|
|||
#include "ns3/object.h"
|
||||
#include "ns3/waypoint.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares LeoWaypointInputFileStreamContainer
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Wrapper around a stream of Waypoint
|
||||
*/
|
||||
class LeoWaypointInputFileStreamContainer : public Object
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/// constructor
|
||||
LeoWaypointInputFileStreamContainer ();
|
||||
/// destructor
|
||||
virtual ~LeoWaypointInputFileStreamContainer ();
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* \param filePath path to waypoints file
|
||||
* \param lastTime the time until which to read waypoints
|
||||
*/
|
||||
LeoWaypointInputFileStreamContainer (string filePath, Time lastTime);
|
||||
|
||||
/**
|
||||
* \brief Get next waypoint
|
||||
* \param [out] next waypoint
|
||||
* \return true iff there are more waypoints
|
||||
*/
|
||||
bool GetNextSample (Waypoint &sample);
|
||||
|
||||
/**
|
||||
* \brief Set the path to the waypoint file
|
||||
* \param path path to the waypoint file
|
||||
*/
|
||||
void SetFile (const string path);
|
||||
|
||||
/**
|
||||
* \brief Get the path to the waypoint file
|
||||
* \return path to the waypoint file
|
||||
*/
|
||||
string GetFile () const;
|
||||
|
||||
/**
|
||||
* \brief Set the path to the last time slot
|
||||
* \param lastTime last time slot
|
||||
*/
|
||||
void SetLastTime (const Time lastTime);
|
||||
|
||||
/**
|
||||
* \brief Get the last time slot
|
||||
* \return last time slot
|
||||
*/
|
||||
Time GetLastTime () const;
|
||||
|
||||
private:
|
||||
/// Path to the waypoints file
|
||||
string m_filePath;
|
||||
|
||||
/// Time of the last timestamp
|
||||
Time m_lastTime;
|
||||
|
||||
/// Waypoint file stream
|
||||
ifstream m_input;
|
||||
|
||||
};
|
||||
|
|
|
@ -28,19 +28,27 @@
|
|||
#include "ns3/leo-orbit.h"
|
||||
|
||||
/**
|
||||
* \brief Builds a node container of nodes with LEO positions using a list of
|
||||
* orbit definitions.
|
||||
*
|
||||
* Adds orbits with from a file for each node.
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Builds a node container of nodes with LEO positions using a list of
|
||||
* orbit definitions.
|
||||
*
|
||||
* Adds orbits with from a file for each node.
|
||||
*/
|
||||
class LeoOrbitNodeHelper
|
||||
{
|
||||
public:
|
||||
/// constructor
|
||||
LeoOrbitNodeHelper ();
|
||||
|
||||
/// destructor
|
||||
virtual ~LeoOrbitNodeHelper ();
|
||||
|
||||
/**
|
||||
|
@ -73,6 +81,7 @@ public:
|
|||
void SetAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
private:
|
||||
/// Factory for nodes
|
||||
ObjectFactory m_nodeFactory;
|
||||
};
|
||||
|
||||
|
|
|
@ -25,12 +25,34 @@
|
|||
#ifndef NDS_CACHE_HELPER_
|
||||
#define NDS_CACHE_HELPER_
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares NdCacheHelper
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Neighbor Cache helper fills the neighbor cache
|
||||
*/
|
||||
class NdCacheHelper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Fill the cache of devices with addresses
|
||||
* \param devices devices
|
||||
* \param interfaces interfaces that have addresses
|
||||
*/
|
||||
void Install (NetDeviceContainer &devices, Ipv6InterfaceContainer &interfaces) const;
|
||||
|
||||
/**
|
||||
* \brief Fill the cache of devices with addresses
|
||||
* \param devicesSrc devices
|
||||
* \param devicesDst devices
|
||||
* \param interfaces interfaces that have addresses
|
||||
*/
|
||||
void Install (NetDeviceContainer &devicesSrc, NetDeviceContainer &devicesDst, Ipv6InterfaceContainer &interfaces) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -27,38 +27,46 @@
|
|||
#include "ns3/leo-input-fstream-container.h"
|
||||
|
||||
/**
|
||||
* \brief Builds a node container with a waypoint mobility model
|
||||
*
|
||||
* Adds waypoints from file for each node.
|
||||
* The node satId must must correspond to the NORAD id from Celestrack.
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Builds a node container with a waypoint mobility model
|
||||
*
|
||||
* Adds waypoints from file for each node.
|
||||
* The node satId must must correspond to the NORAD id from Celestrack.
|
||||
*/
|
||||
class LeoSatNodeHelper
|
||||
{
|
||||
public:
|
||||
/// constructor
|
||||
LeoSatNodeHelper ();
|
||||
/// destructor
|
||||
virtual ~LeoSatNodeHelper ();
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Install the nodes
|
||||
* \param nodeIds paths to satellite to waypoint files
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
*/
|
||||
NodeContainer Install (std::vector<std::string> &wpFiles);
|
||||
|
||||
/**
|
||||
* Set an attribute for each node
|
||||
*
|
||||
* \brief Set an attribute for each node
|
||||
* \param name name of the attribute
|
||||
* \param value value of the attribute
|
||||
*/
|
||||
void SetAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
private:
|
||||
/// Satellite nodes
|
||||
ObjectFactory m_satNodeFactory;
|
||||
/// Stream of waypoints
|
||||
LeoWaypointInputFileStreamContainer m_fileStreamContainer;
|
||||
};
|
||||
|
||||
|
|
|
@ -35,33 +35,51 @@
|
|||
#include "mock-net-device.h"
|
||||
#include "mock-channel.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* IslMockChannel declaration
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class MockNetDevice;
|
||||
|
||||
/**
|
||||
* \ingroup network
|
||||
* \defgroup channel Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup channel
|
||||
* \brief Simplified inter-satellite channel
|
||||
* \ingroup leo
|
||||
* \brief Simplified model of an inter-satellite channel
|
||||
*
|
||||
* A perfect channel with varariable delay (time-of-flight).
|
||||
* This channel distributes packets to all attached devies to which the sender has a line-of-sight.
|
||||
* It is typically used in conjunction with the IslPropagationLossModel and ConstantSpeedPropagationDelay.
|
||||
*
|
||||
*/
|
||||
class IslMockChannel : public MockChannel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/// constructor
|
||||
IslMockChannel ();
|
||||
/// destructor
|
||||
virtual ~IslMockChannel ();
|
||||
|
||||
/**
|
||||
* \brief Starts a transmission of a packet
|
||||
* \return true iff the transmission was successful
|
||||
* \param p the packet to transmit
|
||||
* \param devId the id of the sender device as an index into the attached
|
||||
* devices
|
||||
* \param dst the destination address
|
||||
* \param txTime the transmission delay of the packet
|
||||
*/
|
||||
bool TransmitStart (Ptr<const Packet> p, uint32_t devId, Address dst, Time txTime);
|
||||
|
||||
private:
|
||||
std::vector<Ptr<MockNetDevice> > m_link;
|
||||
std::vector<Ptr<MockNetDevice> > m_link; ///< Attached devices
|
||||
|
||||
|
||||
}; // class MockChannel
|
||||
|
|
|
@ -22,25 +22,44 @@
|
|||
#include <ns3/object.h>
|
||||
#include <ns3/propagation-loss-model.h>
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of IslPropagationLossModel
|
||||
*/
|
||||
|
||||
#define LEO_EARTH_RAD 6.371009e6
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief An approximate model for the propagation loss between any two low
|
||||
* earth orbit satellites using the line-of-sight
|
||||
*
|
||||
*/
|
||||
class IslPropagationLossModel : public PropagationLossModel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
/// constructor
|
||||
IslPropagationLossModel ();
|
||||
/// destructor
|
||||
virtual ~IslPropagationLossModel ();
|
||||
|
||||
/**
|
||||
* true if there is at least one intersection of ISL line-of-sight with earth
|
||||
* (LOS is blocked by earth)
|
||||
* \brief Check if there is a direc line-of-sight between the two points
|
||||
*
|
||||
* Assumes earth is sperical.
|
||||
* Assumes earth is spherical.
|
||||
*
|
||||
* \param a first node
|
||||
* \param b second node
|
||||
* \param a first point
|
||||
* \param b second point
|
||||
* \return true iff there is a line-of-sight between the points
|
||||
*/
|
||||
static bool GetLos (Ptr<MobilityModel> a, Ptr<MobilityModel> b);
|
||||
private:
|
||||
|
@ -56,10 +75,7 @@ private:
|
|||
virtual double DoCalcRxPower (double txPowerDbm,
|
||||
Ptr<MobilityModel> a,
|
||||
Ptr<MobilityModel> b) const;
|
||||
/**
|
||||
* Subclasses must implement this; those not using random variables
|
||||
* can return zero
|
||||
*/
|
||||
|
||||
virtual int64_t DoAssignStreams (int64_t stream);
|
||||
};
|
||||
|
||||
|
|
|
@ -25,6 +25,13 @@
|
|||
#include "ns3/mobility-model.h"
|
||||
#include "ns3/nstime.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of LeoCircularOrbitMobilityModel
|
||||
*/
|
||||
|
||||
#define LEO_EARTH_RAD_KM 6371.0090
|
||||
#define LEO_EARTH_GM_KM_E10 39.8600436
|
||||
|
||||
|
@ -41,22 +48,42 @@ class LeoCircularOrbitMobilityModel : public MobilityModel
|
|||
{
|
||||
public:
|
||||
/**
|
||||
* Register this type with the TypeId system.
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
/// constructor
|
||||
LeoCircularOrbitMobilityModel ();
|
||||
/// destructor
|
||||
virtual ~LeoCircularOrbitMobilityModel ();
|
||||
|
||||
/**
|
||||
* km/s
|
||||
* \brief Gets the speed of the node
|
||||
* \return the speed in m/s
|
||||
*/
|
||||
double GetSpeed () const;
|
||||
|
||||
/**
|
||||
* \brief Gets the altitude
|
||||
* \return the altitude
|
||||
*/
|
||||
double GetAltitude () const;
|
||||
/**
|
||||
* \brief Sets the altitude
|
||||
* \param the altitude
|
||||
*/
|
||||
void SetAltitude (double h);
|
||||
|
||||
/**
|
||||
* \brief Gets the inclination
|
||||
* \return the inclination
|
||||
*/
|
||||
double GetInclination () const;
|
||||
|
||||
/**
|
||||
* \brief Sets the inclination
|
||||
* \param the inclination
|
||||
*/
|
||||
void SetInclination (double incl);
|
||||
|
||||
private:
|
||||
|
@ -105,30 +132,46 @@ private:
|
|||
virtual Vector DoGetVelocity (void) const;
|
||||
|
||||
/**
|
||||
* Get the normal vector of the orbital plane
|
||||
* \brief Get the normal vector of the orbital plane
|
||||
*/
|
||||
Vector3D PlaneNorm () const;
|
||||
|
||||
/**
|
||||
* \brief Gets the distance the satellite has progressed from its original
|
||||
* position at time t in rad
|
||||
*
|
||||
* \param t a point in time
|
||||
* \return distance in rad
|
||||
*/
|
||||
double GetProgress (Time t) const;
|
||||
|
||||
/**
|
||||
* Advances a satellite by a degrees on the orbital plane
|
||||
* \brief Advances a satellite by a degrees inside the orbital plane
|
||||
* \param a angle by which to rotate
|
||||
* \param x vector to rotate
|
||||
* \return rotated vector
|
||||
*/
|
||||
Vector3D RotatePlane (double a, const Vector3D &x) const;
|
||||
|
||||
/**
|
||||
* Calculate the position at time
|
||||
*
|
||||
* \brief Calculate the position at time t
|
||||
* \param t time
|
||||
* \return position at time t
|
||||
*/
|
||||
Vector CalcPosition (Time t) const;
|
||||
|
||||
/**
|
||||
* Calc the latitude depending on simulation time inside ITRF coordinate
|
||||
* \brief Calc the latitude depending on simulation time inside ITRF coordinate
|
||||
* system
|
||||
*
|
||||
* \return latitude
|
||||
*/
|
||||
double CalcLatitude () const;
|
||||
|
||||
/**
|
||||
* \brief Update the internal position of the mobility model
|
||||
* \return position that will be returned upon next call to DoGetPosition
|
||||
*/
|
||||
Vector Update ();
|
||||
};
|
||||
|
||||
|
|
|
@ -21,32 +21,54 @@
|
|||
|
||||
#include "ns3/position-allocator.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of LeoCircularOrbitAllocator
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \brief Allocate pairs of latitude and longitude (offset within orbit) for
|
||||
* \ingroup leo
|
||||
* \brief Allocate pairs of longitude and latitude (offset within orbit) for
|
||||
* use in LeoCircularOrbitMobilityModel
|
||||
*/
|
||||
class LeoCircularOrbitAllocator : public PositionAllocator
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Register this type with the TypeId system.
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId ();
|
||||
|
||||
/// constructor
|
||||
LeoCircularOrbitAllocator ();
|
||||
/// destructor
|
||||
virtual ~LeoCircularOrbitAllocator ();
|
||||
|
||||
/**
|
||||
* \brief Gets the next position on the latitude longitude grid
|
||||
*
|
||||
* If all positions have been returned once, the first position is returned
|
||||
* again and so on.
|
||||
*
|
||||
* \return the next latitude, longitude pair
|
||||
*/
|
||||
virtual Vector GetNext (void) const;
|
||||
virtual int64_t AssignStreams (int64_t stream);
|
||||
|
||||
private:
|
||||
/// Number of orbits two distribute the satellites on
|
||||
uint64_t m_numOrbits;
|
||||
/// Number of satellites per orbit
|
||||
uint64_t m_numSatellites;
|
||||
|
||||
/// The last orit that has been assigned
|
||||
mutable uint64_t m_lastOrbit;
|
||||
/// The last position inside the orbit that has been assigned
|
||||
mutable uint64_t m_lastSatellite;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,20 +21,47 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of LeoLatLong
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \brief Wrapper around a pair of latitude and longitude
|
||||
*/
|
||||
class LeoLatLong
|
||||
{
|
||||
public:
|
||||
/// constructor
|
||||
LeoLatLong ();
|
||||
/// destructor
|
||||
LeoLatLong (double latitude, double longitude);
|
||||
virtual ~LeoLatLong();
|
||||
|
||||
/// Latitude
|
||||
double latitude;
|
||||
/// Longitude
|
||||
double longitude;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Serialize the LeoLatLong instance using a colon as a separator
|
||||
* \param os stream to serialize into
|
||||
* \param latLong to serialize
|
||||
* \return returns the stream
|
||||
*/
|
||||
std::ostream &operator << (std::ostream &os, const LeoLatLong &latLong);
|
||||
|
||||
/**
|
||||
* \brief Deserialize the LeoLatLong instance using a colon as a separator
|
||||
* \param is stream to deserialize from
|
||||
* \param latLong to deserialize into
|
||||
* \return returns the stream
|
||||
*/
|
||||
std::istream &operator >> (std::istream &is, LeoLatLong &latLong);
|
||||
|
||||
};
|
||||
|
|
|
@ -34,29 +34,42 @@
|
|||
#include "ns3/propagation-loss-model.h"
|
||||
#include "mock-channel.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of LeoMockChannl
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup channel Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup channel
|
||||
* \brief Mocked satellite-gateway, satellite-terminal channel types
|
||||
* \brief Channel between satellite and gateway
|
||||
*
|
||||
* Delivers packets to all attached devices on opposing site (satellite to
|
||||
* gateway and vice-versa)
|
||||
*
|
||||
* Usually used together with LeoPropagationLossModel and LeoPropagationDelay.
|
||||
*/
|
||||
class LeoMockChannel : public MockChannel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/// constructor
|
||||
LeoMockChannel ();
|
||||
/// destructor
|
||||
virtual ~LeoMockChannel ();
|
||||
|
||||
/**
|
||||
* \see MockChannel::TransmitStart
|
||||
*
|
||||
* A packet is transmitted if the destination is reachable via the beam.
|
||||
* \brief A packet is transmitted if the destination is reachable via the beam.
|
||||
*/
|
||||
virtual bool TransmitStart (Ptr<const Packet> p, uint32_t devId, Address dst, Time txTime);
|
||||
|
||||
|
@ -71,7 +84,11 @@ private:
|
|||
* type (no sat-sat or ground-ground).
|
||||
*/
|
||||
typedef std::map<Address, Ptr<MockNetDevice> > DeviceIndex;
|
||||
|
||||
/// Devices that are on the ground (gateways)
|
||||
DeviceIndex m_groundDevices;
|
||||
|
||||
/// Devices that are in space (satellites)
|
||||
DeviceIndex m_satelliteDevices;
|
||||
}; // class MockChannel
|
||||
|
||||
|
|
|
@ -21,37 +21,66 @@
|
|||
|
||||
#include "mock-net-device.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
/**
|
||||
* \brief A mocked satellite-ground link communication device with a type
|
||||
* \ingroup leo
|
||||
* \brief A satellite-ground communication device with a type
|
||||
*/
|
||||
class LeoMockNetDevice : public MockNetDevice
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Type of the device. Can either be on ground or in space.
|
||||
*/
|
||||
enum DeviceType
|
||||
{
|
||||
/// Device is on the ground
|
||||
GND,
|
||||
/// Device is in space
|
||||
SAT
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/// constructor
|
||||
LeoMockNetDevice ();
|
||||
|
||||
/// destructor
|
||||
virtual ~LeoMockNetDevice ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get the type of this device
|
||||
* \return device type
|
||||
*/
|
||||
DeviceType GetDeviceType () const;
|
||||
|
||||
/**
|
||||
* \brief Set the type of this device
|
||||
* \return device type
|
||||
*/
|
||||
void SetDeviceType (DeviceType deviceType);
|
||||
|
||||
protected:
|
||||
virtual double DoCalcRxPower (double rxPower) const;
|
||||
|
||||
private:
|
||||
/// Device type
|
||||
DeviceType m_deviceType;
|
||||
/// Receiver loss
|
||||
double m_rxLoss;
|
||||
/// Receiver gain
|
||||
double m_rxGain;
|
||||
};
|
||||
|
||||
|
|
|
@ -19,18 +19,17 @@
|
|||
#ifndef LEO_ONEWEB_CONSTANTS
|
||||
#define LEO_ONEWEB_CONSTANTS
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of constants
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup constants Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup constants
|
||||
* \defgroup oneweb
|
||||
*/
|
||||
/**
|
||||
* \ingroup oneweb
|
||||
* \brief Constants for oneweb network estimated from channel parameters
|
||||
*
|
||||
* Source http://systemarchitect.mit.edu/docs/delportillo18b.pdf
|
||||
|
|
|
@ -21,21 +21,56 @@
|
|||
|
||||
#include "ns3/uinteger.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
class LeoOrbit;
|
||||
|
||||
/**
|
||||
* \brief Serialize an orbit
|
||||
* \return the stream
|
||||
* \param os the stream
|
||||
* \param [in] orbit is an Orbit
|
||||
*/
|
||||
std::ostream &operator << (std::ostream &os, const LeoOrbit &orbit);
|
||||
|
||||
/**
|
||||
* \brief Deserialize an orbit
|
||||
* \return the stream
|
||||
* \param is the stream
|
||||
* \param [out] orbit is the Orbit
|
||||
*/
|
||||
std::istream &operator >> (std::istream &is, LeoOrbit &orbit);
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Orbit definition
|
||||
*/
|
||||
class LeoOrbit {
|
||||
public:
|
||||
/// constructor
|
||||
LeoOrbit ();
|
||||
/**
|
||||
* \brief Constructor
|
||||
* \param a altitude
|
||||
* \param i inclination
|
||||
* \param p number planes
|
||||
* \param s number of satellites in plane
|
||||
*/
|
||||
LeoOrbit (double a, double i, double p, double s) : alt (a), inc (i), planes (p), sats (s) {}
|
||||
/// destructor
|
||||
virtual ~LeoOrbit ();
|
||||
/// Altitude of orbit
|
||||
double alt;
|
||||
/// Inclination of orbit
|
||||
double inc;
|
||||
/// Number of planes with that altitude and inclination
|
||||
uint16_t planes;
|
||||
/// Number of satellites in those planes
|
||||
uint16_t sats;
|
||||
};
|
||||
|
||||
|
|
|
@ -23,31 +23,45 @@
|
|||
|
||||
#define LEO_GND_RAD_EARTH 6.371e6
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
*
|
||||
* Declaration of LeoPolarPositionAllocator
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \brief Allocate pairs of latitude and longitude.
|
||||
* \ingroup leo
|
||||
* \brief Allocator for pairs of latitude and longitude.
|
||||
*/
|
||||
class LeoPolarPositionAllocator : public PositionAllocator
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Register this type with the TypeId system.
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId ();
|
||||
|
||||
/// constructor
|
||||
LeoPolarPositionAllocator ();
|
||||
/// desctructor
|
||||
virtual ~LeoPolarPositionAllocator ();
|
||||
|
||||
virtual Vector GetNext (void) const;
|
||||
virtual int64_t AssignStreams (int64_t stream);
|
||||
|
||||
private:
|
||||
/// Number of latitudial positions
|
||||
uint32_t m_latNum;
|
||||
/// Number of longitudinal positions
|
||||
uint32_t m_lonNum;
|
||||
|
||||
/// Current latitudinal position
|
||||
mutable uint32_t m_lat;
|
||||
/// Current longitudinal position
|
||||
mutable uint32_t m_lon;
|
||||
};
|
||||
|
||||
|
|
|
@ -25,13 +25,30 @@
|
|||
#define LEO_PROP_EARTH_RAD 6.37101e6
|
||||
#define LEO_SPEED_OF_LIGHT_IN_AIR 299702458
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declaration of LeoPropagationLossModel
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Propagation loss model for transmissions between satellites and
|
||||
* gateways
|
||||
*/
|
||||
class LeoPropagationLossModel : public PropagationLossModel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
/// constructor
|
||||
LeoPropagationLossModel ();
|
||||
/// destructor
|
||||
virtual ~LeoPropagationLossModel ();
|
||||
|
||||
private:
|
||||
|
@ -57,9 +74,7 @@ private:
|
|||
double m_linkMargin;
|
||||
|
||||
/**
|
||||
* Returns the Rx Power taking into account only the particular
|
||||
* PropagationLossModel.
|
||||
*
|
||||
* \brief Calculate the Rx Power
|
||||
* \param txPowerDbm current transmission power (in dBm)
|
||||
* \param a the mobility model of the source
|
||||
* \param b the mobility model of the destination
|
||||
|
@ -68,15 +83,26 @@ private:
|
|||
virtual double DoCalcRxPower (double txPowerDbm,
|
||||
Ptr<MobilityModel> a,
|
||||
Ptr<MobilityModel> b) const;
|
||||
/**
|
||||
* Subclasses must implement this; those not using random variables
|
||||
* can return zero
|
||||
*/
|
||||
|
||||
virtual int64_t DoAssignStreams (int64_t stream);
|
||||
|
||||
/**
|
||||
* \brief Set the elevation angle
|
||||
* \param angle elevation
|
||||
*/
|
||||
void SetElevationAngle (double angle);
|
||||
|
||||
/**
|
||||
* \brief Get the elevation angle
|
||||
* \return elevation angle
|
||||
*/
|
||||
double GetElevationAngle () const;
|
||||
|
||||
/**
|
||||
* \brief Get the maximum communication distance for satellite
|
||||
* \param sat satellite
|
||||
* \return distance
|
||||
*/
|
||||
double GetCutoffDistance (const Ptr<MobilityModel> sat) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -19,18 +19,16 @@
|
|||
#ifndef LEO_STARLINK_CONSTANTS
|
||||
#define LEO_STARLINK_CONSTANTS
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Definition of Starlink link constants
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup constants Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup constants
|
||||
* \defgroup starlink
|
||||
*/
|
||||
/**
|
||||
* \ingroup starlink
|
||||
* \brief Constants for starlink network estimated from channel parameters
|
||||
*
|
||||
* Source http://systemarchitect.mit.edu/docs/delportillo18b.pdf
|
||||
|
|
|
@ -19,18 +19,16 @@
|
|||
#ifndef LEO_TELESAT_CONSTANTS
|
||||
#define LEO_TELESAT_CONSTANTS
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Definition of Telesat link constants
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup constants Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup constants
|
||||
* \defgroup telesat
|
||||
*/
|
||||
/**
|
||||
* \ingroup starlink
|
||||
* \brief Constants for Telesat network estimated from channel parameters
|
||||
*
|
||||
* Source http://systemarchitect.mit.edu/docs/delportillo18b.pdf
|
||||
|
|
|
@ -34,27 +34,39 @@
|
|||
#include "ns3/propagation-loss-model.h"
|
||||
#include "mock-net-device.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declaration of class MockNetDevice
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class MockNetDevice;
|
||||
|
||||
/**
|
||||
* \ingroup network
|
||||
* \defgroup channel Channel
|
||||
*/
|
||||
/**
|
||||
* \ingroup channel
|
||||
* \brief Mocked channel
|
||||
*
|
||||
* \ingroup leo
|
||||
* \brief Base class for LeoMockChannel and IslMockChannel
|
||||
*/
|
||||
class MockChannel : public Channel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/// constructor
|
||||
MockChannel ();
|
||||
/// destructor
|
||||
virtual ~MockChannel ();
|
||||
|
||||
/**
|
||||
* \brief Get device at index i
|
||||
* \param i index
|
||||
* \return pointer to device
|
||||
*/
|
||||
Ptr<NetDevice> GetDevice (std::size_t i) const;
|
||||
|
||||
/**
|
||||
|
@ -71,13 +83,41 @@ public:
|
|||
*/
|
||||
virtual bool Detach (uint32_t deviceId);
|
||||
|
||||
/**
|
||||
* \brief Get number of devices in channel
|
||||
* \return number of devices
|
||||
*/
|
||||
std::size_t GetNDevices (void) const;
|
||||
|
||||
/**
|
||||
* \brief Start to transmit a packet
|
||||
*
|
||||
* Subclasses must implement this.
|
||||
*/
|
||||
virtual bool TransmitStart (Ptr<const Packet> p, uint32_t devId, Address dst, Time txTime) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the propagation loss model
|
||||
* \return propagation loss in dBm
|
||||
*/
|
||||
Ptr<PropagationLossModel> GetPropagationLoss (void) const;
|
||||
|
||||
/**
|
||||
* \brief Set the propagation loss model
|
||||
* \param model propagation loss
|
||||
*/
|
||||
void SetPropagationLoss (Ptr<PropagationLossModel> model);
|
||||
|
||||
/**
|
||||
* \brief Get the propagation delay model
|
||||
* \return propagation delay
|
||||
*/
|
||||
Ptr<PropagationDelayModel> GetPropagationDelay (void) const;
|
||||
|
||||
/**
|
||||
* \brief Set the propagation delay model
|
||||
* \param delay propagation delay
|
||||
*/
|
||||
void SetPropagationDelay (Ptr<PropagationDelayModel> delay);
|
||||
|
||||
protected:
|
||||
|
@ -90,25 +130,39 @@ protected:
|
|||
|
||||
/**
|
||||
* \brief Get the propagation delay associated with this channel
|
||||
* \param first mobility model
|
||||
* \param second mobility model
|
||||
* \param txTime time of the transmission
|
||||
* \returns Propagation time delay
|
||||
*/
|
||||
Time GetPropagationDelay (Ptr<MobilityModel> first, Ptr<MobilityModel> second, Time txTime) const;
|
||||
|
||||
/**
|
||||
* \brief Get a device by it's address
|
||||
* \param addr address of the device
|
||||
* \return pointer to the device if it is attached to the channel, null otherwise
|
||||
*/
|
||||
Ptr<MockNetDevice> GetDevice (Address &addr) const;
|
||||
|
||||
/**
|
||||
* \brief Deliver a packet to a destination
|
||||
* \param p packet
|
||||
* \param src source of a packet
|
||||
* \param dst destination of a packet
|
||||
* \param txTime transmission time of the packet
|
||||
* \return true iff the transmission has been successful
|
||||
*/
|
||||
bool Deliver ( Ptr<const Packet> p, Ptr<MockNetDevice> src, Ptr<MockNetDevice> dst, Time txTime);
|
||||
|
||||
private:
|
||||
|
||||
/// All devices that are attached to the channel
|
||||
std::vector<Ptr<MockNetDevice> > m_link;
|
||||
|
||||
/**
|
||||
* \brief Propagation delay model to be used with this channel
|
||||
*/
|
||||
/// Propagation delay model to be used with this channel
|
||||
Ptr<PropagationDelayModel> m_propagationDelay;
|
||||
/**
|
||||
* \brief Propagation loss model to be used with this channel
|
||||
*/
|
||||
|
||||
/// Propagation loss model to be used with this channel
|
||||
Ptr<PropagationLossModel> m_propagationLoss;
|
||||
|
||||
}; // class MockChannel
|
||||
|
|
|
@ -33,6 +33,15 @@
|
|||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/mobility-model.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares MockNetDevice
|
||||
*
|
||||
* Lots of stuff copied and adapted from PointToPointNetDevice and
|
||||
* CsmaNetDevice
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
template <typename Item> class Queue;
|
||||
|
@ -40,6 +49,10 @@ class NetDeviceQueueInterface;
|
|||
class MockChannel;
|
||||
class ErrorModel;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Network device for use with MockChannel
|
||||
*/
|
||||
class MockNetDevice : public NetDevice
|
||||
{
|
||||
public:
|
||||
|
@ -492,4 +505,4 @@ private:
|
|||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* ISL_NET_DEVICE_H */
|
||||
#endif /* MOCK_NET_DEVICE_H */
|
||||
|
|
|
@ -21,12 +21,27 @@
|
|||
|
||||
#include "ns3/uinteger.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup leo
|
||||
* Declares Orbit
|
||||
*/
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Orbit
|
||||
*/
|
||||
class Orbit {
|
||||
public:
|
||||
/// constructor
|
||||
Orbit (double a, double i, double p, double s) : alt (a), inc (i), planes (p), sats (s) {}
|
||||
/// Altitude
|
||||
double alt;
|
||||
/// Inclination
|
||||
double inc;
|
||||
/// Number of planes
|
||||
uint16_t planes;
|
||||
/// Number of satellites in plane
|
||||
uint16_t sats;
|
||||
};
|
||||
|
||||
|
|
|
@ -28,6 +28,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class EmptyGndNodeHelperTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -60,6 +72,12 @@ EmptyGndNodeHelperTestCase::DoRun (void)
|
|||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class SomeGndNodeHelperTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -92,6 +110,12 @@ SomeGndNodeHelperTestCase::DoRun (void)
|
|||
NS_ASSERT_MSG (mob != Ptr<MobilityModel> (), "Mobility model is valid");
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class GndNodeHelperTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -27,6 +27,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslMockChannelTransmitUnknownTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -49,6 +61,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslMockChannelTransmitKnownTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -82,6 +100,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslMockChannelTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -25,6 +25,18 @@ using namespace ns3;
|
|||
|
||||
#define EARTH_RAD 6.3781e6
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslPropagationAngleTestCase1 : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -42,6 +54,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslPropagationAngleTestCase2 : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -59,6 +77,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslPropagationTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -30,6 +30,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslIcmpTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -109,6 +121,12 @@ IslIcmpTestCase::DoRun (void)
|
|||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class IslTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -30,6 +30,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoAnimTestCase1 : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -118,10 +130,12 @@ LeoAnimTestCase1::DoRun (void)
|
|||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
// The TestSuite class names the TestSuite, identifies what type of TestSuite,
|
||||
// and enables the TestCases to be run. Typically, only the constructor for
|
||||
// this class must be defined
|
||||
//
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoAnimTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -21,6 +21,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoWaypointFileEmptyTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -57,6 +69,12 @@ LeoWaypointFileEmptyTestCase::DoRun (void)
|
|||
NS_TEST_ASSERT_MSG_EQ ((i == 0), true, "Reading waypoints from empty");
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoWaypointSomeEntriesTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -93,6 +111,12 @@ LeoWaypointSomeEntriesTestCase::DoRun (void)
|
|||
NS_TEST_ASSERT_MSG_EQ ((i > 0), true, "Reading from non-empty stream succeeds");
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoWaypointsTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -24,6 +24,18 @@ using namespace ns3;
|
|||
|
||||
NS_LOG_COMPONENT_DEFINE ("LeoMobilityTestSuite");
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMobilityWaypointTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -57,6 +69,12 @@ LeoMobilityWaypointTestCase::DoRun (void)
|
|||
NS_TEST_ASSERT_MSG_EQ ((mobility->WaypointsLeft () > 2), true, "Reading waypoints from empty");
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMobilityTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -27,6 +27,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTransmitUnknownTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -49,6 +61,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTransmitKnownTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -86,6 +104,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTransmitSpaceGroundTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -123,6 +147,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTransmitSpaceSpaceTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -160,6 +190,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTransmitGroundGroundTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -197,6 +233,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoMockChannelTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -27,6 +27,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitSpeedTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -42,6 +54,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitPositionTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -58,6 +76,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitProgressTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -85,6 +109,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitLatitudeTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -106,6 +136,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitOffsetTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -127,6 +163,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitTracingTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -178,6 +220,12 @@ void LeoOrbitTracingTestCase::CourseChange (std::string context, Ptr<const Mobil
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoOrbitTestSuite : TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -24,6 +24,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoPropagationRxNoLosTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -44,6 +56,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoPropagationRxLosTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -67,6 +85,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoPropagationBadAngleTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -87,6 +111,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoPropagationLossTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -109,6 +139,12 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoPropagationTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoTestCase1 : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -146,10 +158,12 @@ LeoTestCase1::DoRun (void)
|
|||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
// The TestSuite class names the TestSuite, identifies what type of TestSuite,
|
||||
// and enables the TestCases to be run. Typically, only the constructor for
|
||||
// this class must be defined
|
||||
//
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoTraceTestCase1 : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -135,10 +147,12 @@ LeoTraceTestCase1::DoRun (void)
|
|||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
// The TestSuite class names the TestSuite, identifies what type of TestSuite,
|
||||
// and enables the TestCases to be run. Typically, only the constructor for
|
||||
// this class must be defined
|
||||
//
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class LeoTraceTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -28,6 +28,18 @@
|
|||
|
||||
using namespace ns3;
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \defgroup leo-test LEO module tests
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class EmptySatNodeHelperTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -60,6 +72,12 @@ EmptySatNodeHelperTestCase::DoRun (void)
|
|||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class SingleSatNodeHelperTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
|
@ -96,6 +114,12 @@ SingleSatNodeHelperTestCase::DoRun (void)
|
|||
NS_ASSERT_MSG (mob != Ptr<MobilityModel> (), "Mobility model is valid");
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup leo-test
|
||||
* \ingroup tests
|
||||
*
|
||||
* \brief Unit tests
|
||||
*/
|
||||
class SatNodeHelperTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue