-=== SFC OVS Developer Guide
+=== SFC-OVS Plugin
==== Overview
-In current state, SFC OVS provides mapping between SFF and OVS Bridge. It automatically configures SFF according to received OVS Bridge data. The next step is the opposite direction: configuring OVS Bridge according to SFF data.
+SFC-OVS provides integration of SFC with Open vSwitch (OVS) devices.
+Integration is realized through mapping of SFC objects (like SF, SFF,
+Classifier, etc.) to OVS objects (like Bridge, TerminationPoint=Port/Interface).
+The mapping takes care of automatic instantiation (setup) of corresponding object
+whenever its counterpart is created. For example, when a new SFF is created,
+the SFC-OVS plugin will create a new OVS bridge and when a new OVS Bridge is
+created, the SFC-OVS plugin will create a new SFF.
-==== SFC OVS Architecture
-SFC OVS uses OVSDB MDSAL for communication with Open vSwitch devices.
+==== SFC-OVS Architecture
+SFC-OVS uses the OVSDB MD-SAL Southbound API for getting/writing information
+from/to OVS devices. The core functionality consists of two types of mapping:
+
+a. mapping from OVS to SFC
+** OVS Bridge is mapped to SFF
+** OVS TerminationPoints are mapped to SFF DataPlane locators
+
+b. mapping from SFC to OVS
+** SFF is mapped to OVS Bridge
+** SFF DataPlane locators are mapped to OVS TerminationPoints
+
+.SFC < -- > OVS mapping flow diagram
+image::sfc/sfc-ovs-architecture.png[width=500]
==== Key APIs and Interfaces
-* Provides API to configure/control OVS through SFC
-* Support for these device types:
-** Service Function Forwarder (SFF)
-** (to be done) Service Function (SF)
-** (to be done) Classifier
+* SFF to OVS mapping API (methods to convert SFF object to OVS Bridge
+and OVS TerminationPoints)
+* OVS to SFF mapping API (methods to convert OVS Bridge and OVS TerminationPoints
+to SFF object)
-=== SFC OVS User Guide
+=== SFC-OVS integration
==== Overview
-In current state, SFC OVS provides mapping between SFF and OVS Bridge. It automatically configures SFF according to received OVS Bridge data. The next step is the opposite direction: configuring OVS Bridge according to SFF data.
+SFC-OVS provides integration of SFC with Open vSwitch (OVS) devices.
+Integration is realized through mapping of SFC objects (like SF, SFF,
+Classifier, etc.) to OVS objects (like Bridge, TerminationPoint=Port/Interface).
+The mapping takes care of automatic instantiation (setup) of corresponding object
+whenever its counterpart is created. For example, when a new SFF is created,
+the SFC-OVS plugin will create a new OVS bridge and when a new OVS Bridge is
+created, the SFC-OVS plugin will create a new SFF.
-==== SFC OVS Architecture
-SFC OVS uses OVSDB MDSAL for communication with Open vSwitch devices.
+The feature is intended for SFC users willing to use Open vSwitch as underlying
+network infrastructure for deploying RSPs (Rendered Service Paths).
-==== Configuring SFC OVS
-TBA
+==== SFC-OVS Architecture
+SFC-OVS uses the OVSDB MD-SAL Southbound API for getting/writing information
+from/to OVS devices. From the user perspective SFC-OVS acts as a layer between
+SFC DataStore and OVSDB.
-==== Administering or Managing SFC OVS
-TBA
+.SFC-OVS integration into ODL
+image::sfc/sfc-ovs-architecture-user.png[width=250]
+
+==== Configuring SFC-OVS
+.Configuration steps:
+. Run ODL distribution (run karaf)
+. In karaf console execute: +feature:install odl-sfc-ovs+
+. Configure Open vSwitch to use ODL as a manager, using following command:
++ovs-vsctl set-manager tcp:<odl_ip_address>:6640+
==== Tutorials
-TBA
+
+===== Verifying mapping from OVS to SFF
+
+====== Overview
+This tutorial shows the usual workflow when OVS configuration is transformed to
+corresponding SFC objects (in this case SFF).
+
+====== Prerequisities
+* Open vSwitch installed (ovs-vsctl command available in shell)
+* SFC-OVS feature configured as stated above
+
+====== Instructions
+.In shell execute:
+. +ovs-vsctl set-manager tcp:<odl_ip_address>:6640+
+. +ovs-vsctl add-br br1+
+. +ovs-vsctl add-port br1 testPort+
+
+====== Verification
+.There are two possible ways to verify if SFF was created:
+a. visit SFC User Interface:
++http://<odl_ip_address>:8181/sfc/index.html#/sfc/serviceforwarder+
+b. use pure RESTCONF and send GET request to URL:
++http://<odl_ip_address>:8181/restconf/config/service-function-forwarder:service-function-forwarders+
+
+There should be SFF, which name will be ending with 'br1' and the SFF should
+containt two DataPlane locators: 'br1' and 'testPort'.
+
+===== Verifying mapping from SFF to OVS
+
+====== Overview
+This tutorial shows the usual workflow during creation of OVS Bridge with use
+of SFC APIs.
+
+====== Prerequisities
+* Open vSwitch installed (ovs-vsctl command available in shell)
+* SFC-OVS feature configured as stated above
+
+====== Instructions
+.Steps:
+. In shell execute: +ovs-vsctl set-manager tcp:<odl_ip_address>:6640+
+. Send POST request to URL:
++http://<odl_ip_address>:8181/restconf/operations/service-function-forwarder-ovs:create-ovs-bridge+
+Use Basic auth with credentials: "admin", "admin" and set +Content-Type: application/json+.
+The content of POST request should be following:
+----
+{
+ "input":
+ {
+ "name": "br-test",
+ "ovs-node": {
+ "ip": "<Open_vSwitch_ip_address>"
+ }
+ }
+}
+----
+Open_vSwitch_ip_address is IP address of machine, where Open vSwitch is installed.
+
+====== Verification
+In shell execute: +ovs-vsctl show+. There should be Bridge with name 'br-test'
+and one port/interface called 'br-test'.
+
+Also, corresponding SFF for this OVS Bridge should be configured, which can be
+verified through SFC User Interface or RESTCONF as stated in previous tutorial.