Getting Started

Get from install to your first simulation in under 5 minutes.

DSNS is an event-driven network simulator for satellite and interplanetary communication. This guide will take you through installing the simulator and running a simple scenario.

Installation

DSNS is distributed on PyPI and can be installed in seconds:

Terminal
pip install dsns

For development, install from source with the editable flag:

Terminal
git clone https://github.com/ssloxford/DSNS.git
cd DSNS
pip install --editable .

Your First Simulation

Run a CCSDS Earth-Moon reference scenario in 32 lines:

earth_observation.py
import os, pickle
from dsns.presets import EarthMoonMarsMultiConstellation
from dsns.simulation import Simulation
from dsns.transmission import LinkTransmissionActor, MessageLocationTracker
from dsns.traffic_sim import MultiPointToPointTrafficActor
from dsns.message_actors import MessageRoutingActor, LookaheadRoutingDataProvider
from dsns.logging import PreprocessedLoggingActor, BandwidthLoggingActor, LTPTransmissionLoggingActor
from dsns.message import LossConfig

constellation = EarthMoonMarsMultiConstellation(moon=True, mars=False, moon_mars_link=False) tracker = MessageLocationTracker() routing_data_provider = LookaheadRoutingDataProvider(resolution=15.0, num_steps=600)

actors = [ LinkTransmissionActor(default_bandwidth=100e6/8, buffer_if_link_busy=True, reroute_on_link_down=True, message_location_tracker=tracker), MultiPointToPointTrafficActor([("EarthToMoon", 0, 345, 1e6, 15.0)], update_interval=300, reliable_messages=False, cutoff=28800), ]

actors.append(MessageRoutingActor(routing_data_provider, store_and_forward=True, model_bandwidth=True, loss_config=LossConfig()))

logging_actor_pre = PreprocessedLoggingActor(log_other=False) logging_actor_bw = BandwidthLoggingActor() logging_actor_ltp = LTPTransmissionLoggingActor()

sim = Simulation(constellation, actors=actors, logging_actors=[logging_actor_pre, logging_actor_bw, logging_actor_ltp], data_providers=[routing_data_provider], timestep=15.0) sim.initialize(0) sim.run(43200, progress=True)

os.makedirs("results", exist_ok=True) with open("results/pre.pickle", "wb") as f: pickle.dump((pre.direct_messages, pre.broadcast_messages, pre.other_events), f) with open("results/bw.pickle", "wb") as f: pickle.dump(bw.aggregate(1.0, default_bandwidth=100e6/8), f) with open("results/ltp.pickle", "wb") as f: pickle.dump(ltp.aggregate(1.0), f)


Next Steps

The complete API reference, tutorials, and examples are hosted separately using Sphinx.


Need Help?