From 5d5ba6d0e26caef0e6c8709b70feb521012d1844 Mon Sep 17 00:00:00 2001 From: Anand B Jyoti Date: Tue, 3 Oct 2017 04:49:08 +0530 Subject: Docs: Update design and userguide for common gateway routing JIRA: SAMPLEVNF-81 Updating design and userguide for common gateway routing functionality. Change-Id: I347f03d37469858a69d7fcca86de31ee03d08086 Signed-off-by: Anand B Jyoti --- .../developer/design/04-SampleVNF_Design.rst | 55 ++++++++++++++++++++++ .../user/userguide/05-How_to_run_SampleVNFs.rst | 25 +++++----- 2 files changed, 68 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/testing/developer/design/04-SampleVNF_Design.rst b/docs/testing/developer/design/04-SampleVNF_Design.rst index cdef7448..dff8d535 100644 --- a/docs/testing/developer/design/04-SampleVNF_Design.rst +++ b/docs/testing/developer/design/04-SampleVNF_Design.rst @@ -108,6 +108,61 @@ This library provides API for taking decision of whether pkt belongs to local system or to forwarding.It Provides API for IPv4/IPv6 local packet out send function. It Provides API for packet forwarding - LPM lookup function. +Common Code - Gateway routing +----------------------------- + +Introduction +^^^^^^^^^^^^ + +Gateway common code is created to support routing functionality for both +network and direct attached interfaces. It is supported for both IPv4 and +IPv6 routes. + +The routeadd command is enhanced to support both net and host interfaces. +The net is used to define the gateway and host is used for direct +attached devices. + +The routing tables are allocated per port basis limited for MAX_PORTS. The +number of route entries are supported upto 32 per interface. These sizes +can be changed at compile time based on the requirement. Memory is +allocated only for the nb_ports which is configured as per the VNF application +configuration. + +Design +^^^^^^ +The next hop IP and Port numbers are retrieved from the routing table based on +the destinantion IP addreess. The destination IP address anded with mask is +looked in the routing table for the match. The port/interface number which +also stored as a part of the table entry is also retrieved. + +The routing table will be added with entries when the routeadd CLI command is +executed through script or run time. There can be multiple routing entries per +interface/port. + +The routeadd will report error if the match entry already exists or also if any +of parameters provide in the commands are not valied. Example the if port +number is bigger than the supported number ports/interface per application +configuration. + + +Reference routeadd command +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Following are typical reference commands and syntax for adding routes using the CLI. + +:: + +;routeadd +routeadd net 0 202.16.100.20 0xffff0000 +routeadd net 1 172.16.40.20 0xffff0000 +routeadd host 0 202.16.100.20 +routeadd host 1 172.16.40.20 + +;routeadd +routeadd net 0 fec0::6a05:caff:fe30:21b0 64 +routeadd net 1 2012::6a05:caff:fe30:2081 64 +routeadd host 0 fec0::6a05:caff:fe30:21b0 +routeadd host 1 2012::6a05:caff:fe30:2081 vFW - Design ============= diff --git a/docs/testing/user/userguide/05-How_to_run_SampleVNFs.rst b/docs/testing/user/userguide/05-How_to_run_SampleVNFs.rst index dc764fa6..b5880645 100644 --- a/docs/testing/user/userguide/05-How_to_run_SampleVNFs.rst +++ b/docs/testing/user/userguide/05-How_to_run_SampleVNFs.rst @@ -221,9 +221,9 @@ Step 3: Bind the datapath ports to DPDK link 1 config 8 link 1 up - ; routeadd - routeadd 0 0xff000000 - routeadd 1 0xff000000 + ; routeadd + routeadd net 0 0xff000000 + routeadd net 1 0xff000000 ; IPv4 static ARP; disable if dynamic arp is enabled. p 1 arpadd 0 @@ -288,9 +288,10 @@ Step 3: Bind the datapath ports to DPDK link 1 down link 1 config 8 link 1 up + ; routeadd - routeadd 0 0xff000000 - routeadd 1 0xff000000 + routeadd net 0 0xff000000 + routeadd net 1 0xff000000 ; IPv4 static ARP; disable if dynamic arp is enabled. p 1 arpadd 0 @@ -355,9 +356,10 @@ Step 3: Bind the datapath ports to DPDK link 1 down link 1 config 8 link 1 up - ; routeadd - routeadd 0 0xff000000 - routeadd 1 0xff000000 + + ; routeadd + routeadd net 0 0xff000000 + routeadd net 1 0xff000000 ; IPv4 static ARP; disable if dynamic arp is enabled. p 1 arpadd 0 @@ -427,10 +429,9 @@ Step 3: Bind the datapath ports to DPDK ;p entry addm prvport> ;p 5 entry addm 202.16.100.20 1234 152.16.40.10 1 0 500 65535 1234 65535 - - ; routeadd - routeadd 0 0xff000000 - routeadd 1 0xff000000 + ; routeadd + routeadd net 0 0xff000000 + routeadd net 1 0xff000000 ; IPv4 static ARP; disable if dynamic arp is enabled. p 1 arpadd 0 -- cgit 1.2.3-korg