emane_docker package

Submodules

emane_docker.constant module

class emane_docker.constant.Constant[source]

Bases: object

BGP_CP = 'bgp'
CP_CONFIG_DIRECTORY = 'container_helpers/configs'
ISIS_CP = 'isis'
OLSR_CP = 'olsr'
OLSRv2_CP = 'olsrv2'
OSPF_CP = 'ospf'
PLATFORM_DOCKER = 'docker'
REDIS_WAIT_TIME = 5.0
RIP_CP = 'rip'
SDN_CP = 'sdn'
SUPPORTED_CONTROL_PLANES = ['sdn', 'ospf', 'olsr', 'olsrv2', 'bgp', 'isis', 'rip']
SUPPORTED_PLATFORMS = ['docker']
TEMPLATE_DIRECTORY = 'templates'

emane_docker.distribution module

class emane_docker.distribution.DistributionParser(distribution)[source]

Bases: object

rewind()[source]
start_next_simulation()[source]
emane_docker.distribution.parse_distribution(dist_conf)[source]

emane_docker.event_generator module

class emane_docker.event_generator.EventGenerator(nodes, link_update, duration)[source]

Bases: object

Generates EMANE Events.

Parameters:
  • nodes – The list of nodes.
  • link_update – Link update configuration.
  • duration – Duration of the experiment.
start()[source]

emane_docker.log module

emane_docker.log.add_file_logger(logfile, no_stdout=False)[source]

Adds logfile to the logger. If no_stdout is set, the logger will not print the logs to stdout

Parameters:logfile – Full path of the log file.
emane_docker.log.setup(debug=False)[source]

Setups the logger. This should be called once at the beginning of the program.

Parameters:debug

emane_docker.main module

emane_docker.main.main()[source]

The main function sets up the environment by reading the command line and configuration file and runs EMANE-Docker platform.

Returns:0 after a successful execution.

emane_docker.result_report module

class emane_docker.result_report.Flow(flow_id, start_time, flow_type, source, destination, rate)[source]

Bases: object

add_seq(seq_id, size)[source]
set_finish_time(finish_time)[source]
class emane_docker.result_report.Report(num_nodes)[source]

Bases: object

draw_figures()[source]
print_flows()[source]

emane_docker.topology module

class emane_docker.topology.EmaneTopology(config)[source]

Bases: object

container_cp(r, src, dst)[source]
create_emane_interface()[source]
generate_configs()[source]
generate_cp_config(config_path, node, control_plane)[source]

Generates control plane configurations. User can override the default values by specifying it at EMANE-Docker configuration file. See the config.default.yaml for details.

Parameters:
  • config_path – Configuration path
  • node – The node
  • control_plane – The CP plane (OLSR, OLSRv2, OSPF, BGP, IS-IS and RIP)
generate_emane_config(config_path, node, emane_configuration)[source]
generate_emane_scenario_eel()[source]
generate_zebra_config(config_path, node)[source]
jinja_renderer(temp_path, dest_path, confs)[source]
load_topology()[source]

Loads the topology file specified by the user (either in configuration file or as a command line parameter.

remove_emane_interface()[source]
run_experiment(wait=False)[source]
run_threadpool(method, params)[source]

Runs a threadpool for given methods and params. Used when starting/stopping/configuring nodes. It blocks until the threadpool finishes.

Parameters:
  • method – The method to run
  • params – Method parameters
start()[source]

Starts EMANE-Docker

Returns:
start_cli()[source]

Starts EMANE-Docker CLI.

start_container_helpers(node)[source]
start_docker_container(node)[source]
start_emane_eventservice()[source]
start_emane_on_node(node)[source]
start_event_generator()[source]
start_traffic_generator()[source]
stop(sig=None, frame=None)[source]

Stops EMANE-Docker

Parameters:
  • sig – Signal type (Expected: SIGINT)
  • frame
Returns:

stop_docker_container(node)[source]

Bases: object

Contains the information related to a link between two nodes (nodes).

Parameters:
  • node1
  • node2
  • mask1
  • mask2
  • lid
  • ip1
  • ip2
DOWN = 0
UP = 1
contains(node1, node2=None)[source]
set_port_ids(node1_portid, node2_portid)[source]
swap_nodes()[source]
class emane_docker.topology.Node(domain, node, index, as_id)[source]

Bases: object

It contains information related to each “emulated” node. Each node runs as a separate Docker container. The names node and node are used interchangeably throughout this project.

Parameters:
  • domain – The domain that node belongs to.
  • node – The node dictionary, see the configuration examples for details.

emane_docker.topology_drawer module

emane_docker.topology_drawer.draw(nodes, out_file=None)[source]

Draws the given topology.

Parameters:
  • nodes – List of nodes in the topology.
  • out_file – If specified, the topology figure is saved to that file.
Returns:

emane_docker.traffic_generator module

class emane_docker.traffic_generator.TrafficGenerator(nodes, containers, traffic_config, generate_configurations, duration)[source]

Bases: object

start()[source]

emane_docker.util module

emane_docker.util.mkdir_p(path)[source]

Module contents