aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilly O'Mahony <billy.o.mahony@intel.com>2015-10-08 11:47:03 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-10-12 11:50:15 +0000
commitf8b7dd0a2611061fed7134474ae10ab85e80cf3d (patch)
treedd450a4a92ffdd4ceb88b2f37ee07858ef1175db
parent32d4bf344c538c7d9a17906994e34a8e431721bd (diff)
docs: Add overview of the structure of vsperf code
Text & sequence diagrams as both source and png. JIRA: VSPERF-106 Signed-off-by: Billy O'Mahony<billy.o.mahony@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Eugene Snider <Eugene.Snider@huawei.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Gurpreet Singh <gurpreet.singh@spirent.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com> Change-Id: I33f57fba85710ab4cfc72d0a5d06db6f653545d6
-rw-r--r--docs/images/factory_and_loader.pngbin0 -> 25586 bytes
-rw-r--r--docs/images/traffic_controller.pngbin0 -> 57868 bytes
-rw-r--r--docs/images/vsperf.pngbin0 -> 93029 bytes
-rwxr-xr-xdocs/msc/factory_and_loader.msc17
-rwxr-xr-xdocs/msc/traffic_controller.msc30
-rwxr-xr-xdocs/msc/vsperf.msc47
-rw-r--r--docs/vswitchperf_design.rst204
7 files changed, 298 insertions, 0 deletions
diff --git a/docs/images/factory_and_loader.png b/docs/images/factory_and_loader.png
new file mode 100644
index 00000000..290c0af6
--- /dev/null
+++ b/docs/images/factory_and_loader.png
Binary files differ
diff --git a/docs/images/traffic_controller.png b/docs/images/traffic_controller.png
new file mode 100644
index 00000000..598296ec
--- /dev/null
+++ b/docs/images/traffic_controller.png
Binary files differ
diff --git a/docs/images/vsperf.png b/docs/images/vsperf.png
new file mode 100644
index 00000000..4af2ac62
--- /dev/null
+++ b/docs/images/vsperf.png
Binary files differ
diff --git a/docs/msc/factory_and_loader.msc b/docs/msc/factory_and_loader.msc
new file mode 100755
index 00000000..a744607e
--- /dev/null
+++ b/docs/msc/factory_and_loader.msc
@@ -0,0 +1,17 @@
+
+msc {
+
+hscale = "1.5";
+
+ #Entities
+ app, loader, component_factory, traffic_ctlr;
+
+ #Arcs
+ app => loader [label = "get_trafficgen_class()"];
+ loader note loader [label = "searches TRAFFICGEN_DIR for classes implementing ITraffic and matching name configured as TRAFFICGEN"];
+ app << loader [label = "TrafficGenClass"];
+ app => component_factory [label = "create_traffic(traffic_type, TrafficGenClass"];
+ component_factory note component_factory [label = "Component Factory maps from a traffic_type (string) to a TrafficController class"];
+ component_factory => traffic_ctlr [label = "create()"];
+ app << component_factory [label= "traffic_ctlr"];
+ }
diff --git a/docs/msc/traffic_controller.msc b/docs/msc/traffic_controller.msc
new file mode 100755
index 00000000..bd66cce1
--- /dev/null
+++ b/docs/msc/traffic_controller.msc
@@ -0,0 +1,30 @@
+
+# mscgen file
+msc {
+ #Options
+ hscale = "1.5";
+
+ #Entities
+ testcase, traffic_ctlr, traffic_gen, traffic_defaults, HwSwTrafficGen;
+
+ #Arcs
+ HwSwTrafficGen note HwSwTrafficGen [ label = "Ixia, Spirent, Xena, Moongen, etc."];
+ testcase => traffic_ctlr [ label = "create(traffic_gen_class)" ];
+ traffic_ctlr => traffic_gen [label = "create()"];
+ traffic_ctlr => traffic_gen [label = "connect()"];
+ testcase => traffic_ctlr [ label = "send_traffic(traffic)" ];
+ --- [ label = "foreach packet_size in configuration"];
+ traffic_ctlr note traffic_ctlr [ label = "invokes send_rfc2544_back2back/tput or send_cont based on traffic['traffic_type']; Also fetches duration/trials from config" ];
+ traffic_ctlr => traffic_gen [ label = "send_rfc2544_tput(traffic, ...)" ];
+ traffic_gen -> traffic_gen [ label = "start_rfc2544_tput(traffic)" ];
+ traffic_gen => traffic_defaults [ label = "default_traffic_params = read()" ];
+ traffic_gen note traffic_gen [ label = "merge traffic with default_traffic_params)" ];
+ traffic_gen note traffic_gen [ label = "Actual test starts here. Details of interactions between traffic_gen class actual traffic generator (HwSwTrafficGen) are hidden to vsperf"];
+ traffic_gen <=> HwSwTrafficGen [ label = "..."];
+ traffic_gen => traffic_gen [ label = "wait_rfc2544_throughput()"];
+ traffic_ctlr << traffic_gen [ label = "results (string/value pairs)"];
+ traffic_ctlr note traffic_ctlr [ label = "store_results()" ];
+ --- [ label = "end foreach"];
+ testcase => traffic_ctlr [label = "get_results()"];
+ testcase => testcase [label = "write_results_to_file"];
+} \ No newline at end of file
diff --git a/docs/msc/vsperf.msc b/docs/msc/vsperf.msc
new file mode 100755
index 00000000..4d2c6bad
--- /dev/null
+++ b/docs/msc/vsperf.msc
@@ -0,0 +1,47 @@
+msc {
+ #Options
+ hscale = "2.0";
+
+ #Entities
+ vsperf, testcase, vnf_ctl, vnf, vswitch_ctl, vswitch, traffic_ctl, traffic_gen, load_gen;
+
+ #Arcs
+ vsperf note vsperf [ label = "$ ./vsperf pvp_tput" ];
+ vsperf note vsperf [ label = " foreach test specified" ];
+ vsperf => testcase [ label="run()" ];
+ --- [ label = " skipping details of finding and creating correct subclasses of IVSwitch, ITrafficGenerator etc." ];
+ testcase => vswitch_ctl [ label="create(vswitch_class" ];
+ vswitch_ctl note vswitch_ctl [ label="vswitch_ctl is instance of VswitchControllerPvp"];
+ testcase => vnf_ctl [ label="create(vnf_class)" ];
+ vnf_ctl note vnf_ctl [ label="vnf_ctl is instance of VnfControllerPvp"];
+ testcase => traffic_ctl [ label="create()" ];
+ traffic_ctl note traffic_ctl [ label="traffic_ctl is instance of TrafficControllerRFC2544"];
+ |||;
+ testcase note testcase [ label="Python context management protocol __enter__, __exit__ is used to start/stop controllers"];
+ testcase => vswitch_ctl [ label="__enter__()"];
+ vswitch_ctl => vswitch [ label ="create()"];
+ vswitch note vswitch [label="vswitch is instance of OvsDpdkVhost"];
+ vswitch_ctl => vswitch [ label="add_phy_port()" ];
+ vswitch_ctl => vswitch [ label="add_vport()" ];
+ vswitch_ctl => vswitch [ label="add_flow()" ];
+ --- [ label = " skipping full details of switch configuration " ];
+ |||;
+ testcase => vnf_ctl [ label="__enter__()"];
+ vnf_ctl => vnf [ label="create()"];
+ |||;
+ testcase => load_gen [ label="create/start()" ];
+ load_gen note load_gen [ label="loadgen simulates system load using 'stress' tool "];
+ |||;
+ testcase => traffic_ctl [ label="send_traffic(traffic)" ];
+ traffic_ctl note traffic_ctl [ label="'traffic' specifies the 'Traffic Type' from 01_testcases.conf as well as other traffic details" ];
+ traffic_ctl => traffic_gen [label="send_rfc2544_throughput()"];
+ traffic_gen note traffic_gen [label="The implementation is dependent on the vendor specific Traffic Gen used"];
+ |||;
+ traffic_ctl << traffic_gen [label="returns results as str:value pairs"];
+ testcase << traffic_ctl;
+ testcase => traffic_ctl [label="get_results()"];
+ testcase => testcase [label="write_result_to_file()"];
+ |||;
+ |||;
+}
+
diff --git a/docs/vswitchperf_design.rst b/docs/vswitchperf_design.rst
new file mode 100644
index 00000000..689c2098
--- /dev/null
+++ b/docs/vswitchperf_design.rst
@@ -0,0 +1,204 @@
+Intended Audience
+=================
+
+This document is intended to aid those who want to modify the vsperf code. Or to extend it - for example to add support for new traffic generators, deployment scenarios and so on.
+
+Usage
+=====
+
+Example Command Lines
+---------------------
+
+List all the cli options:
+
+ .. code-block:: console
+
+ $ ./vsperf -h
+
+Run all tests that have ``tput`` in their name - ``p2p_tput``, ``pvp_tput`` etc.:
+
+ .. code-block:: console
+
+ $ ./vsperf --tests 'tput'
+
+As above but override default configuration with settings in 'my_settings.py'. This is useful as modifying configuration directly in the configuration files in ``conf/NN_*.py`` shows up as changes under git source control:
+
+ .. code-block:: console
+
+ $ ./vsperf --conf-file my_settings.py --tests 'tput'
+
+Override specific test parameters. Useful for shortening the duration of tests for development purposes:
+
+ .. code-block:: console
+
+ $ ./vsperf --test-params 'rfc2544_duration=10;rfc2544_trials=1;packet_sizes=64' --tests 'pvp_tput'
+
+Typical Test Sequence
+=====================
+
+This is a typical flow of control for a test.
+
+.. image:: images/vsperf.png
+
+
+Configuration
+=============
+
+The conf package contains the configuration files (``*.conf``) for all system components, it also provides a ``settings`` object that exposes all of these settings.
+
+Settings are not passed from component to component. Rather they are available globally to all components once they import the conf package.
+
+ .. code-block:: python
+
+ from conf import settings
+ ...
+ log_file = settings.getValue('LOG_FILE_DEFAULT')
+
+Settings files (``*.conf``) are valid python code so can be set to complex types such as lists and dictionaries as well as scalar types:
+
+ .. code-block:: python
+
+ first_packet_size = settings.getValue('PACKET_SIZE_LIST')[0]
+
+Configuration Procedure and Precedence
+--------------------------------------
+
+Configuration files follow a strict naming convention that allows them to be processed in a specific order. All the .conf files are named ``NN_name.conf``, where NN is a decimal digit. The files are processed in order from 00_name.conf to 99_name.conf so that if the name setting is given in both a lower and higher numbered conf file then the higher numbered file is the effective setting as it is processed after the setting in the lower numbered file.
+
+The values in the file specified by ``--conf-file`` takes precedence over all the other configuration files and does not have to follow the naming convention.
+
+
+Other Configuration
+-------------------
+
+``conf.settings`` also loads configuration from the command line and from the environment.
+
+VM, vSwitch, Traffic Generator Independence
+===========================================
+
+VSPERF supports different vSwithes, Traffic Generators and VNFs by using standard object-oriented polymorphism:
+
+ * Support for vSwitches is implemented by a class inheriting from IVSwitch.
+ * Support for Traffic Generators is implemented by a class inheriting from ITrafficGenerator.
+ * Support for VNF is implemented by a class inheriting from IVNF.
+
+By dealing only with the abstract interfaces the core framework can support many implementations of different vSwitches, Traffic Generators and VNFs.
+
+IVSwitch
+--------
+
+ .. code-block:: python
+
+ class IVSwitch:
+ start(self)
+ stop(self)
+ add_switch(switch_name)
+ del_switch(switch_name)
+ add_phy_port(switch_name)
+ add_vport(switch_name)
+ get_ports(switch_name)
+ del_port(switch_name, port_name)
+ add_flow(switch_name, flow)
+ del_flow(switch_name, flow=None)
+
+ITrafficGenerator
+-----------------
+
+ .. code-block:: python
+
+ class ITrafficGenerator:
+ connect()
+ disconnect()
+
+ send_burst_traffic(traffic, numpkts, time, framerate)
+
+ send_cont_traffic(traffic, time, framerate)
+ start_cont_traffic(traffic, time, framerate)
+ stop_cont_traffic(self):
+
+ send_rfc2544_throughput(traffic, trials, duration, lossrate)
+ start_rfc2544_throughput(traffic, trials, duration, lossrate)
+ wait_rfc2544_throughput(self)
+
+ send_rfc2544_back2back(traffic, trials, duration, lossrate)
+ start_rfc2544_back2back(traffic, , trials, duration, lossrate)
+ wait_rfc2544_back2back()
+
+Note ``send_xxx()`` blocks whereas ``start_xxx()`` does not and must be followed by a subsequent call to ``wait_xxx()``.
+
+IVnf
+----
+
+ .. code-block:: python
+
+ class IVnf:
+ start(memory, cpus,
+ monitor_path, shared_path_host,
+ shared_path_guest, guest_prompt)
+ stop()
+ execute(command)
+ wait(guest_prompt)
+ execute_and_wait (command)
+
+Controllers
+-----------
+
+Controllers are used in conjunction with abstract interfaces as way of decoupling the control of vSwtiches, VNFs and TrafficGenerators from other components.
+
+The controlled classes provide basic primitive operations. The Controllers sequence and co-ordinate these primitive operation in to useful actions. For instance the vswitch_controller_PVP can be used to bring any vSwitch (that implements the primitives defined in IVSwitch) into the configuration required by the Phy-to-Phy Deployment Scenario.
+
+In order to support a new vSwitch only a new implementation of IVSwitch needs be created for the new vSwitch to be capable of fulfilling all the Deployment Scenarios provided for by existing or future vSwitch Controllers.
+
+Similarly if a new Deployment Scenario is required it only needs to be written once as a new vSwitch Controller and it will immediately be capable of controlling all existing and future vSwitches in to that Deployment Scenario.
+
+Similarly the Traffic Controllers can be used to co-ordinate basic operations provided by implementers of ITrafficGenerator to provide useful tests. Though traffic generators generally already implement full test cases i.e. they both generate suitable traffic and analyse returned traffic in order to implement a test which has typically been predefined in an RFC document. However the Traffic Controller class allows for the possibility of further enhancement - such as iterating over tests for various packet sizes or creating new tests.
+
+Traffic Controller's Role
+-------------------------
+
+.. image:: images/traffic_controller.png
+
+
+Loader & Component Factory
+--------------------------
+
+The working of the Loader package (which is responsible for *finding* arbitrary classes based on configuration data) and the Component Factory which is responsible for *choosing* the correct class for a particular situation - e.g. Deployment Scenario can be seen in this diagram.
+
+.. image:: images/factory_and_loader.png
+
+Routing Tables
+==============
+
+Vsperf uses a standard set of routing tables in order to allow tests to easily mix and match Deployment Scenarios (PVP, P2P topology), Tuple Matching and Frame Modification requirements.
+
+::
+
+ +--------------+
+ | |
+ | Table 0 | table#0 - Match table. Flows designed to force 5 & 10 tuple matches go here.
+ | |
+ +--------------+
+ |
+ |
+ v
+ +--------------+ table#1 - Routing table. Flows to route packets between ports goes here.
+ | | The chosen port is communicated to subsequent tables by setting the
+ | Table 1 | metadata value to the egress port number. Generally this table
+ | | is set-up by by the vSwitchController.
+ +--------------+
+ |
+ |
+ v
+ +--------------+ table#2 - Frame modification table. Frame modification flow rules are
+ | | isolated in this table so that they can be turned on or off
+ | Table 2 | without affecting the routing or tuple-matching flow rules.
+ | | This allows the frame modification and tuple matching required by the
+ +--------------+ tests in the VSWITCH PERFORMANCE FOR TELCO NFV test specification
+ | to be independent of the Deployment Scenario set up by the vSwitchController.
+ |
+ v
+ +--------------+
+ | |
+ | Table 3 | table#3 - Egress table. Egress packets on the ports setup in Table 1.
+ | |
+ +--------------+