Beispiel #1
0
    def __init__(self,
                 policy_db,
                 sampler,
                 dp_engine,
                 netenv,
                 ms_manager,
                 window_size,
                 network,
                 debug=False):
        self.logger = get_logger("Dense-Sparse-Pipeline",
                                 'DEBUG' if debug else 'INFO')

        self.policy_db = policy_db
        self.sampler = sampler
        self.dp_engine = dp_engine
        self.netenv = netenv
        self.ms_manager = ms_manager
        self.network = network

        # set up time analysis
        self.sampling_times = SlidingTimer(window_size)
        self.verification_times = SlidingTimer(window_size)

        # temporary variables
        self.prev_forwarding_graphs = None
        self.prev_guess_size = -1

        # statistics
        self.stats = list()
Beispiel #2
0
    def __init__(self, policy_db, netenv, ms_manager, debug=False):
        self.logger = get_logger("Dense-Sparse-Pipeline",
                                 'DEBUG' if debug else 'INFO')

        self.policy_db = policy_db
        self.netenv = netenv
        self.ms_manager = ms_manager

        # statistics
        self.stats = list()
Beispiel #3
0
    def __init__(self,
                 policy_db,
                 sampler,
                 dp_engine,
                 netenv,
                 ms_manager,
                 network,
                 debug=False):
        self.logger = get_logger("Dense-Sparse-Pipeline",
                                 'DEBUG' if debug else 'INFO')

        self.policy_db = policy_db
        self.sampler = sampler
        self.dp_engine = dp_engine
        self.netenv = netenv
        self.ms_manager = ms_manager
        self.network = network

        self.first = True
        self.prev_forwarding_graphs = None

        # statistics
        self.stats = list()
from evaluation.utils.logger import get_logger

''' main '''
if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('path', help='path to scenario')
    parser.add_argument('backend_path', help='path to backend executable', type=str)
    parser.add_argument('batfish_path', help='path to cloned Batfish GitHub repo', type=str)
    parser.add_argument('-p', '--port', help='port batfish is listening on', type=int, default=8192)
    parser.add_argument('-d', '--debug', help='enable debug output', action='store_true')
    parser.add_argument('-bd', '--backend_debug', help='enable debug output for the backend', action='store_true')
    args = parser.parse_args()

    # init logger
    debug = args.debug
    logger = get_logger("Sampling Strategy Evaluation", 'DEBUG' if debug else 'INFO')

    # name of the scenario
    scenario = os.path.basename(args.path)

    # all the necessary paths where config, fib and topology files are being stored
    batfish_path = args.batfish_path  # path to cloned Batfish repo directory
    backend_path = args.backend_path  # path to Batfish executable
    base_path = args.path

    batfish_port = args.port

    # create backend manager
    ms_manager = init_manager(backend_path, batfish_port)

    # general settings