Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, x-fn-spp@sl.ntt-tx.co.jp
Cc: Hiroyuki Nakamura <nakamura.hioryuki@po.ntt-tx.co.jp>,
	Naoki Takada <takada.naoki@lab.ntt.co.jp>
Subject: [spp] [PATCH 09/28] doc: add sample usage
Date: Tue, 23 Jan 2018 09:28:54 +0900	[thread overview]
Message-ID: <20180123002854.28345-9-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20180123002854.28345-1-ogawa.yasufumi@lab.ntt.co.jp>

From: Hiroyuki Nakamura <nakamura.hioryuki@po.ntt-tx.co.jp>

Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 docs/spp_vf/how_to_use.md                |   2 +-
 docs/spp_vf/sample_usage.md              | 212 +++++++++++++++++++++++++++++++
 docs/spp_vf/{setup.md => setup_guide.md} |   0
 docs/spp_vf/spp_vf.md                    |   6 +-
 4 files changed, 218 insertions(+), 2 deletions(-)
 create mode 100644 docs/spp_vf/sample_usage.md
 rename docs/spp_vf/{setup.md => setup_guide.md} (100%)

diff --git a/docs/spp_vf/how_to_use.md b/docs/spp_vf/how_to_use.md
index ca9cf15..6b5019c 100644
--- a/docs/spp_vf/how_to_use.md
+++ b/docs/spp_vf/how_to_use.md
@@ -14,7 +14,7 @@ SPP_VF is a SR-IOV like network functionality for NFV.
 
 ## Launch SPP
 
-Before launching spp, you need to setup described as [setup guide](setup.md).
+Before launching spp, you need to setup described as [setup guide](setup_guide.md).
 
 ### SPP Controller
 
diff --git a/docs/spp_vf/sample_usage.md b/docs/spp_vf/sample_usage.md
new file mode 100644
index 0000000..2157378
--- /dev/null
+++ b/docs/spp_vf/sample_usage.md
@@ -0,0 +1,212 @@
+# SPP_VF Sample Usage
+
+This sample demonstrates an use-case of MAC address classification of
+spp_vf.
+It enables to access to VMs with ssh from a remote node.
+
+Before trying this sample, install SPP by following
+[setup guide](setup_guide.md).
+
+## Testing Steps
+
+In this section, you configure spp_vf and client applications for
+this use-case.
+
+
+### Setup SPP
+
+First, launch spp controller and primary process.
+
+  ```sh
+  $ pwd
+  /path/to/Soft-Patch-Panel
+
+  # SPP controller
+  $ python ./src/spp.py -p 5555 -s 6666
+
+  # SPP primary
+  $ sudo ./src/primary/x86_64-native-linuxapp-gcc/spp_primary \
+  -c 0x02 -n 4 --socket-mem 512,512 --huge-dir=/run/hugepages/kvm \
+  --proc-type=primary \
+  -- \
+  -p 0x03 -n 8 -s 127.0.0.1:5555
+  ```
+
+TODO(yasufum) add description for sec.
+
+  ```sh
+  # start nc for secondary 1
+  $ while true; do nc -l 11111; done
+
+  # start secondary 1
+  $ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \
+  -c 0x00fd -n 4 --proc-type=secondary \
+  -- \
+  --process-id 1 \
+  --config $SPRINT_REVIEW_HOME/spp_vf1_without_cmtab.json \
+  -s 127.0.0.1:11111
+
+  # start nc for secondary 2
+  $ while true; do nc -l 11112; done
+
+  # start secondary 2
+  $ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \
+  -c 0x3f01 -n 4 --proc-type=secondary \
+  -- \
+  --process-id 2 \
+  --config $SPRINT_REVIEW_HOME/spp_vf2_without_cmtab.json \
+  -s 127.0.0.1:11112
+  ```
+
+### Setup network configuration for VMs.
+
+Start two VMs.
+
+  ```sh
+  $ virsh start spp-vm1
+  $ virsh start spp-vm2
+  ```
+
+Login to spp-vm1 for network configuration.
+To not ask for unknown keys while login VMs,
+set `-oStrictHostKeyChecking=no` option for ssh.
+
+  ```sh
+  $ ssh -oStrictHostKeyChecking=no ntt@192.168.122.31
+  ```
+
+Up interfaces for vhost and register them to arp table inside spp-vm1.
+In addition, you have to disable TCP offload function, or ssh is faled
+after configuration is done.
+
+  ```sh
+  # up interfaces
+  $ sudo ifconfig ens4 inet 192.168.240.21 netmask 255.255.255.0 up
+  $ sudo ifconfig ens5 inet 192.168.250.22 netmask 255.255.255.0 up
+
+  # register to arp table
+  $ sudo arp -s 192.168.240.11 a0:36:9f:78:86:78 -i ens4
+  $ sudo arp -s 192.168.250.13 a0:36:9f:6c:ed:bc -i ens5
+
+  # diable TCP offload
+  $ sudo ethtool -K ens4 tx off
+  $ sudo ethtool -K ens5 tx off
+  ```
+
+Configurations for spp-vm2 is same as spp-vm1.
+
+  ```sh
+  $ ssh -oStrictHostKeyChecking=no ntt@192.168.122.32
+
+  # up interfaces
+  $ sudo ifconfig ens4 inet 192.168.240.31 netmask 255.255.255.0 up
+  $ sudo ifconfig ens5 inet 192.168.250.32 netmask 255.255.255.0 up
+
+  # register to arp table
+  $ sudo arp -s 192.168.240.11 a0:36:9f:78:86:78 -i ens4
+  $ sudo arp -s 192.168.250.13 a0:36:9f:6c:ed:bc -i ens5
+
+  # diable TCP offload
+  $ sudo ethtool -K ens4 tx off
+  $ sudo ethtool -K ens5 tx off
+  ```
+
+Check the configuration by trying ssh from remote machine that
+connection is accepted but discarded in spp secondary.
+If you do ssh for VM1, you find a messages from spp secondary for
+discarding packets.
+
+## Test Application
+
+TODO(yasufum) json-based steps are deprecated.
+
+### Register MAC address to Classifier
+
+Send a request for getting each of process IDs with nc command.
+TODO(yasufum) for what?
+
+  ```sh
+  {
+    "commands": [
+      {
+        "command": "process"
+      }
+    ]
+  }
+  ```
+
+Register MAC addresses to classifier.
+
+  ```sh
+  {
+    "commands": [
+      {
+        "command": "classifier_table",
+        "type": "mac",
+        "value": "52:54:00:12:34:56",
+        "port": "ring0"
+      },
+      {
+        "command": "classifier_table",
+        "type": "mac",
+        "value": "52:54:00:12:34:58",
+        "port": "ring1"
+      },
+      {
+        "command": "flush"
+      }
+    ]
+  }
+  ```
+
+  ```sh
+  {
+    "commands": [
+      {
+        "command": "classifier_table",
+        "type": "mac",
+        "value": "52:54:00:12:34:57",
+        "port": "ring4"
+      },
+      {
+                    "command": "flush"
+      }
+    ]
+  }
+  ```
+
+### Login to VMs
+
+Now, you can login VMs.
+
+  ```sh
+  # spp-vm1 via NIC0
+  $ ssh ntt@192.168.240.21
+
+  # spp-vm1 via NIC1
+  $ ssh ntt@192.168.250.22
+
+  # spp-vm2 via NIC0
+  $ ssh ntt@192.168.240.31
+
+  # spp-vm2 via NIC1
+  $ ssh ntt@192.168.250.32
+  ```
+
+If you unregister the addresses, send request as following.
+
+  ```sh
+  {
+    "commands": [
+      {
+        "command": "classifier_table",
+        "type": "mac",
+        "value": "52:54:00:12:34:58",
+        "port": "unuse"
+      },
+      {
+        "command": "flush"
+      }
+    ]
+  }
+  ```
diff --git a/docs/spp_vf/setup.md b/docs/spp_vf/setup_guide.md
similarity index 100%
rename from docs/spp_vf/setup.md
rename to docs/spp_vf/setup_guide.md
diff --git a/docs/spp_vf/spp_vf.md b/docs/spp_vf/spp_vf.md
index 6a617c0..1ba2a5e 100644
--- a/docs/spp_vf/spp_vf.md
+++ b/docs/spp_vf/spp_vf.md
@@ -29,12 +29,16 @@ by looking MAC address in the packet..
 
 ## Build the Application
 
-See [setup guide](setup.md).
+See [setup guide](setup_guide.md).
 
 ## Running the Application
 
 See [how to use](how_to_use.md).
 
+## Sample Usage
+
+See [sample usage](sample_usage.md).
+
 ## Explanation
 
 The following sections provide some explanation of the code.
-- 
2.13.1

  parent reply	other threads:[~2018-01-23  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  0:28 [spp] [PATCH 01/28] doc: add setup guide ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 02/28] doc: add how_to_use.md ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 03/28] doc: add config_manual.md ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 04/28] doc: add spp_vf.md ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 05/28] doc: revise spp_vf.md ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 06/28] doc: add config section ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 07/28] doc: update jp setup manual ogawa.yasufumi
2018-01-23  0:28 ` [spp] [PATCH 08/28] doc: modify figure in spp_vf_overview ogawa.yasufumi
2018-01-23  0:28 ` ogawa.yasufumi [this message]
2018-02-01 11:57 ` [spp] [PATCH 01/28] doc: add setup guide Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180123002854.28345-9-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=nakamura.hioryuki@po.ntt-tx.co.jp \
    --cc=spp@dpdk.org \
    --cc=takada.naoki@lab.ntt.co.jp \
    --cc=x-fn-spp@sl.ntt-tx.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).