A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
leo-satellite-example.cc File Reference

Unified LEO satellite example that combines three use cases into a single program, controlled by the –mode switch: More...

#include "math.h"
#include "ns3/channel-condition-model.h"
#include "ns3/core-module.h"
#include "ns3/geocentric-constant-position-mobility-model.h"
#include "ns3/geocentric-ecef-mobility-model.h"
#include "ns3/geographic-positions.h"
#include "ns3/isotropic-antenna-model.h"
#include "ns3/leo-orbit-node-helper.h"
#include "ns3/mobility-module.h"
#include "ns3/three-gpp-propagation-loss-model.h"
#include "ns3/uniform-planar-array.h"
#include <fstream>
#include <map>
#include <sstream>
#include <utility>
Include dependency graph for leo-satellite-example.cc:

Go to the source code of this file.

Classes

struct  GroundStation
 Ground station definition. More...
class  LeoConstellationTracer
 Helper class to trace LEO constellation mobility and/or antenna pointing. More...

Enumerations

enum class  LeoMode { Orbit , Antenna , Channel }
 Simulation mode selected via –mode. More...

Functions

static Vector ParseGroundStation (const std::string &locationStr)
 Parse a ground station location string "lat,lon,alt" into a Vector.

Variables

GroundStation groundStation
 Global ground station.
Ptr< ThreeGppPropagationLossModelpropagationLossModel
 Global propagation loss model (used by tracer).

Detailed Description

Unified LEO satellite example that combines three use cases into a single program, controlled by the –mode switch:

  • –mode=orbit Mobility tracing only (position + speed)
  • –mode=antenna Antenna pointing toward a ground station (no propagation)
  • –mode=channel Full 3GPP NTN propagation loss estimation

This example sets up a LEO constellation (from a CSV file or a default orbit), places a ground station, and optionally steers each satellite's antenna toward the ground station. At each CourseChange event, it outputs CSV trace data.

Common command-line options:

  • orbitFile: path to a CSV containing orbit parameters for satellites
  • traceFile: path to a CSV file to store trace data; if omitted or empty, traces are written to stdout
  • resolution: time interval between CourseChange notifications (seconds)
  • duration: total simulation time in seconds

Mode-specific options:

  • mode: one of orbit, antenna, channel (default: antenna)
  • groundStation: ground station location as "lat,lon,alt" (e.g., "41.275,1.988,14") or "auto" to place it beneath the first satellite (default: auto)
  • scenario: NTN propagation scenario (channel mode only) NTN-DenseUrban, NTN-Urban, NTN-Suburban, NTN-Rural (default: NTN-Rural)
  • frequency: carrier frequency in Hz (channel mode only, default: 2e9)
  • antennaGain: satellite antenna gain in dBi (antenna/channel mode, default: 34.6)
  • antennaUpdatePeriod: antenna orientation update interval (default: 500 ms)

Definition in file leo-satellite-example.cc.

Enumeration Type Documentation

◆ LeoMode

enum class LeoMode
strong

Simulation mode selected via –mode.

Enumerator
Orbit 

Mobility tracing only.

Antenna 

Antenna pointing toward ground station.

Channel 

Full 3GPP NTN propagation loss.

Definition at line 64 of file leo-satellite-example.cc.

Function Documentation

◆ ParseGroundStation()

Vector ParseGroundStation ( const std::string & locationStr)
static

Parse a ground station location string "lat,lon,alt" into a Vector.

Parameters
locationStrstring in "lat,lon,alt" format (degrees, degrees, meters).
Returns
Vector with x=lat, y=lon, z=alt.

Definition at line 359 of file leo-satellite-example.cc.

References NS_ABORT_MSG_IF.

Variable Documentation

◆ groundStation

◆ propagationLossModel