January 2019
Beginner to intermediate
776 pages
19h 58m
English
ns-3 can be used to quickly prototype network protocol implementations and applications. Once you have configured ns-3 correctly, you may start running the Python examples from the folder ns-allinone-3.26/ns-3.26/examples/tutorial. More information on this can be found from https://www.nsnam.org/docs/manual/html/python.html.
Listing 9.1 simulates a network with two nodes with UDP messages between them:
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 9 # This program is optimized for Python 2.7.12 and Python 3.5.2. # It may run on any other version with/without modifications. import ns.applications import ns.core import ns.internet import ns.network import ns.point_to_point import argparse ...
Read now
Unlock full access