node/
coverage/
.checkstyle
+.vagrant
--- /dev/null
+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)
+--------------------
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"
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"
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"
#!/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"
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'''
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"
def get_service_functions_uri():
return "/restconf/config/service-function:service-functions"
-
+
def get_service_functions_data():
return {
"service-functions": {
"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
}
"protocol": "6",
"source-port-range": {
"lower-port": 80
+ },
+ "destination-port-range": {
+ "lower-port": 0
}
}
}
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
#!/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
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
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
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();
}