コード例 #1
0
  def __init__(self, controller_configs=None,
               topology_class=FatTree,
               topology_params="",
               patch_panel_class=BufferedPatchPanel,
               controller_patch_panel_class=UserSpaceControllerPatchPanel,
               dataplane_trace=None,
               snapshot_service=None,
               multiplex_sockets=False,
               violation_persistence_threshold=None,
               kill_controllers_on_exit=True,
               interpose_on_controllers=False,
               ignore_interposition=False):
    '''
    Constructor parameters:
      topology_class    => a sts.topology.Topology class (not object!)
                           defining the switches and links
      topology_params   => Comma-delimited list of arguments to pass into the FatTree
                           constructor, specified just as you would type them within
                           the parens.
      patch_panel_class => a sts.topology.PatchPanel class (not object!)
      dataplane_trace   => a path to a dataplane trace file
                           (e.g. dataplane_traces/ping_pong_same_subnet.trace)
      violation_persistence_threshold => number of logical time units to observe a
                                         violation before we declare that it is
                                         persistent
      interpose_on_controllers => if there are multiple controllers, whether to
                                  interpose on messages between them
      ignore_interposition => whether to configure all interposition points to immediately pass
                              through all events. (implies interpose_on_controllers=False)
                              Replayer and MCSFinder read this configuration
                              parameter, and remove all internal events from their
                              event dags if set to True.
    '''
    if controller_configs is None:
      controller_configs = []
    self.controller_configs = controller_configs
    # keep around topology_class and topology_params so we can construct
    # clean topology objects for (multiple invocations of) bootstrapping later
    self._topology_class = topology_class
    self._topology_params = topology_params
    self._patch_panel_class = patch_panel_class
    self._dataplane_trace_path = dataplane_trace
    self._violation_persistence_threshold = violation_persistence_threshold
    self._kill_controllers_on_exit = kill_controllers_on_exit

    # TODO(cs): is the snapshot service stateful?
    if snapshot_service is None:
      # For snapshotting the controller's view of the network configuration
      snapshot_service = snapshot.get_snapshotservice(controller_configs)
    self.snapshot_service = snapshot_service
    self.current_simulation = None
    self.multiplex_sockets = multiplex_sockets
    self.controller_patch_panel_class = controller_patch_panel_class
    self.interpose_on_controllers = interpose_on_controllers
    self.ignore_interposition = ignore_interposition
    if self.ignore_interposition:
      # TODO(cs): also remove "sts.util.socket_mux.pox_monkeypatcher" from start_cmd and
      #           set SimulationConfig.multiplex_sockets = False?
      self.interpose_on_controllers = False
コード例 #2
0
ファイル: simulation_state.py プロジェクト: jefflai2/sts
    def __init__(self,
                 controller_configs=None,
                 topology_class=FatTree,
                 topology_params="",
                 patch_panel_class=BufferedPatchPanel,
                 controller_patch_panel_class=UserSpaceControllerPatchPanel,
                 dataplane_trace=None,
                 snapshot_service=None,
                 multiplex_sockets=False,
                 violation_persistence_threshold=None,
                 kill_controllers_on_exit=True,
                 interpose_on_controllers=False):
        '''
    Constructor parameters:
      topology_class    => a sts.topology.Topology class (not object!)
                           defining the switches and links
      topology_params   => Comma-delimited list of arguments to pass into the FatTree
                           constructor, specified just as you would type them within
                           the parens.
      patch_panel_class => a sts.topology.PatchPanel class (not object!)
      dataplane_trace   => a path to a dataplane trace file
                           (e.g. dataplane_traces/ping_pong_same_subnet.trace)
      violation_persistence_threshold => number of logical time units to observe a
                                         violation before we declare that it is
                                         persistent
      switch_init_sleep_seconds => number of seconds to wait for switches to
                                   connect to controllers before starting the
                                   simulation. Defaults to False (no wait).
      monkey_patch_select => whether to use STS's custom deterministic
                             select. Requires that the controller is
                             monkey-patched too
    '''
        if controller_configs is None:
            controller_configs = []
        self.controller_configs = controller_configs
        # keep around topology_class and topology_params so we can construct
        # clean topology objects for (multiple invocations of) bootstrapping later
        self._topology_class = topology_class
        self._topology_params = topology_params
        self._patch_panel_class = patch_panel_class
        self._dataplane_trace_path = dataplane_trace
        self._violation_persistence_threshold = violation_persistence_threshold
        self._kill_controllers_on_exit = kill_controllers_on_exit

        # TODO(cs): is the snapshot service stateful?
        if snapshot_service is None:
            # For snapshotting the controller's view of the network configuration
            snapshot_service = snapshot.get_snapshotservice(controller_configs)
        self.snapshot_service = snapshot_service
        self.current_simulation = None
        self.multiplex_sockets = multiplex_sockets
        self.interpose_on_controllers = interpose_on_controllers
        self.controller_patch_panel_class = controller_patch_panel_class
コード例 #3
0
ファイル: simulation_state.py プロジェクト: andiwundsam/sts
  def __init__(self, controller_configs=None,
               topology_class=FatTree,
               topology_params="",
               patch_panel_class=BufferedPatchPanel,
               controller_patch_panel_class=UserSpaceControllerPatchPanel,
               dataplane_trace=None,
               snapshot_service=None,
               multiplex_sockets=False,
               violation_persistence_threshold=None,
               kill_controllers_on_exit=True,
               interpose_on_controllers=False):
    '''
    Constructor parameters:
      topology_class    => a sts.topology.Topology class (not object!)
                           defining the switches and links
      topology_params   => Comma-delimited list of arguments to pass into the FatTree
                           constructor, specified just as you would type them within
                           the parens.
      patch_panel_class => a sts.topology.PatchPanel class (not object!)
      dataplane_trace   => a path to a dataplane trace file
                           (e.g. dataplane_traces/ping_pong_same_subnet.trace)
      violation_persistence_threshold => number of logical time units to observe a
                                         violation before we declare that it is
                                         persistent
      switch_init_sleep_seconds => number of seconds to wait for switches to
                                   connect to controllers before starting the
                                   simulation. Defaults to False (no wait).
      monkey_patch_select => whether to use STS's custom deterministic
                             select. Requires that the controller is
                             monkey-patched too
    '''
    if controller_configs is None:
      controller_configs = []
    self.controller_configs = controller_configs
    # keep around topology_class and topology_params so we can construct
    # clean topology objects for (multiple invocations of) bootstrapping later
    self._topology_class = topology_class
    self._topology_params = topology_params
    self._patch_panel_class = patch_panel_class
    self._dataplane_trace_path = dataplane_trace
    self._violation_persistence_threshold = violation_persistence_threshold
    self._kill_controllers_on_exit = kill_controllers_on_exit

    # TODO(cs): is the snapshot service stateful?
    if snapshot_service is None:
      # For snapshotting the controller's view of the network configuration
      snapshot_service = snapshot.get_snapshotservice(controller_configs)
    self.snapshot_service = snapshot_service
    self.current_simulation = None
    self.multiplex_sockets = multiplex_sockets
    self.interpose_on_controllers = interpose_on_controllers
    self.controller_patch_panel_class = controller_patch_panel_class
コード例 #4
0
ファイル: simulation_state.py プロジェクト: I201821180B/sts
    def __init__(self,
                 controller_configs=None,
                 topology_class=FatTree,
                 topology_params="",
                 patch_panel_class=BufferedPatchPanel,
                 dataplane_trace=None,
                 snapshot_service=None,
                 switch_init_sleep_seconds=False):
        ''' Constructor parameters:
         topology_class    => a sts.topology.Topology class (not object!)
                              defining the switches and links
         topology_params   => Comma-delimited list of arguments to pass into the FatTree
                              constructor, specified just as you would type them within
                              the parens.
         patch_panel_class => a sts.topology.PatchPanel class (not object!)
         dataplane_trace   => a path to a dataplane trace file
                              (e.g. dataplane_traces/ping_pong_same_subnet.trace)
         switch_init_sleep_seconds => number of seconds to wait for switches to
                                      connect to controllers before starting the
                                      simulation. Defaults to False (no wait).
    '''
        if controller_configs is None:
            controller_configs = []
        self.controller_configs = controller_configs
        # keep around topology_class and topology_params so we can construct
        # clean topology objects for (multiple invocations of) bootstrapping later
        self._topology_class = topology_class
        self._topology_params = topology_params
        self._patch_panel_class = patch_panel_class
        self._dataplane_trace_path = dataplane_trace
        # TODO(cs): is the snapshot service stateful?
        if snapshot_service is None:
            # For snapshotting the controller's view of the network configuration
            snapshot_service = snapshot.get_snapshotservice(controller_configs)

        self.snapshot_service = snapshot_service
        self.current_simulation = None
        self.switch_init_sleep_seconds = switch_init_sleep_seconds
コード例 #5
0
ファイル: simulation_state.py プロジェクト: colin-scott/sts
  def __init__(self, controller_configs=None,
               topology_class=FatTree,
               topology_params="",
               patch_panel_class=BufferedPatchPanel,
               dataplane_trace=None,
               snapshot_service=None,
               switch_init_sleep_seconds=False):
    ''' Constructor parameters:
         topology_class    => a sts.topology.Topology class (not object!)
                              defining the switches and links
         topology_params   => Comma-delimited list of arguments to pass into the FatTree
                              constructor, specified just as you would type them within
                              the parens.
         patch_panel_class => a sts.topology.PatchPanel class (not object!)
         dataplane_trace   => a path to a dataplane trace file
                              (e.g. dataplane_traces/ping_pong_same_subnet.trace)
         switch_init_sleep_seconds => number of seconds to wait for switches to
                                      connect to controllers before starting the
                                      simulation. Defaults to False (no wait).
    '''
    if controller_configs is None:
      controller_configs = []
    self.controller_configs = controller_configs
    # keep around topology_class and topology_params so we can construct
    # clean topology objects for (multiple invocations of) bootstrapping later
    self._topology_class = topology_class
    self._topology_params = topology_params
    self._patch_panel_class = patch_panel_class
    self._dataplane_trace_path = dataplane_trace
    # TODO(cs): is the snapshot service stateful?
    if snapshot_service is None:
      # For snapshotting the controller's view of the network configuration
      snapshot_service = snapshot.get_snapshotservice(controller_configs)

    self.snapshot_service = snapshot_service
    self.current_simulation = None
    self.switch_init_sleep_seconds = switch_init_sleep_seconds