Skip to main content

The Python Opportunistic Network Simulator (PONS) is a discrete-event simulator for opportunistic/DTN networks.

Project description

PONS - Python Opportunistic Network Simulator

A modular DTN simulator in the style of the ONE.

Features:

  • distance- or contact-window-based network simulation
  • DTN routing algorithms
    • epidemic
    • spray & wait
    • first contact
    • direct delivery
    • PRoPHET
    • static
  • mobility
    • random waypoint
    • external ONE movement
    • external ns2 movement
  • contact plan connectivity model
    • ION DTN contact plans
    • [core contact plan}(https://github.com/gh0st42/ccm/)
  • static networkx topology
    • optionally: from graphml
    • optionally: fluctuating from contact plan
  • simulated user applications
  • tools
    • netedit-tk for generating graphml topologies
    • netreplay for generating animated gifs from graphml topologies with a contact plan or event logs

Requirements

  • simpy >= 4.0
  • networkx >= 3.2
  • plotting:
    • seaborn
    • pandas
    • matplotlib
    • numpy
  • tools:
    • pillow
    • tkinter

Example

import random
import json

import pons
import pons.routing

RANDOM_SEED = 42
SIM_TIME = 3600*24
NET_RANGE = 50
NUM_NODES = 10
WORLD_SIZE = (3000, 3000)

# Setup and start the simulation
random.seed(RANDOM_SEED)

moves = pons.generate_randomwaypoint_movement(
    SIM_TIME, NUM_NODES, WORLD_SIZE[0], WORLD_SIZE[1], max_pause=60.0)

net = pons.NetworkSettings("NET1", range=NET_RANGE)
epidemic = pons.routing.EpidemicRouter()

nodes = pons.generate_nodes(NUM_NODES, net=[net], router=epidemic)
config = {"movement_logger": False, "peers_logger": False, "event_logger": True}

msggenconfig = {"type": "single", "interval": 30, 
  "src": (0, NUM_NODES), "dst": (0, NUM_NODES), 
  "size": 100, "id": "M"}

netsim = pons.NetSim(SIM_TIME, WORLD_SIZE, nodes, moves,
                     config=config, msggens=[msggenconfig])

netsim.setup()

netsim.run()

# print results

print(json.dumps(netsim.net_stats, indent=4))
print(json.dumps(netsim.routing_stats, indent=4))

Run using python3 or for improved performance use pypy3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pons_dtn-0.1.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

pons_dtn-0.1.2-py3-none-any.whl (60.1 kB view details)

Uploaded Python 3

File details

Details for the file pons_dtn-0.1.2.tar.gz.

File metadata

  • Download URL: pons_dtn-0.1.2.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pons_dtn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0849f796d99bd93998a3912f5cce1153e46f3ca50c733e5df0bfb0c95041971d
MD5 fa00655ad330a01ec8ad36598a55f38f
BLAKE2b-256 90362d02c6e4c2f0155df6718018c82edbba724da0e5b44cb7f4dc9d6e5ad338

See more details on using hashes here.

File details

Details for the file pons_dtn-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pons_dtn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 60.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pons_dtn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 233719cd8b9f3c5ecf74fae12722a2ac1e6fd1f039efc85e604e85b6909b5fef
MD5 daa1076c17dea76e214026877746c7a5
BLAKE2b-256 fc5883521f6a75d512c27c796c85e2365e18a6b625aac2d396653d689e353973

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page