<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Qijing</id>
		<title>OpenStack - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Qijing"/>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/wiki/Special:Contributions/Qijing"/>
		<updated>2026-07-13T01:47:58Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.2</generator>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=Neutron/ServiceInsertionAndChaining&amp;diff=101993</id>
		<title>Neutron/ServiceInsertionAndChaining</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=Neutron/ServiceInsertionAndChaining&amp;diff=101993"/>
				<updated>2016-01-22T18:51:17Z</updated>
		
		<summary type="html">&lt;p&gt;Qijing: /* networking-sfc installation steps and testbed setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Link to Old Version =&lt;br /&gt;
[[Neutron/APIForServiceChaining]]&lt;br /&gt;
&lt;br /&gt;
= Contributors =&lt;br /&gt;
* [https://launchpad.net/~cathy-h-zhang Cathy Zhang (Project Lead)]&lt;br /&gt;
* [https://launchpad.net/~lfourie Louis Fourie]&lt;br /&gt;
* [https://launchpad.net/~pcarver Paul Carver]&lt;br /&gt;
* [https://launchpad.net/~vikschw Vikram Choudary]&lt;br /&gt;
* [https://blueprints.launchpad.net/~mohankumar-n Mohan Kumar]&lt;br /&gt;
* [https://launchpad.net/~milo-frao Rao Fei]&lt;br /&gt;
* [https://launchpad.net/~xiaodongwang991481 Xiaodong Wang]&lt;br /&gt;
* [https://launchpad.net/~ramanjieee Ramanjaneya Reddy Palleti]&lt;br /&gt;
* [https://launchpad.net/~s3wong Stephen Wong]&lt;br /&gt;
* [https://launchpad.net/~igordcard Igor Duarte Cardoso]&lt;br /&gt;
* [https://launchpad.net/~prithiv Prithiv]&lt;br /&gt;
* [https://launchpad.net/~amotoki Akihiro Motoki]&lt;br /&gt;
* [https://launchpad.net/~swaminathan-vasudevan Swaminathan Vasudevan]&lt;br /&gt;
&lt;br /&gt;
= Weekly IRC Project Meeting Information =&lt;br /&gt;
Every Thursday 1700 UTC on #openstack-meeting-4  &lt;br /&gt;
https://wiki.openstack.org/wiki/Meetings/ServiceFunctionChainingMeeting&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
Service Function Chaining is a mechanism for overriding the basic destination based forwarding that is typical of IP networks. It is conceptually related to [https://en.wikipedia.org/wiki/Policy-based_routing Policy Based Routing] in physical networks but it is typically thought of as a Software Defined Networking technology. It is often used in conjunction with security functions although it may be used for a broader range of features. Fundamentally SFC is the ability to cause network packet flows to route through a network via a path other than the one that would be chosen by routing table lookups on the packet's destination IP address. It is most commonly used in conjunction with [https://en.wikipedia.org/wiki/Network_functions_virtualization Network Function Virtualization] when recreating in a virtual environment a series of network functions that would have traditionally been implemented as a collection of physical network devices connected in series by cables.&lt;br /&gt;
&lt;br /&gt;
A very simple example of a service chain would be one that forces all traffic from point A to point B to go through a firewall even though the firewall is not literally between point A and B from a routing table perspective.&lt;br /&gt;
&lt;br /&gt;
A more complex example is an ordered series of functions, each implemented in multiple VMs, such that traffic must flow through one VM at each hop in the chain but the network uses a hashing algorithm to distribute different flows across multiple VMs at each hop.&lt;br /&gt;
&lt;br /&gt;
[[File:ServiceChainLoadBalance.png|Series-Parallel Service Chain]]&lt;br /&gt;
&lt;br /&gt;
An API and initial reference implementation of Service Function Chaining is being developed for Neutron during the Liberty cycle.&lt;br /&gt;
&lt;br /&gt;
* The API specification may be found here: https://github.com/openstack/networking-sfc/blob/master/doc/source/api.rst&lt;br /&gt;
* The Blueprint for the overall effort may be found here:https://blueprints.launchpad.net/neutron/+spec/openstack-service-chain-framework&lt;br /&gt;
* The Blueprint for the initial API work may be found here: https://blueprints.launchpad.net/neutron/+spec/neutron-api-extension-for-service-chaining&lt;br /&gt;
* The reviews related to the initial API work may be found here: https://review.openstack.org/#/q/topic:networking-sfc,n,z&lt;br /&gt;
&lt;br /&gt;
= networking-sfc installation steps and testbed setup =&lt;br /&gt;
If you have previous networking-sfc patches installed on your testbed, then do the following to get the new updated patch code set&lt;br /&gt;
&lt;br /&gt;
1.	Clean up networking-sfc&lt;br /&gt;
* cd /opt/stack&lt;br /&gt;
* rm –rf networking-sfc&lt;br /&gt;
&lt;br /&gt;
2.	clone networking-sfc into local repository  &lt;br /&gt;
* git clone git://git.openstack.org/openstack/networking-sfc.git&lt;br /&gt;
&lt;br /&gt;
3.	cd /opt/stack/networking-sfc and run &amp;quot;sudo python setup.py install&amp;quot; &lt;br /&gt;
&lt;br /&gt;
4.     cd ~/devstack/ and run unstack.sh and stack.sh&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
If you have not installed networking-sfc on your testbed before, then do the following to get the patch code set&lt;br /&gt;
&lt;br /&gt;
1. install Linux 14.04&lt;br /&gt;
* install git and configure user.email and user.name&lt;br /&gt;
* sudo apt-get install software-properties-common&lt;br /&gt;
* sudo add-apt-repository cloud-archive:liberty&lt;br /&gt;
&lt;br /&gt;
2. clone networking-sfc into local repository&lt;br /&gt;
* sudo mkdir /opt/stack&lt;br /&gt;
* sudo chown stack.stack /opt/stack&lt;br /&gt;
* cd /opt/stack/&lt;br /&gt;
* git clone git://git.openstack.org/openstack/networking-sfc.git&lt;br /&gt;
&lt;br /&gt;
3. download devstack &lt;br /&gt;
* cd /opt/stack&lt;br /&gt;
* git clone git://git.openstack.org/openstack-dev/devstack.git -b stable/liberty&lt;br /&gt;
&lt;br /&gt;
4. copy local.conf to local repository and add the following line:&lt;br /&gt;
* enable_plugin networking-sfc git://git.openstack.org/openstack/networking-sfc stable/liberty&lt;br /&gt;
'''OR'''&lt;br /&gt;
* enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
5. run stack.sh&lt;br /&gt;
* cd devstack&lt;br /&gt;
* ./stack.sh&lt;br /&gt;
&lt;br /&gt;
If it reports some errors, read the error messages and try to fix it.&lt;br /&gt;
&lt;br /&gt;
6. Install OVS 2.3.2 or OVS 2.4. Note that the OVS version should match its supported Linux kernel version in order for the OVS to work properly. \&lt;br /&gt;
The following table lists the Linux kernel versions against which the given versions of the Open vSwitch kernel module will successfully build.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Open vSwitch!! LInux Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2.0.x || 2.6.32 to 3.10&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.x || 2.6.32 to 3.11&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.x || 2.6.32 to 3.14&lt;br /&gt;
|-&lt;br /&gt;
| 2.4.x ||2.6.32 to 4.0&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. run unstack.sh and stack.sh&lt;br /&gt;
* ./unstack&lt;br /&gt;
* ./stack&lt;br /&gt;
&lt;br /&gt;
In our one-server  testbed, all OpenStack components run on one physical server. We created 3 VMs, one for source VM, another for Service Function VM, the last one for destination VM.&lt;br /&gt;
&lt;br /&gt;
= Data Path Encapsulation Flow =&lt;br /&gt;
[[File:SFC-datapath-flow-format.png|SFC-datapath-flow-format-MAC-Rewriting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial reference implementation will be based on programming Open vSwitch with flow table entries that override the default MAC based forwarding and instead forward frames based on criteria defined via the Neutron SFC API. It will also be possible for third party SDN implementations with Neutron integration and SFC capabilities (e.g. Contrail, Nuage, etc) to program their respective forwarding planes based on the Neutron SFC API, but this will be dependent upon the respective vendors updating their SDN Controller integration with Neutron.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Multi-Host Installation =&lt;br /&gt;
Terminology:&lt;br /&gt;
* H1 – Physical Host1 (Controller + Network + Compute)&lt;br /&gt;
* H2 – Physical Host 2 (Compute)&lt;br /&gt;
* H3 – Physical Host 3 (Compute)&lt;br /&gt;
&lt;br /&gt;
* SRC – Source VM&lt;br /&gt;
* SF1 – Service Function 1&lt;br /&gt;
* SF2 – Service Function 2&lt;br /&gt;
* DST – Destination VM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 SRC                             DST&lt;br /&gt;
   |                              |&lt;br /&gt;
  H1=============H2===============H3&lt;br /&gt;
   |             |                                   &lt;br /&gt;
 SF1             SF2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Important Note:  &lt;br /&gt;
Currently, with OVS 2.4.0, the kernel module is dropping MPLS over tunnel packets hitting the flood entry.&lt;br /&gt;
This can be worked around by enabling l2population.&lt;br /&gt;
Please see steps below for detailed setup instructions.&lt;br /&gt;
&lt;br /&gt;
Step1: Prepare H1 (Controller + Network + Compute)&lt;br /&gt;
&lt;br /&gt;
Step 1.1:&lt;br /&gt;
&lt;br /&gt;
local.conf for H1:&lt;br /&gt;
[[local|localrc]]&lt;br /&gt;
&lt;br /&gt;
 SERVICE_TOKEN=abc123&lt;br /&gt;
 ADMIN_PASSWORD=abc123&lt;br /&gt;
 MYSQL_PASSWORD=abc123&lt;br /&gt;
 RABBIT_PASSWORD=abc123&lt;br /&gt;
 SERVICE_PASSWORD=$ADMIN_PASSWORD&lt;br /&gt;
  &lt;br /&gt;
 HOST_IP=10.145.90.160&lt;br /&gt;
 SERVICE_HOST=10.145.90.160&lt;br /&gt;
 SYSLOG=True&lt;br /&gt;
 SYSLOG_HOST=$HOST_IP&lt;br /&gt;
 SYSLOG_PORT=516&lt;br /&gt;
 &lt;br /&gt;
 LOGFILE=$DEST/logs/stack.sh.log&lt;br /&gt;
 LOGDAYS=2&lt;br /&gt;
 &lt;br /&gt;
 disable_service tempest&lt;br /&gt;
 &lt;br /&gt;
 RECLONE=no&lt;br /&gt;
 PIP_UPGRADE=False&lt;br /&gt;
 &lt;br /&gt;
 MULTI_HOST=TRUE&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Networking&lt;br /&gt;
 disable_service n-net&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Compute&lt;br /&gt;
 #disable_service n-cpu&lt;br /&gt;
 &lt;br /&gt;
 # Neutron - Networking Service&lt;br /&gt;
 enable_service q-svc&lt;br /&gt;
 enable_service q-agt&lt;br /&gt;
 enable_service q-dhcp&lt;br /&gt;
 enable_service q-l3&lt;br /&gt;
 enable_service q-meta&lt;br /&gt;
 enable_service neutron&lt;br /&gt;
 &lt;br /&gt;
 # Cinder&lt;br /&gt;
 disable_service c-api&lt;br /&gt;
 disable_service c-sch&lt;br /&gt;
 disable_service c-vol&lt;br /&gt;
 &lt;br /&gt;
 # Disable security groups&lt;br /&gt;
 Q_USE_SECGROUP=False&lt;br /&gt;
 LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
Step 1.2: &lt;br /&gt;
./stack.sh  from your /opt/stack/devstack &lt;br /&gt;
&lt;br /&gt;
Step 1.3:&lt;br /&gt;
Once devstack finishes, overwrite the key neutron configuration files manually.&lt;br /&gt;
I do it this way.  I am sure there is a way to do this using configurations directly in the&lt;br /&gt;
local.conf file.&lt;br /&gt;
I modify the following files manually&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
/etc/neutron/l3_agent.ini&lt;br /&gt;
/etc/neutron/dhcp_agent.ini&lt;br /&gt;
/etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
&lt;br /&gt;
 [ml2]&lt;br /&gt;
 tenant_network_types = vxlan&lt;br /&gt;
 extension_drivers = port_security&lt;br /&gt;
 type_drivers = local,flat,vlan,gre,vxlan&lt;br /&gt;
 mechanism_drivers = openvswitch,linuxbridge,l2population&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_flat]&lt;br /&gt;
 flat_networks=public&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_vxlan]&lt;br /&gt;
 vni_ranges = 8192:100000&lt;br /&gt;
 &lt;br /&gt;
 [securitygroup]&lt;br /&gt;
 enable_security_group = False&lt;br /&gt;
 enable_ipset = False&lt;br /&gt;
 firewall_driver = neutron.agent.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 [agent]&lt;br /&gt;
 tunnel_types = vxlan&lt;br /&gt;
 l2_population = True&lt;br /&gt;
 arp_responder = True&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
 &lt;br /&gt;
 [ovs]&lt;br /&gt;
 datapath_type = system&lt;br /&gt;
 tunnel_bridge = br-tun&lt;br /&gt;
 bridge_mappings = public:br-ex&lt;br /&gt;
 local_ip = 192.168.2.160&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/l3_agent.ini&lt;br /&gt;
 [DEFAULT]&lt;br /&gt;
 l3_agent_manager = neutron.agent.l3_agent.L3NATAgentWithStateReport&lt;br /&gt;
 external_network_bridge = br-ex&lt;br /&gt;
 interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver&lt;br /&gt;
 ovs_use_veth = False&lt;br /&gt;
 use_namespaces = True&lt;br /&gt;
 debug = True&lt;br /&gt;
 verbose = True&lt;br /&gt;
 &lt;br /&gt;
 [AGENT]&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/dhcp_agent.ini&lt;br /&gt;
 [DEFAULT]&lt;br /&gt;
 dhcp_agent_manager = neutron.agent.dhcp_agent.DhcpAgentWithStateReport&lt;br /&gt;
 interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver&lt;br /&gt;
 ovs_use_veth = False&lt;br /&gt;
 use_namespaces = True&lt;br /&gt;
 debug = True&lt;br /&gt;
 verbose = True&lt;br /&gt;
 dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
 &lt;br /&gt;
 [AGENT]&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
 dhcp-option-force=26,1450&lt;br /&gt;
&lt;br /&gt;
Step 1.4:&lt;br /&gt;
After modifying the above files, restart the following services&lt;br /&gt;
q-svc, q-agt,q-dhcp,q-l3&lt;br /&gt;
&lt;br /&gt;
Your Host1 (controller+network+compute) is now ready for multi-node operation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step2: Prepare H2 (Compute)&lt;br /&gt;
&lt;br /&gt;
Step 2.1:  &lt;br /&gt;
&lt;br /&gt;
local.conf for H2&lt;br /&gt;
&lt;br /&gt;
[[local|localrc]]&lt;br /&gt;
&lt;br /&gt;
 SERVICE_TOKEN=cisco123123&lt;br /&gt;
 ADMIN_PASSWORD=cisco123123&lt;br /&gt;
 MYSQL_PASSWORD=cisco123123&lt;br /&gt;
 RABBIT_PASSWORD=cisco123123&lt;br /&gt;
 DATABASE_PASSWORD=cisco123123&lt;br /&gt;
 SERVICE_PASSWORD=$ADMIN_PASSWORD&lt;br /&gt;
 DATABASE_TYPE=mysql&lt;br /&gt;
 &lt;br /&gt;
 HOST_IP=10.145.90.166&lt;br /&gt;
 SERVICE_HOST=10.145.90.160&lt;br /&gt;
 SYSLOG=True&lt;br /&gt;
 SYSLOG_HOST=$HOST_IP&lt;br /&gt;
 SYSLOG_PORT=516&lt;br /&gt;
 MYSQL_HOST=$SERVICE_HOST&lt;br /&gt;
 RABBIT_HOST=$SERVICE_HOST&lt;br /&gt;
 Q_HOST=$SERVICE_HOST&lt;br /&gt;
 GLANCE_HOSTPORT=$SERVICE_HOST:9292&lt;br /&gt;
 &lt;br /&gt;
 NOVA_VNC_ENABLED=True&lt;br /&gt;
 NOVNCPROXY_URL=&amp;quot;http://$SERVICE_HOST:6080/vnc_auto.html&amp;quot;&lt;br /&gt;
 VNCSERVER_LISTEN=$HOST_IP&lt;br /&gt;
 VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN&lt;br /&gt;
 &lt;br /&gt;
 LOGFILE=$DEST/logs/stack.sh.log&lt;br /&gt;
 LOGDAYS=2&lt;br /&gt;
 &lt;br /&gt;
 disable_service tempest&lt;br /&gt;
 &lt;br /&gt;
 RECLONE=no&lt;br /&gt;
 PIP_UPGRADE=False&lt;br /&gt;
 &lt;br /&gt;
 MULTI_HOST=TRUE&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Networking&lt;br /&gt;
 disable_service n-net&lt;br /&gt;
 disable_service neutron&lt;br /&gt;
 &lt;br /&gt;
 # Neutron - Networking Service&lt;br /&gt;
 ENABLED_SERVICES=n-cpu,q-agt&lt;br /&gt;
 &lt;br /&gt;
 # Disable security groups&lt;br /&gt;
 Q_USE_SECGROUP=False&lt;br /&gt;
 LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
Step 2.2: &lt;br /&gt;
./stack.sh  from your /opt/stack/devstack &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2.3: Overwrite the /etc/neutron/plugins/ml2/ml2_conf.ini as follows&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
&lt;br /&gt;
 [ml2]&lt;br /&gt;
 tenant_network_types = vxlan&lt;br /&gt;
 extension_drivers = port_security&lt;br /&gt;
 type_drivers = local,flat,vlan,gre,vxlan&lt;br /&gt;
 mechanism_drivers = openvswitch,linuxbridge,l2population&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_vxlan]&lt;br /&gt;
 vni_ranges = 8192:100000&lt;br /&gt;
 &lt;br /&gt;
 [securitygroup]&lt;br /&gt;
 enable_security_group = True&lt;br /&gt;
 enable_ipset = False&lt;br /&gt;
 #firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver&lt;br /&gt;
 firewall_driver = neutron.agent.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 [agent]&lt;br /&gt;
 tunnel_types = vxlan&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
 l2_population = True&lt;br /&gt;
 arp_responder = True&lt;br /&gt;
 &lt;br /&gt;
 [ovs]&lt;br /&gt;
 datapath_type = system&lt;br /&gt;
 tunnel_bridge = br-tun&lt;br /&gt;
 local_ip = 192.168.2.166&lt;br /&gt;
&lt;br /&gt;
Step 2.4:&lt;br /&gt;
After modifying the above file, restart the q-agt service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step3: Prepare H3 (Compute) similar to H2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step4: Your 3-node multi-host setup is now ready to be configured for service chaining.&lt;/div&gt;</summary>
		<author><name>Qijing</name></author>	</entry>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=Neutron/ServiceInsertionAndChaining&amp;diff=101980</id>
		<title>Neutron/ServiceInsertionAndChaining</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=Neutron/ServiceInsertionAndChaining&amp;diff=101980"/>
				<updated>2016-01-22T18:46:15Z</updated>
		
		<summary type="html">&lt;p&gt;Qijing: /* networking-sfc installation steps and testbed setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Link to Old Version =&lt;br /&gt;
[[Neutron/APIForServiceChaining]]&lt;br /&gt;
&lt;br /&gt;
= Contributors =&lt;br /&gt;
* [https://launchpad.net/~cathy-h-zhang Cathy Zhang (Project Lead)]&lt;br /&gt;
* [https://launchpad.net/~lfourie Louis Fourie]&lt;br /&gt;
* [https://launchpad.net/~pcarver Paul Carver]&lt;br /&gt;
* [https://launchpad.net/~vikschw Vikram Choudary]&lt;br /&gt;
* [https://blueprints.launchpad.net/~mohankumar-n Mohan Kumar]&lt;br /&gt;
* [https://launchpad.net/~milo-frao Rao Fei]&lt;br /&gt;
* [https://launchpad.net/~xiaodongwang991481 Xiaodong Wang]&lt;br /&gt;
* [https://launchpad.net/~ramanjieee Ramanjaneya Reddy Palleti]&lt;br /&gt;
* [https://launchpad.net/~s3wong Stephen Wong]&lt;br /&gt;
* [https://launchpad.net/~igordcard Igor Duarte Cardoso]&lt;br /&gt;
* [https://launchpad.net/~prithiv Prithiv]&lt;br /&gt;
* [https://launchpad.net/~amotoki Akihiro Motoki]&lt;br /&gt;
* [https://launchpad.net/~swaminathan-vasudevan Swaminathan Vasudevan]&lt;br /&gt;
&lt;br /&gt;
= Weekly IRC Project Meeting Information =&lt;br /&gt;
Every Thursday 1700 UTC on #openstack-meeting-4  &lt;br /&gt;
https://wiki.openstack.org/wiki/Meetings/ServiceFunctionChainingMeeting&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
Service Function Chaining is a mechanism for overriding the basic destination based forwarding that is typical of IP networks. It is conceptually related to [https://en.wikipedia.org/wiki/Policy-based_routing Policy Based Routing] in physical networks but it is typically thought of as a Software Defined Networking technology. It is often used in conjunction with security functions although it may be used for a broader range of features. Fundamentally SFC is the ability to cause network packet flows to route through a network via a path other than the one that would be chosen by routing table lookups on the packet's destination IP address. It is most commonly used in conjunction with [https://en.wikipedia.org/wiki/Network_functions_virtualization Network Function Virtualization] when recreating in a virtual environment a series of network functions that would have traditionally been implemented as a collection of physical network devices connected in series by cables.&lt;br /&gt;
&lt;br /&gt;
A very simple example of a service chain would be one that forces all traffic from point A to point B to go through a firewall even though the firewall is not literally between point A and B from a routing table perspective.&lt;br /&gt;
&lt;br /&gt;
A more complex example is an ordered series of functions, each implemented in multiple VMs, such that traffic must flow through one VM at each hop in the chain but the network uses a hashing algorithm to distribute different flows across multiple VMs at each hop.&lt;br /&gt;
&lt;br /&gt;
[[File:ServiceChainLoadBalance.png|Series-Parallel Service Chain]]&lt;br /&gt;
&lt;br /&gt;
An API and initial reference implementation of Service Function Chaining is being developed for Neutron during the Liberty cycle.&lt;br /&gt;
&lt;br /&gt;
* The API specification may be found here: https://github.com/openstack/networking-sfc/blob/master/doc/source/api.rst&lt;br /&gt;
* The Blueprint for the overall effort may be found here:https://blueprints.launchpad.net/neutron/+spec/openstack-service-chain-framework&lt;br /&gt;
* The Blueprint for the initial API work may be found here: https://blueprints.launchpad.net/neutron/+spec/neutron-api-extension-for-service-chaining&lt;br /&gt;
* The reviews related to the initial API work may be found here: https://review.openstack.org/#/q/topic:networking-sfc,n,z&lt;br /&gt;
&lt;br /&gt;
= networking-sfc installation steps and testbed setup =&lt;br /&gt;
If you have previous networking-sfc patches installed on your testbed, then do the following to get the new updated patch code set&lt;br /&gt;
&lt;br /&gt;
1.	Clean up networking-sfc&lt;br /&gt;
* cd /opt/stack&lt;br /&gt;
* rm –rf networking-sfc&lt;br /&gt;
&lt;br /&gt;
2.	clone networking-sfc into local repository  &lt;br /&gt;
* git clone git://git.openstack.org/openstack/networking-sfc.git&lt;br /&gt;
&lt;br /&gt;
3.	cd /opt/stack/networking-sfc and run &amp;quot;sudo python setup.py install&amp;quot; &lt;br /&gt;
&lt;br /&gt;
4.     cd ~/devstack/ and run unstack.sh and stack.sh&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
If you have not installed networking-sfc on your testbed before, then do the following to get the patch code set&lt;br /&gt;
&lt;br /&gt;
1. install Linux 14.04&lt;br /&gt;
* install git and configure user.email and user.name&lt;br /&gt;
* sudo apt-get install software-properties-common&lt;br /&gt;
* sudo add-apt-repository cloud-archive:liberty&lt;br /&gt;
&lt;br /&gt;
2. clone networking-sfc into local repository&lt;br /&gt;
* sudo mkdir /opt/stack&lt;br /&gt;
* sudo chown stack.stack /opt/stack&lt;br /&gt;
* cd /opt/stack/&lt;br /&gt;
* git clone git://git.openstack.org/openstack/networking-sfc.git&lt;br /&gt;
&lt;br /&gt;
3. download devstack &lt;br /&gt;
* cd /opt/stack&lt;br /&gt;
* git clone git://git.openstack.org/openstack-dev/devstack.git -b stable/liberty&lt;br /&gt;
&lt;br /&gt;
4. copy local.conf to local repository and add the following line:&lt;br /&gt;
* enable_plugin networking-sfc git://git.openstack.org/openstack/networking-sfc stable/liberty&lt;br /&gt;
'''OR'''&lt;br /&gt;
* enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
5. run stack.sh&lt;br /&gt;
* cd devstack&lt;br /&gt;
* ./stack.sh&lt;br /&gt;
&lt;br /&gt;
If it reports some errors, read the error messages and try to fix it.&lt;br /&gt;
&lt;br /&gt;
6. Install OVS 2.3.2 or OVS 2.4. Note that the OVS version should match its supported Linux kernel version in order for the OVS to work properly. \&lt;br /&gt;
The following table lists the Linux kernel versions against which the given versions of the Open vSwitch kernel module will successfully build.&lt;br /&gt;
Open vSwitch	Linux kernel&lt;br /&gt;
2.0.x         	2.6.32 to 3.10&lt;br /&gt;
2.1.x	                2.6.32 to 3.11&lt;br /&gt;
2.3.x	                2.6.32 to 3.14&lt;br /&gt;
2.4.x	                2.6.32 to 4.0&lt;br /&gt;
2.5.x	                2.6.32 to 4.3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. run unstack.sh and stack.sh&lt;br /&gt;
* ./unstack&lt;br /&gt;
* ./stack&lt;br /&gt;
&lt;br /&gt;
In our one-server  testbed, all OpenStack components run on one physical server. We created 3 VMs, one for source VM, another for Service Function VM, the last one for destination VM.&lt;br /&gt;
&lt;br /&gt;
= Data Path Encapsulation Flow =&lt;br /&gt;
[[File:SFC-datapath-flow-format.png|SFC-datapath-flow-format-MAC-Rewriting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The initial reference implementation will be based on programming Open vSwitch with flow table entries that override the default MAC based forwarding and instead forward frames based on criteria defined via the Neutron SFC API. It will also be possible for third party SDN implementations with Neutron integration and SFC capabilities (e.g. Contrail, Nuage, etc) to program their respective forwarding planes based on the Neutron SFC API, but this will be dependent upon the respective vendors updating their SDN Controller integration with Neutron.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Multi-Host Installation =&lt;br /&gt;
Terminology:&lt;br /&gt;
* H1 – Physical Host1 (Controller + Network + Compute)&lt;br /&gt;
* H2 – Physical Host 2 (Compute)&lt;br /&gt;
* H3 – Physical Host 3 (Compute)&lt;br /&gt;
&lt;br /&gt;
* SRC – Source VM&lt;br /&gt;
* SF1 – Service Function 1&lt;br /&gt;
* SF2 – Service Function 2&lt;br /&gt;
* DST – Destination VM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 SRC                             DST&lt;br /&gt;
   |                              |&lt;br /&gt;
  H1=============H2===============H3&lt;br /&gt;
   |             |                                   &lt;br /&gt;
 SF1             SF2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Important Note:  &lt;br /&gt;
Currently, with OVS 2.4.0, the kernel module is dropping MPLS over tunnel packets hitting the flood entry.&lt;br /&gt;
This can be worked around by enabling l2population.&lt;br /&gt;
Please see steps below for detailed setup instructions.&lt;br /&gt;
&lt;br /&gt;
Step1: Prepare H1 (Controller + Network + Compute)&lt;br /&gt;
&lt;br /&gt;
Step 1.1:&lt;br /&gt;
&lt;br /&gt;
local.conf for H1:&lt;br /&gt;
[[local|localrc]]&lt;br /&gt;
&lt;br /&gt;
 SERVICE_TOKEN=abc123&lt;br /&gt;
 ADMIN_PASSWORD=abc123&lt;br /&gt;
 MYSQL_PASSWORD=abc123&lt;br /&gt;
 RABBIT_PASSWORD=abc123&lt;br /&gt;
 SERVICE_PASSWORD=$ADMIN_PASSWORD&lt;br /&gt;
  &lt;br /&gt;
 HOST_IP=10.145.90.160&lt;br /&gt;
 SERVICE_HOST=10.145.90.160&lt;br /&gt;
 SYSLOG=True&lt;br /&gt;
 SYSLOG_HOST=$HOST_IP&lt;br /&gt;
 SYSLOG_PORT=516&lt;br /&gt;
 &lt;br /&gt;
 LOGFILE=$DEST/logs/stack.sh.log&lt;br /&gt;
 LOGDAYS=2&lt;br /&gt;
 &lt;br /&gt;
 disable_service tempest&lt;br /&gt;
 &lt;br /&gt;
 RECLONE=no&lt;br /&gt;
 PIP_UPGRADE=False&lt;br /&gt;
 &lt;br /&gt;
 MULTI_HOST=TRUE&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Networking&lt;br /&gt;
 disable_service n-net&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Compute&lt;br /&gt;
 #disable_service n-cpu&lt;br /&gt;
 &lt;br /&gt;
 # Neutron - Networking Service&lt;br /&gt;
 enable_service q-svc&lt;br /&gt;
 enable_service q-agt&lt;br /&gt;
 enable_service q-dhcp&lt;br /&gt;
 enable_service q-l3&lt;br /&gt;
 enable_service q-meta&lt;br /&gt;
 enable_service neutron&lt;br /&gt;
 &lt;br /&gt;
 # Cinder&lt;br /&gt;
 disable_service c-api&lt;br /&gt;
 disable_service c-sch&lt;br /&gt;
 disable_service c-vol&lt;br /&gt;
 &lt;br /&gt;
 # Disable security groups&lt;br /&gt;
 Q_USE_SECGROUP=False&lt;br /&gt;
 LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
Step 1.2: &lt;br /&gt;
./stack.sh  from your /opt/stack/devstack &lt;br /&gt;
&lt;br /&gt;
Step 1.3:&lt;br /&gt;
Once devstack finishes, overwrite the key neutron configuration files manually.&lt;br /&gt;
I do it this way.  I am sure there is a way to do this using configurations directly in the&lt;br /&gt;
local.conf file.&lt;br /&gt;
I modify the following files manually&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
/etc/neutron/l3_agent.ini&lt;br /&gt;
/etc/neutron/dhcp_agent.ini&lt;br /&gt;
/etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
&lt;br /&gt;
 [ml2]&lt;br /&gt;
 tenant_network_types = vxlan&lt;br /&gt;
 extension_drivers = port_security&lt;br /&gt;
 type_drivers = local,flat,vlan,gre,vxlan&lt;br /&gt;
 mechanism_drivers = openvswitch,linuxbridge,l2population&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_flat]&lt;br /&gt;
 flat_networks=public&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_vxlan]&lt;br /&gt;
 vni_ranges = 8192:100000&lt;br /&gt;
 &lt;br /&gt;
 [securitygroup]&lt;br /&gt;
 enable_security_group = False&lt;br /&gt;
 enable_ipset = False&lt;br /&gt;
 firewall_driver = neutron.agent.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 [agent]&lt;br /&gt;
 tunnel_types = vxlan&lt;br /&gt;
 l2_population = True&lt;br /&gt;
 arp_responder = True&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
 &lt;br /&gt;
 [ovs]&lt;br /&gt;
 datapath_type = system&lt;br /&gt;
 tunnel_bridge = br-tun&lt;br /&gt;
 bridge_mappings = public:br-ex&lt;br /&gt;
 local_ip = 192.168.2.160&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/l3_agent.ini&lt;br /&gt;
 [DEFAULT]&lt;br /&gt;
 l3_agent_manager = neutron.agent.l3_agent.L3NATAgentWithStateReport&lt;br /&gt;
 external_network_bridge = br-ex&lt;br /&gt;
 interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver&lt;br /&gt;
 ovs_use_veth = False&lt;br /&gt;
 use_namespaces = True&lt;br /&gt;
 debug = True&lt;br /&gt;
 verbose = True&lt;br /&gt;
 &lt;br /&gt;
 [AGENT]&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/dhcp_agent.ini&lt;br /&gt;
 [DEFAULT]&lt;br /&gt;
 dhcp_agent_manager = neutron.agent.dhcp_agent.DhcpAgentWithStateReport&lt;br /&gt;
 interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver&lt;br /&gt;
 ovs_use_veth = False&lt;br /&gt;
 use_namespaces = True&lt;br /&gt;
 debug = True&lt;br /&gt;
 verbose = True&lt;br /&gt;
 dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
 &lt;br /&gt;
 [AGENT]&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/dnsmasq-neutron.conf&lt;br /&gt;
 dhcp-option-force=26,1450&lt;br /&gt;
&lt;br /&gt;
Step 1.4:&lt;br /&gt;
After modifying the above files, restart the following services&lt;br /&gt;
q-svc, q-agt,q-dhcp,q-l3&lt;br /&gt;
&lt;br /&gt;
Your Host1 (controller+network+compute) is now ready for multi-node operation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step2: Prepare H2 (Compute)&lt;br /&gt;
&lt;br /&gt;
Step 2.1:  &lt;br /&gt;
&lt;br /&gt;
local.conf for H2&lt;br /&gt;
&lt;br /&gt;
[[local|localrc]]&lt;br /&gt;
&lt;br /&gt;
 SERVICE_TOKEN=cisco123123&lt;br /&gt;
 ADMIN_PASSWORD=cisco123123&lt;br /&gt;
 MYSQL_PASSWORD=cisco123123&lt;br /&gt;
 RABBIT_PASSWORD=cisco123123&lt;br /&gt;
 DATABASE_PASSWORD=cisco123123&lt;br /&gt;
 SERVICE_PASSWORD=$ADMIN_PASSWORD&lt;br /&gt;
 DATABASE_TYPE=mysql&lt;br /&gt;
 &lt;br /&gt;
 HOST_IP=10.145.90.166&lt;br /&gt;
 SERVICE_HOST=10.145.90.160&lt;br /&gt;
 SYSLOG=True&lt;br /&gt;
 SYSLOG_HOST=$HOST_IP&lt;br /&gt;
 SYSLOG_PORT=516&lt;br /&gt;
 MYSQL_HOST=$SERVICE_HOST&lt;br /&gt;
 RABBIT_HOST=$SERVICE_HOST&lt;br /&gt;
 Q_HOST=$SERVICE_HOST&lt;br /&gt;
 GLANCE_HOSTPORT=$SERVICE_HOST:9292&lt;br /&gt;
 &lt;br /&gt;
 NOVA_VNC_ENABLED=True&lt;br /&gt;
 NOVNCPROXY_URL=&amp;quot;http://$SERVICE_HOST:6080/vnc_auto.html&amp;quot;&lt;br /&gt;
 VNCSERVER_LISTEN=$HOST_IP&lt;br /&gt;
 VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN&lt;br /&gt;
 &lt;br /&gt;
 LOGFILE=$DEST/logs/stack.sh.log&lt;br /&gt;
 LOGDAYS=2&lt;br /&gt;
 &lt;br /&gt;
 disable_service tempest&lt;br /&gt;
 &lt;br /&gt;
 RECLONE=no&lt;br /&gt;
 PIP_UPGRADE=False&lt;br /&gt;
 &lt;br /&gt;
 MULTI_HOST=TRUE&lt;br /&gt;
 &lt;br /&gt;
 # Disable Nova Networking&lt;br /&gt;
 disable_service n-net&lt;br /&gt;
 disable_service neutron&lt;br /&gt;
 &lt;br /&gt;
 # Neutron - Networking Service&lt;br /&gt;
 ENABLED_SERVICES=n-cpu,q-agt&lt;br /&gt;
 &lt;br /&gt;
 # Disable security groups&lt;br /&gt;
 Q_USE_SECGROUP=False&lt;br /&gt;
 LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 enable_plugin networking-sfc /opt/stack/networking-sfc&lt;br /&gt;
&lt;br /&gt;
Step 2.2: &lt;br /&gt;
./stack.sh  from your /opt/stack/devstack &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2.3: Overwrite the /etc/neutron/plugins/ml2/ml2_conf.ini as follows&lt;br /&gt;
&lt;br /&gt;
/etc/neutron/plugins/ml2/ml2_conf.ini&lt;br /&gt;
&lt;br /&gt;
 [ml2]&lt;br /&gt;
 tenant_network_types = vxlan&lt;br /&gt;
 extension_drivers = port_security&lt;br /&gt;
 type_drivers = local,flat,vlan,gre,vxlan&lt;br /&gt;
 mechanism_drivers = openvswitch,linuxbridge,l2population&lt;br /&gt;
 &lt;br /&gt;
 [ml2_type_vxlan]&lt;br /&gt;
 vni_ranges = 8192:100000&lt;br /&gt;
 &lt;br /&gt;
 [securitygroup]&lt;br /&gt;
 enable_security_group = True&lt;br /&gt;
 enable_ipset = False&lt;br /&gt;
 #firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver&lt;br /&gt;
 firewall_driver = neutron.agent.firewall.NoopFirewallDriver&lt;br /&gt;
 &lt;br /&gt;
 [agent]&lt;br /&gt;
 tunnel_types = vxlan&lt;br /&gt;
 root_helper_daemon = sudo /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf&lt;br /&gt;
 root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf&lt;br /&gt;
 l2_population = True&lt;br /&gt;
 arp_responder = True&lt;br /&gt;
 &lt;br /&gt;
 [ovs]&lt;br /&gt;
 datapath_type = system&lt;br /&gt;
 tunnel_bridge = br-tun&lt;br /&gt;
 local_ip = 192.168.2.166&lt;br /&gt;
&lt;br /&gt;
Step 2.4:&lt;br /&gt;
After modifying the above file, restart the q-agt service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step3: Prepare H3 (Compute) similar to H2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step4: Your 3-node multi-host setup is now ready to be configured for service chaining.&lt;/div&gt;</summary>
		<author><name>Qijing</name></author>	</entry>

	</feed>