Generator.py – Generator

Main Module of the project. The configuration from config/config.ini is parsed. All needed devices (client, server, attacker) are initialized and started as seperate processes.

Functions

start

Generator.start()[source]

Starts the Generator. Reads needed Configurations and initializes Clients, Servers and Attackers. Starts Client, Server and Attackers as seperate processes.

writer

stop

Generator.stop(q, clientCounts, servers, serverQueues)[source]

First Level of stopping all processes. This function is running as a process and waits for all clients to be done (all required messages are sent and no state). In this case, a DONE message is sent to all servers to indicate that no more clients requests will arrive and they can shut down.

Parameters:
  • q – Own Queue to listen on incomming DONE messages.
  • clientCounts – Number of expected DONE messages.
  • servers – List of server instances.
  • serverQueues – List of server queues.

stop2

Generator.stop2(q, serverCounts, attackers, attackerQueue)[source]

Second Level of stopping all processes. This function is running as a process and waits for all servers to be done (server got a DONE message previously). In this case, a DONE message is sent to all attackers to indicate that no more packets will arrive and they can shut down.

Parameters:
  • q – Own Queue to listen on incomming DONE messages.
  • serverCounts – Number of expected DONE messages.
  • attackers – List of attacker instances.
  • attackerQueue – List of attacker queues.