Merge "Fix links to OVSDB docs"
[docs.git] / docs / user-guide / service-function-chaining.rst
index 7a8af797dee7eb4ecaa318da812ca81802cdece9..a41d298ad3c50207e8b9fe0ef5640acac6fa0d59 100644 (file)
@@ -409,6 +409,8 @@ RSP. Refer to the following diagram for more details.
 
    SFC OpenFlow Renderer High Level Architecture
 
+.. _sfc-user-guide-sfc-of-pipeline:
+
 SFC OpenFlow Switch Flow pipeline
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -533,7 +535,7 @@ Next Hop Table detailed
 The Next Hop table uses the RSP Path Id and appropriate packet fields to
 determine where to send the packet next. For NSH, only the NSP (Network
 Services Path, RSP ID) and NSI (Network Services Index, next hop) fields
-from the NSH header are needed to determine the VxLAN tunnel destination
+from the NSH header are needed to determine the VXLAN tunnel destination
 IP. For VLAN or MPLS, then the source MAC address is used to determine
 the destination MAC address.
 
@@ -2500,9 +2502,10 @@ Logical Service Function Forwarder
 Overview
 ~~~~~~~~
 
+.. _sfc-user-guide-logical-sff-motivation:
+
 Rationale
 ^^^^^^^^^
-
 When the current SFC is deployed in a cloud environment, it is assumed that each
 switch connected to a Service Function is configured as a Service Function Forwarder and
 each Service Function is connected to its Service Function Forwarder depending on the
@@ -2552,48 +2555,6 @@ YANG model can be found here `logical SFF model
 How to configure the Logical SFF
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 The following are examples to configure the Logical SFF:
-
-::
-
-    curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '${JSON}' -X PUT --user admin:admin http://localhost:8181/restconf/config/service-node:service-nodes/
-
-**Service Nodes JSON.**
-
-::
-
-    {
-    "service-nodes": {
-        "service-node": [
-            {
-                "name": "classifier1",
-                "service-function": [
-                ],
-                "ip-mgmt-address": "192.168.1.10"
-            },
-            {
-                "name": "sf1",
-                "service-function": [
-                    "dpi-1"
-                ],
-                "ip-mgmt-address": "192.168.1.30"
-            },
-            {
-                "name": "sf2",
-                "service-function": [
-                    "firewall-1"
-                ],
-                "ip-mgmt-address": "192.168.1.40"
-            },
-            {
-                "name": "classifier2",
-                "service-function": [
-                ],
-                "ip-mgmt-address": "192.168.1.60"
-            }
-        ]
-    }
-    }
-
 ::
 
     curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '${JSON}' -X PUT --user admin:admin http://localhost:8181/restconf/config/restconf/config/service-function:service-functions/
@@ -2606,29 +2567,28 @@ The following are examples to configure the Logical SFF:
     "service-functions": {
         "service-function": [
             {
-                "name": "dpi-1",
-                "ip-mgmt-address": "192.168.1.30",
-                "rest-uri": "http://192.168.1.30:5000",
-                "type": "dpi",
+                "name": "firewall-1",
+                "type": "firewall",
                 "nsh-aware": "true",
                 "sf-data-plane-locator": [
                     {
-                        "name": "dpi-1-dpl",
-                        "interface-name": "e0fffc12-a46e-4575-bf36-8383c8edefed",
+                        "name": "firewall-dpl",
+                        "interface-name": "eccb57ae-5a2e-467f-823e-45d7bb2a6a9a",
+                        "transport": "service-locator:eth-nsh",
                         "service-function-forwarder": "sfflogical1"
+
                     }
                 ]
             },
             {
-                "name": "firewall-1",
-                "ip-mgmt-address": "192.168.1.40",
-                "rest-uri": "http://192.168.1.40:5000",
-                "type": "firewall",
+                "name": "dpi-1",
+                "type": "dpi",
                 "nsh-aware": "true",
                 "sf-data-plane-locator": [
                     {
-                        "name": "firewall-1-dpl",
-                        "interface-name": "952a5486-d1a5-40cd-a7c1-cc61e59a2b36",
+                        "name": "dpi-dpl",
+                        "interface-name": "df15ac52-e8ef-4e9a-8340-ae0738aba0c0",
+                        "transport": "service-locator:eth-nsh",
                         "service-function-forwarder": "sfflogical1"
                     }
                 ]
@@ -2693,3 +2653,284 @@ The following are examples to configure the Logical SFF:
         ]
     }
     }
+
+::
+
+    curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '${JSON}' -X PUT --user admin:admin http://localhost:8182/restconf/config/service-function-chain:service-function-paths/
+
+**Service Function Paths JSON.**
+
+::
+
+    {
+    "service-function-paths": {
+        "service-function-path": [
+            {
+                "name": "SFP1",
+                "service-chain-name": "SFC1",
+                "starting-index": 255,
+                "symmetric": "true",
+                "context-metadata": "NSH1",
+                "transport-type": "service-locator:vxlan-gpe"
+
+            }
+        ]
+    }
+    }
+
+As a result of above configuration, OpenDaylight renders the needed flows in all involved SFFs. Those flows implement:
+
+- Two Rendered Service Paths:
+
+  - dpi-1 (SF1), firewall-1 (SF2)
+  - firewall-1 (SF2), dpi-1 (SF1)
+
+- The communication between SFFs and SFs based on eth-nsh
+
+- The communication between SFFs based on vxlan-gpe
+
+The following picture shows a topology and traffic flow (in green) which corresponds to the above configuration.
+
+.. figure:: ./images/sfc/single-logical-sff-example.png
+   :alt: Logical SFF Example
+   :width: 800px
+   :height: 600px
+
+   Logical SFF Example
+
+
+
+The Logical SFF functionality allows OpenDaylight to find out the SFFs holding the SFs involved in a path. In this example
+the SFFs affected are Node3 and Node4 thus the controller renders the flows containing NSH parameters just in those SFFs.
+
+Here you have the new flows rendered in Node3 and Node4 which implement the NSH protocol. Every Rendered Service Path is represented
+by an NSP value. We provisioned a symmetric RSP so we get two NSPs: 8388613 and 5. Node3 holds the first SF of NSP 8388613 and 
+the last SF of NSP 5. Node 4 holds the first SF of NSP 5 and the last SF of NSP 8388613. Both Node3 and Node4 will pop the NSH header 
+when the received packet has gone through the last SF of its path.
+
+
+**Rendered flows Node 3**
+
+::
+
+ cookie=0x14, duration=59.264s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=5 actions=goto_table:86
+ cookie=0x14, duration=59.194s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=8388613 actions=goto_table:86
+ cookie=0x14, duration=59.257s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=254,nsp=5 actions=load:0x8e0a37cc9094->NXM_NX_ENCAP_ETH_SRC[],load:0x6ee006b4c51e->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0x14, duration=59.189s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=255,nsp=8388613 actions=load:0x8e0a37cc9094->NXM_NX_ENCAP_ETH_SRC[],load:0x6ee006b4c51e->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0xba5eba1100000203, duration=59.213s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=253,nsp=5 actions=pop_nsh,set_field:6e:e0:06:b4:c5:1e->eth_src,resubmit(,17)
+ cookie=0xba5eba1100000201, duration=59.213s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=5 actions=load:0x800->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000201, duration=59.188s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=255,nsp=8388613 actions=load:0x800->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000201, duration=59.182s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=8388613 actions=set_field:0->tun_id,output:6
+
+**Rendered Flows Node 4**
+
+::
+
+ cookie=0x14, duration=69.040s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=5 actions=goto_table:86
+ cookie=0x14, duration=69.008s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=8388613 actions=goto_table:86
+ cookie=0x14, duration=69.040s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=255,nsp=5 actions=load:0xbea93873f4fa->NXM_NX_ENCAP_ETH_SRC[],load:0x214845ea85d->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0x14, duration=69.005s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=254,nsp=8388613 actions=load:0xbea93873f4fa->NXM_NX_ENCAP_ETH_SRC[],load:0x214845ea85d->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0xba5eba1100000201, duration=69.029s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=255,nsp=5 actions=load:0x1100->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000201, duration=69.029s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=5 actions=set_field:0->tun_id,output:1
+ cookie=0xba5eba1100000201, duration=68.999s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=8388613 actions=load:0x1100->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000203, duration=68.996s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=253,nsp=8388613 actions=pop_nsh,set_field:02:14:84:5e:a8:5d->eth_src,resubmit(,17)
+
+
+An interesting scenario to show the Logical SFF strength is the migration of a SF from a compute node to another. 
+The OpenDaylight will learn the new topology by itself, then it will re-render the new flows to the new SFFs affected. 
+
+.. figure:: ./images/sfc/single-logical-sff-example-migration.png
+   :alt: Logical SFF - SF Migration Example
+   :width: 800px
+   :height: 600px
+
+   Logical SFF - SF Migration Example
+
+
+In our example, SF2 is moved from Node4 to Node2 then OpenDaylight removes NSH specific flows from Node4 and puts them in Node2.
+Check below flows showing this effect. Now Node3 keeps holding the first SF of NSP 8388613 and the last SF of NSP 5;
+but Node2 becomes the new holder of the first SF of NSP 5 and the last SF of NSP 8388613.
+
+
+**Rendered Flows Node 3 After Migration**
+
+::
+
+ cookie=0x14, duration=64.044s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=5 actions=goto_table:86
+ cookie=0x14, duration=63.947s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=8388613 actions=goto_table:86
+ cookie=0x14, duration=64.044s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=254,nsp=5 actions=load:0x8e0a37cc9094->NXM_NX_ENCAP_ETH_SRC[],load:0x6ee006b4c51e->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0x14, duration=63.947s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=255,nsp=8388613 actions=load:0x8e0a37cc9094->NXM_NX_ENCAP_ETH_SRC[],load:0x6ee006b4c51e->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0xba5eba1100000201, duration=64.034s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=5 actions=load:0x800->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000203, duration=64.034s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=253,nsp=5 actions=pop_nsh,set_field:6e:e0:06:b4:c5:1e->eth_src,resubmit(,17)
+ cookie=0xba5eba1100000201, duration=63.947s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=255,nsp=8388613 actions=load:0x800->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000201, duration=63.942s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=8388613 actions=set_field:0->tun_id,output:2
+
+**Rendered Flows Node 2 After Migration**
+
+::
+
+ cookie=0x14, duration=56.856s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=5 actions=goto_table:86
+ cookie=0x14, duration=56.755s, table=83, n_packets=0, n_bytes=0, priority=250,nsp=8388613 actions=goto_table:86
+ cookie=0x14, duration=56.847s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=255,nsp=5 actions=load:0xbea93873f4fa->NXM_NX_ENCAP_ETH_SRC[],load:0x214845ea85d->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0x14, duration=56.755s, table=86, n_packets=0, n_bytes=0, priority=550,nsi=254,nsp=8388613 actions=load:0xbea93873f4fa->NXM_NX_ENCAP_ETH_SRC[],load:0x214845ea85d->NXM_NX_ENCAP_ETH_DST[],goto_table:87
+ cookie=0xba5eba1100000201, duration=56.823s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=255,nsp=5 actions=load:0x1100->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000201, duration=56.823s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=5 actions=set_field:0->tun_id,output:4
+ cookie=0xba5eba1100000201, duration=56.755s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=254,nsp=8388613 actions=load:0x1100->NXM_NX_REG6[],resubmit(,220)
+ cookie=0xba5eba1100000203, duration=56.750s, table=87, n_packets=0, n_bytes=0, priority=650,nsi=253,nsp=8388613 actions=pop_nsh,set_field:02:14:84:5e:a8:5d->eth_src,resubmit(,17)
+
+**Rendered Flows Node 4 After Migration**
+
+::
+
+ -- No flows for NSH processing --
+
+.. _sfc-user-guide-classifier-impacts:
+
+Classifier impacts
+~~~~~~~~~~~~~~~~~~
+
+As previously mentioned, in the :ref:`Logical SFF rationale
+<sfc-user-guide-logical-sff-motivation>`, the Logical SFF feature relies on
+Genius to get the dataplane IDs of the OpenFlow switches, in order to properly
+steer the traffic through the chain.
+
+Since one of the classifier's objectives is to steer the packets *into* the
+SFC domain, the classifier has to be aware of where the first Service
+Function is located - if it migrates somewhere else, the classifier table
+has to be updated accordingly, thus enabling the seemless migration of Service
+Functions.
+
+For this feature, mobility of the client VM is out of scope, and should be
+managed by its high-availability module, or VNF manager.
+
+Keep in mind that classification *always* occur in the compute-node where
+the client VM (i.e. traffic origin) is running.
+
+How to attach the classifier to a Logical SFF
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to leverage this functionality, the classifier has to be configured
+using a Logical SFF as an attachment-point, specifying within it the neutron
+port to classify.
+
+The following examples show how to configure an ACL, and a classifier having
+a Logical SFF as an attachment-point:
+
+**Configure an ACL**
+
+The following ACL enables traffic intended for port 80 within the subnetwork
+192.168.2.0/24, for RSP1 and RSP1-Reverse.
+
+::
+
+        {
+          "access-lists": {
+            "acl": [
+              {
+                "acl-name": "ACL1",
+                "acl-type": "ietf-access-control-list:ipv4-acl",
+                "access-list-entries": {
+                  "ace": [
+                    {
+                      "rule-name": "ACE1",
+                      "actions": {
+                        "service-function-acl:rendered-service-path": "RSP1"
+                      },
+                      "matches": {
+                        "destination-ipv4-network": "192.168.2.0/24",
+                        "source-ipv4-network": "192.168.2.0/24",
+                        "protocol": "6",
+                        "source-port-range": {
+                            "lower-port": 0
+                        },
+                        "destination-port-range": {
+                            "lower-port": 80
+                        }
+                      }
+                    }
+                  ]
+                }
+              },
+              {
+                "acl-name": "ACL2",
+                "acl-type": "ietf-access-control-list:ipv4-acl",
+                "access-list-entries": {
+                  "ace": [
+                    {
+                      "rule-name": "ACE2",
+                      "actions": {
+                        "service-function-acl:rendered-service-path": "RSP1-Reverse"
+                      },
+                      "matches": {
+                        "destination-ipv4-network": "192.168.2.0/24",
+                        "source-ipv4-network": "192.168.2.0/24",
+                        "protocol": "6",
+                        "source-port-range": {
+                            "lower-port": 80
+                        },
+                        "destination-port-range": {
+                            "lower-port": 0
+                        }
+                      }
+                    }
+                  ]
+                }
+              }
+            ]
+          }
+        }
+
+::
+
+  curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '${JSON}' -X PUT --user admin:admin http://localhost:8181/restconf/config/ietf-access-control-list:access-lists/
+
+**Configure a classifier JSON**
+
+The following JSON provisions a classifier, having a Logical SFF as an
+attachment point. The value of the field 'interface' is where you
+indicate the neutron ports of the VMs you want to classify.
+
+::
+
+        {
+          "service-function-classifiers": {
+            "service-function-classifier": [
+              {
+                "name": "Classifier1",
+                "scl-service-function-forwarder": [
+                  {
+                    "name": "sfflogical1",
+                    "interface": "09a78ba3-78ba-40f5-a3ea-1ce708367f2b"
+                  }
+                ],
+                "acl": {
+                    "name": "ACL1",
+                    "type": "ietf-access-control-list:ipv4-acl"
+                 }
+              }
+            ]
+          }
+        }
+
+::
+
+  curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '${JSON}' -X PUT --user admin:admin http://localhost:8181/restconf/config/service-function-classifier:service-function-classifiers/
+
+.. _sfc-user-guide-pipeline-impacts:
+
+SFC pipeline impacts
+~~~~~~~~~~~~~~~~~~~~
+
+After binding SFC service with a particular interface by means of Genius, as explained in the :ref:`Genius User Guide <genius-user-guide-binding-services>`,
+the entry point in the SFC pipeline will be table 82 (SFC_TRANSPORT_CLASSIFIER_TABLE), and from that point, packet
+processing will be similar to the :ref:`SFC OpenFlow pipeline <sfc-user-guide-sfc-of-pipeline>`, just with another set
+of specific tables for the SFC service.
+
+This picture shows the SFC pipeline after service integration with Genius:
+
+.. figure:: ./images/sfc/LSFF_pipeline.png
+   :alt: SFC Logical SFF OpenFlow pipeline
+
+   SFC Logical SFF OpenFlow pipeline
+
+