coordsim.simulation package

Submodules

coordsim.simulation.flowsimulator module

class coordsim.simulation.flowsimulator.FlowSimulator(env, params)

Bases: object

depart_flow(flow)

Process the flow at the requested SF of the current node.

forward_flow(flow, next_node)

Calculates the path delays occurring when forwarding a node Path delays are calculated using the Shortest path The delay is simulated by timing out for the delay amount of duration

generate_flow(node_id)

Generate flows at the ingress nodes.

get_next_node(flow, sf)

Get next node using weighted probabilites from the scheduler

init_flow(flow)

Initialize flows within the network. This function takes the generated flow object at the ingress node and handles it according to the requested SFC. We check if the SFC that is being requested is indeed within the schedule, otherwise we log a warning and drop the flow. The algorithm will check the flow’s requested SFC, and will forward the flow through the network using the SFC’s list of SFs based on the LB rules that are provided through the scheduler’s ‘flow_schedule()’ function.

pass_flow(flow, sfc)

Passes the flow to the next node to begin processing. The flow might still be arriving at a previous node or SF. This function is used in a mutual recursion alongside process_flow() function to allow flows to arrive and begin processing without waiting for the flow to completely arrive. The mutual recursion is as follows: pass_flow() -> process_flow() -> pass_flow() and so on… Breaking condition: Flow reaches last position within the SFC, then process_flow() calls depart_flow() instead of pass_flow(). The position of the flow within the SFC is determined using current_position attribute of the flow object.

process_flow(flow, sfc)

Process the flow at the requested SF of the current node.

start()

Start the simulator.

coordsim.simulation.flowsimulator.log = <Logger coordsim.simulation.flowsimulator (WARNING)>

Flow Simulator class This class holds the flow simulator and its internal flow handling functions. Flow of data through the simulator (abstract):

start() -> generate_flow() -> init_flow() -> pass_flow() -> process_flow() and forward_flow() -> depart_flow() or pass_flow()

coordsim.simulation.simulatorparams module

Flow Simulator parameters. - Allows for clean and quick access to parameters from the flow simulator. - Facilitates the quick changing of schedule decisions and other parameters for the simulator.

class coordsim.simulation.simulatorparams.SimulatorParams(network, ing_nodes, sfc_list, sf_list, config, seed, schedule={}, sf_placement={})

Bases: object

Module contents

class coordsim.simulation.FlowSimulator(env, params)

Bases: object

depart_flow(flow)

Process the flow at the requested SF of the current node.

forward_flow(flow, next_node)

Calculates the path delays occurring when forwarding a node Path delays are calculated using the Shortest path The delay is simulated by timing out for the delay amount of duration

generate_flow(node_id)

Generate flows at the ingress nodes.

get_next_node(flow, sf)

Get next node using weighted probabilites from the scheduler

init_flow(flow)

Initialize flows within the network. This function takes the generated flow object at the ingress node and handles it according to the requested SFC. We check if the SFC that is being requested is indeed within the schedule, otherwise we log a warning and drop the flow. The algorithm will check the flow’s requested SFC, and will forward the flow through the network using the SFC’s list of SFs based on the LB rules that are provided through the scheduler’s ‘flow_schedule()’ function.

pass_flow(flow, sfc)

Passes the flow to the next node to begin processing. The flow might still be arriving at a previous node or SF. This function is used in a mutual recursion alongside process_flow() function to allow flows to arrive and begin processing without waiting for the flow to completely arrive. The mutual recursion is as follows: pass_flow() -> process_flow() -> pass_flow() and so on… Breaking condition: Flow reaches last position within the SFC, then process_flow() calls depart_flow() instead of pass_flow(). The position of the flow within the SFC is determined using current_position attribute of the flow object.

process_flow(flow, sfc)

Process the flow at the requested SF of the current node.

start()

Start the simulator.