Bug 5072: Fail to create ACL 37/32737/19
authorRuijing Guo <[email protected]>
Thu, 4 Feb 2016 23:02:46 +0000 (07:02 +0800)
committerRuijing Guo <[email protected]>
Fri, 5 Feb 2016 07:39:27 +0000 (07:39 +0000)
Change-Id: Ib002e91ae3e074f6bbfbeda816078498914203a6
Signed-off-by: Ruijing Guo <[email protected]>
.gitignore
sfc-demo/sfc103/README.md [new file with mode: 0644]
sfc-demo/sfc103/Vagrantfile
sfc-demo/sfc103/cleanup.py
sfc-demo/sfc103/demo.sh
sfc-demo/sfc103/setup.py
sfc-demo/sfc103/setup_classifier.sh
sfc-demo/sfc103/setup_odl.sh
sfc-demo/sfc103/setup_sf.sh
sfc-scf-openflow/src/main/java/org/opendaylight/sfc/scfofrenderer/SfcScfMatch.java

index ba7d2dc10047ca2655a2e20aca250bbfaa6e7318..da627e3512a6aebd657c6a42a10bea172c95dfd8 100644 (file)
@@ -34,3 +34,4 @@ node_modules/
 node/
 coverage/
 .checkstyle
+.vagrant
diff --git a/sfc-demo/sfc103/README.md b/sfc-demo/sfc103/README.md
new file mode 100644 (file)
index 0000000..5edd7d1
--- /dev/null
@@ -0,0 +1,42 @@
+SFC103 Demo
+===========
+
+Overview
+--------
+
+SFC103 demo is to show standalone SFC classifier.
+
+Topology
+-------
+
+                           +-----------------+
+                           |       SFC       |
+                           |   192.168.1.5   |
+                           +-----------------+
+                       /      |          |     \
+                    /         |          |         \
+                /             |          |             \
++---------------+  +--------------+   +--------------+  +---------------+
+|  Classifier1  |  |    SFF1      |   |     SFF2     |  |  Classifier2  |
+|  192.168.1.10 |  | 192.168.1.20 |   | 192.168.1.50 |  |  192.168.1.60 |
++---------------+  +--------------+   +--------------+  +---------------+
+                              |          |
+                              |          |
+                   +---------------+  +--------------+
+                   |     DPI-1     |  |     FW-1     |
+                   | 192.168.1.30  |  | 192.168.1.40 |
+                   +---------------+  +--------------+
+
+Setup Demo
+----------
+1. Install virtualbox & vagrant in ubuntu 14.04.03
+2. ./demo.sh
+
+
+Cleanup Demo
+------------
+1. vagrant destroy -f
+
+
+Trouble Shooting(TBD)
+--------------------
index c2a809caf4663e8421d4b7069509179b9fa9dec9..348db9807149fff14b0acf0270f01fcb03eb52b8 100644 (file)
@@ -12,7 +12,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
     v.customize ["modifyvm", :id, "--memory", 1024]
     v.customize ["modifyvm", :id, "--cpus", 4]
   end
-  
+
+  config.vm.synced_folder "../..", "/sfc"
+
   config.vm.define "odl" do | h |
     h.vm.host_name = "odl"
     h.vm.network :private_network, ip: "192.168.1.5"
@@ -21,22 +23,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       v.customize ["modifyvm", :id, "--cpus", 4]
     end
   end
-  
+
   config.vm.define "classifier1" do | h |
     h.vm.host_name = "classifier1"
     h.vm.network :private_network, ip: "192.168.1.10"
   end
-  
+
   config.vm.define "sff1" do | h |
     h.vm.host_name = "sff1"
     h.vm.network :private_network, ip: "192.168.1.20"
   end
-  
+
   config.vm.define "sf1" do | h |
     h.vm.host_name = "sf1"
     h.vm.network :private_network, ip: "192.168.1.30"
   end
-  
+
   config.vm.define "sf2" do | h |
     h.vm.host_name = "sf2"
     h.vm.network :private_network, ip: "192.168.1.40"
index 0452fd3765d246defc57a282b29e988d40e56309..2448c607dcb12910720893204b52fd147c2baab5 100755 (executable)
@@ -24,7 +24,7 @@ def get_service_nodes_uri():
 
 def get_service_functions_uri():
     return "/restconf/config/service-function:service-functions"
-    
+
 def get_service_function_forwarders_uri():
     return "/restconf/config/service-function-forwarder:service-function-forwarders"
 
index 65acbc88fa963259ed07e39c4522d6cffb14ef56..00b5f7d48a3b8bd9242ae0ffc0e99f9a368420a3 100755 (executable)
@@ -1,11 +1,41 @@
 #!/bin/bash
-#vagrant up
-#vagrant ssh odl -c "/vagrant/setup_odl.sh"
-vagrant ssh classifier1  -c "sudo /vagrant/setup_classifier.sh"
-vagrant ssh classifier2  -c "sudo /vagrant/setup_classifier.sh"
-vagrant ssh sf1 -c "sudo /vagrant/setup_sf.sh"
-vagrant ssh sf2 -c "sudo /vagrant/setup_sf.sh"
-vagrant ssh sff1  -c "sudo /vagrant/setup_sff.sh"
-vagrant ssh sff2  -c "sudo /vagrant/setup_sff.sh"
-vagrant ssh odl -c "/vagrant/setup.sh"
+vagrant destroy -f
+vagrant up
+vagrant ssh odl -c "nohup /vagrant/setup_odl.sh & sleep 1"
+vagrant ssh classifier1  -c "nohup sudo /vagrant/setup_classifier.sh & sleep 1"
+vagrant ssh classifier2  -c "nohup sudo /vagrant/setup_classifier.sh & sleep 1"
+vagrant ssh sf1 -c "nohup sudo /vagrant/setup_sf.sh & sleep 1"
+vagrant ssh sf2 -c "nohup sudo /vagrant/setup_sf.sh & sleep 1"
+vagrant ssh sff1  -c "nohup sudo /vagrant/setup_sff.sh & sleep 1"
+vagrant ssh sff2  -c "nohup sudo /vagrant/setup_sff.sh & sleep 1"
+
+inprog=1
+
+while [ $inprog -ne 0 ]
+do
+    echo "check system is ready"
+    inprog=0
+    vagrant ssh odl -c "sfc/sfc-karaf/target/assembly/bin/client -u karaf 'log:display' 2>/dev/null | grep 'Initialized RSP listener'"
+    inprog+=$?
+    vagrant ssh classifier1  -c "sudo ovs-vsctl show"
+    inprog+=$?
+    vagrant ssh classifier2  -c "sudo ovs-vsctl show"
+    inprog+=$?
+    vagrant ssh sff1  -c "sudo ovs-vsctl show"
+    inprog+=$?
+    vagrant ssh sff2  -c "sudo ovs-vsctl show"
+    inprog+=$?
+    vagrant ssh sf1  -c "ps -ef |grep sfc_agent.py"
+    inprog+=$?
+    vagrant ssh sf2  -c "ps -ef |grep sfc_agent.py"
+    inprog+=$?
+    sleep 30
+done
+
+vagrant ssh odl -c "/vagrant/setup.py"
+sleep 60
+vagrant ssh classifier1  -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
+vagrant ssh classifier2  -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
+vagrant ssh sff1 -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
+vagrant ssh sff2 -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
 vagrant ssh classifier1  -c "sudo ip netns exec app wget http://192.168.2.2"
index 061584451b08619ce521983921167bc89a0c3dea..b7976941df7270cf127dba986067b22db5f93916 100755 (executable)
@@ -34,6 +34,7 @@ def put(host, port, uri, data, debug=False):
     if debug == True:
         print r.text
     r.raise_for_status()
+    time.sleep(5)
 
 def post(host, port, uri, data, debug=False):
     '''Perform a POST rest operation, using the URL and data provided'''
@@ -48,6 +49,7 @@ def post(host, port, uri, data, debug=False):
     if debug == True:
         print r.text
     r.raise_for_status()
+    time.sleep(5)
 
 def get_service_nodes_uri():
     return "/restconf/config/service-node:service-nodes"
@@ -100,7 +102,7 @@ def get_service_nodes_data():
 
 def get_service_functions_uri():
     return "/restconf/config/service-function:service-functions"
-    
+
 def get_service_functions_data():
     return {
     "service-functions": {
@@ -394,6 +396,9 @@ def get_service_function_acl_data():
                 "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
                 }
@@ -417,6 +422,9 @@ def get_service_function_acl_data():
                 "protocol": "6",
                 "source-port-range": {
                     "lower-port": 80
+                },
+                "destination-port-range": {
+                    "lower-port": 0
                 }
               }
             }
index 9c10b36dd60c4c3d1519372f3c44de050221a230..586653a1c24743987a465d205f084d21d355adab 100755 (executable)
@@ -39,6 +39,6 @@ else
     ip netns exec app ip link set dev veth-app up
     ip netns exec app ip link set dev lo up
     ip netns exec app ifconfig veth-app mtu 1400
-    ip netns exec app python -m SimpleHTTPServer 80 &
+    ip netns exec app python -m SimpleHTTPServer 80
 fi
 ovs-vsctl show
index c899ec33de6bb55a8a4b6cd0258587c56980cf20..706ccaf036d4a6a1acd63764db107cc37b8a2a9f 100755 (executable)
@@ -1,7 +1,12 @@
 #!/bin/bash
 
+echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
+sudo add-apt-repository ppa:webupd8team/java -y
 sudo apt-get update -y
-sudo apt-get install openjdk-7-jdk mininet -y
+sudo apt-get install oracle-java8-installer -y
+sudo update-java-alternatives -s java-8-oracle
+sudo apt-get install oracle-java8-set-default -y
+sudo apt-get install  mininet -y
 sudo mkdir -p /usr/local/apache-maven
 sudo wget http://ftp.wayne.edu/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
 sudo mv apache-maven-3.3.3-bin.tar.gz /usr/local/apache-maven
@@ -14,12 +19,13 @@ sudo apt-get install npm vim git git-review diffstat -y
 cat << EOF >> /home/vagrant/.bashrc
 export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.3
 export MAVEN_OPTS="-Xms256m -Xmx512m" # Very important to put the "m" on the end
-export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 # This matches sudo update-alternatives --config java
+export JAVA_HOME=/usr/lib/jvm/java-8-oracle # This matches sudo update-alternatives --config java
 EOF
 
 source /home/vagrant/.bashrc
 mkdir /home/vagrant/.m2
 wget -O  - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > /home/vagrant/.m2/settings.xml
 
-cd /home/vagrant; git clone https://github.com/opendaylight/sfc.git
-cd /home/vagrant/sfc; mvn clean install -nsu -DskipTests; sfc-karaf/target/assembly/bin/karaf &
+rm -rf /home/vagrant/sfc; cp -r /sfc /home/vagrant
+cd /home/vagrant/sfc; mvn clean install -nsu -DskipTests;
+cd /home/vagrant/sfc/sfc-karaf/target/assembly; echo "log4j.logger.org.opendaylight.sfc = DEBUG,stdout" >> etc/org.ops4j.pax.logging.cfg; rm -rf journal snapshots; bin/karaf clean
index ce30b3b4a7379eddc6dec54869f95e18bfc529db..f938f16d59ba7545e2b3f9c7f0487cb0f2fa8cfa 100755 (executable)
@@ -7,12 +7,9 @@ apt-get install git -y
 apt-get install python3-flask requests netifaces -y
 apt-get install libssl-dev openssl -y
 apt-get install libnetfilter-queue-dev -y
-apt-get install python3-pip -y
-pip3 install sfc
+apt-get install python3-pip python3-flask -y
+pip3 install sfc paramiko flask
 apt-get install curl -y
 
-cd /home/vagrant/
-git clone http://github.com/opendaylight/sfc
-
-cd /home/vagrant/sfc/sfc-py
-sudo python3.4 sfc/sfc_agent.py --rest --odl-ip-port 192.168.1.5:8181 &
+rm -rf /home/vagrant/sfc; cp -r /sfc /home/vagrant
+cd /home/vagrant/sfc/sfc-py; python3.4 sfc/sfc_agent.py --rest --odl-ip-port 192.168.1.5:8181
index 97e9384f784e52ea1cbd4373736b2e25fcd223cc..e82c03f2c8163bbc11196ff598d69a084f32eedc 100644 (file)
@@ -81,12 +81,14 @@ public class SfcScfMatch {
 
                 if (aceip.getSourcePortRange() != null &&
                     aceip.getSourcePortRange().getLowerPort() != null &&
-                    aceip.getSourcePortRange().getLowerPort().getValue() != null) {
+                    aceip.getSourcePortRange().getLowerPort().getValue() != null &&
+                    aceip.getSourcePortRange().getLowerPort().getValue().intValue() != 0) {
                     srcPort = aceip.getSourcePortRange().getLowerPort().getValue();
                 }
                 if (aceip.getDestinationPortRange() != null &&
                     aceip.getDestinationPortRange().getLowerPort() != null &&
-                    aceip.getDestinationPortRange().getLowerPort().getValue() != null) {
+                    aceip.getDestinationPortRange().getLowerPort().getValue() != null &&
+                    aceip.getDestinationPortRange().getLowerPort().getValue().intValue() != 0) {
                     dstPort = aceip.getDestinationPortRange().getLowerPort().getValue();
                 }