pons-dtn


Namepons-dtn JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryThe Python Opportunistic Network Simulator (PONS) is a discrete-event simulator for opportunistic/DTN networks.
upload_time2025-07-10 06:51:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords dtn delay-tolerant networks discrete-event simulation disruption-tolerant networks network simulation networking opportunistic networks simulator
VCS
bugtrack_url
requirements networkx simpy python-dateutil
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PONS - Python Opportunistic Network Simulator
===

A modular DTN simulator in the style of [the ONE](https://github.com/akeranen/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` for generating graphml topologies
  - `ponsanim` for generating animated gifs and mp4 from graphml topologies with a contact plan or event logs
  - `scenariorunner` to simulate scenarios described in a mix of csv and json files without writing any code 

## Requirements

- simpy >= 4.0
- networkx >= 3.2
- plotting:
  - seaborn
  - pandas
  - matplotlib
  - numpy
- tools:
  - pillow
  - opencv-python
  - tkinter


## Example

```python
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`.

## Magic ENV Variables

Some of the simulation core functions can be set during runtime without having to change your simulation code.

- `LOG_FILE` can be set to change the default event log file from `/tmp/events.log` to something else
- `SIM_DURATION` can be used to override the calculated simulation duration

For `netedit` there are also ways to influence its behavior:
- `BG_IMG` can be set to any image and it while be rendered as a background behind the network topology


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pons-dtn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "DTN, delay-tolerant networks, discrete-event simulation, disruption-tolerant networks, network simulation, networking, opportunistic networks, simulator",
    "author": null,
    "author_email": "Lars Baumgaertner <1264131+gh0st42@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/65/46/8be2b495201a48422293e62c2d86ecbd3617a572d7d8781c4d93b30a2377/pons_dtn-0.2.1.tar.gz",
    "platform": null,
    "description": "PONS - Python Opportunistic Network Simulator\n===\n\nA modular DTN simulator in the style of [the ONE](https://github.com/akeranen/the-one).\n\nFeatures:\n- distance- or contact-window-based network simulation\n- DTN routing algorithms\n  - epidemic\n  - spray & wait\n  - first contact\n  - direct delivery\n  - PRoPHET\n  - static\n- mobility\n  - random waypoint\n  - external ONE movement\n  - external ns2 movement\n- contact plan connectivity model\n  - ION DTN contact plans\n  - [core contact plan}(https://github.com/gh0st42/ccm/)\n- static networkx topology\n  - optionally: from graphml\n  - optionally: fluctuating from contact plan\n- simulated user applications\n- tools\n  - `netedit` for generating graphml topologies\n  - `ponsanim` for generating animated gifs and mp4 from graphml topologies with a contact plan or event logs\n  - `scenariorunner` to simulate scenarios described in a mix of csv and json files without writing any code \n\n## Requirements\n\n- simpy >= 4.0\n- networkx >= 3.2\n- plotting:\n  - seaborn\n  - pandas\n  - matplotlib\n  - numpy\n- tools:\n  - pillow\n  - opencv-python\n  - tkinter\n\n\n## Example\n\n```python\nimport random\nimport json\n\nimport pons\nimport pons.routing\n\nRANDOM_SEED = 42\nSIM_TIME = 3600*24\nNET_RANGE = 50\nNUM_NODES = 10\nWORLD_SIZE = (3000, 3000)\n\n# Setup and start the simulation\nrandom.seed(RANDOM_SEED)\n\nmoves = pons.generate_randomwaypoint_movement(\n    SIM_TIME, NUM_NODES, WORLD_SIZE[0], WORLD_SIZE[1], max_pause=60.0)\n\nnet = pons.NetworkSettings(\"NET1\", range=NET_RANGE)\nepidemic = pons.routing.EpidemicRouter()\n\nnodes = pons.generate_nodes(NUM_NODES, net=[net], router=epidemic)\nconfig = {\"movement_logger\": False, \"peers_logger\": False, \"event_logger\": True}\n\nmsggenconfig = {\"type\": \"single\", \"interval\": 30, \n  \"src\": (0, NUM_NODES), \"dst\": (0, NUM_NODES), \n  \"size\": 100, \"id\": \"M\"}\n\nnetsim = pons.NetSim(SIM_TIME, WORLD_SIZE, nodes, moves,\n                     config=config, msggens=[msggenconfig])\n\nnetsim.setup()\n\nnetsim.run()\n\n# print results\n\nprint(json.dumps(netsim.net_stats, indent=4))\nprint(json.dumps(netsim.routing_stats, indent=4))\n```\n\nRun using `python3` or for improved performance use `pypy3`.\n\n## Magic ENV Variables\n\nSome of the simulation core functions can be set during runtime without having to change your simulation code.\n\n- `LOG_FILE` can be set to change the default event log file from `/tmp/events.log` to something else\n- `SIM_DURATION` can be used to override the calculated simulation duration\n\nFor `netedit` there are also ways to influence its behavior:\n- `BG_IMG` can be set to any image and it while be rendered as a background behind the network topology\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Python Opportunistic Network Simulator (PONS) is a discrete-event simulator for opportunistic/DTN networks.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/gh0st42/pons",
        "Issues": "https://github.com/gh0st42/pons/issues",
        "Repository": "https://github.com/gh0st42/pons.git"
    },
    "split_keywords": [
        "dtn",
        " delay-tolerant networks",
        " discrete-event simulation",
        " disruption-tolerant networks",
        " network simulation",
        " networking",
        " opportunistic networks",
        " simulator"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "64776479c776eca639e60bc67870ddcab9f76ab31cd9d9364528c317576cb8a4",
                "md5": "91e5504d9aa58adcae035054397a590c",
                "sha256": "c498b97140a172b00539792d079d8e3065ba7b0c1354ce628bbd261acfa4245e"
            },
            "downloads": -1,
            "filename": "pons_dtn-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "91e5504d9aa58adcae035054397a590c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 64841,
            "upload_time": "2025-07-10T06:51:27",
            "upload_time_iso_8601": "2025-07-10T06:51:27.580685Z",
            "url": "https://files.pythonhosted.org/packages/64/77/6479c776eca639e60bc67870ddcab9f76ab31cd9d9364528c317576cb8a4/pons_dtn-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "65468be2b495201a48422293e62c2d86ecbd3617a572d7d8781c4d93b30a2377",
                "md5": "dc442fac11acffde354444145eba3c15",
                "sha256": "a546c44f4afa52b3454103830375f4d49d6a1b22f2c4dc6dddc395c19d508c49"
            },
            "downloads": -1,
            "filename": "pons_dtn-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "dc442fac11acffde354444145eba3c15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 1881712,
            "upload_time": "2025-07-10T06:51:29",
            "upload_time_iso_8601": "2025-07-10T06:51:29.056683Z",
            "url": "https://files.pythonhosted.org/packages/65/46/8be2b495201a48422293e62c2d86ecbd3617a572d7d8781c4d93b30a2377/pons_dtn-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 06:51:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gh0st42",
    "github_project": "pons",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "networkx",
            "specs": [
                [
                    "~=",
                    "3.3"
                ]
            ]
        },
        {
            "name": "simpy",
            "specs": [
                [
                    "~=",
                    "4.1.1"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "~=",
                    "2.9.0.post0"
                ]
            ]
        }
    ],
    "lcname": "pons-dtn"
}
        
Elapsed time: 0.84917s