= [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/NFV NFV Tutorial: Managing a Virtual Network Function using SDN and Control Theory] = {{{ #!html
Image Map
}}} == Part II: Execute == === 1. Login to the hosts === Open the following windows: - one window with ssh into ''controller'' - one window with ssh into ''OVS'' - one window with ssh into ''s1'' - one window with ssh into ''VNF1'' - one window with ssh into ''VNF2'' - one window with ssh into ''destination'' === 2. Configure and initialize services === ==== 2.1. Use a simple learning switch controller ==== This is a very simple example where we are going to run a learning switch control to forward traffic from s1 to VNF1.[[BR]] 1. Start a ping from s1 to VNF1 in the window of s1, which should timeout, since there is no controller running.[[BR]] '''ping vnf1 -c 10''' 2. Run the following command in the controller window to start the simple learning controller: '''/tmp/ryu/bin/ryu-manager --verbose /tmp/ryu/ryu/app/simple_switch.py''' 3. Now ping again from s1 to VNF1, the ping should work. 4. Stop the Ryu controller by typing '''Ctrl + c'''. 5. Run the following command in the OVS window to flush all the forwarding rules installed on the OVS node. '''sudo ovs-ofctl del-flows br0''' ==== 2.2 NFV OVS controller ==== Next we are going to run a different Ryu controller that will install !OpenFlow rules to support NFV load balancing as well as handling intrusion. With this controller, the traffic shall go from a source to destination, and duplicate packets are sent to one of the IDS nodes (VNF1 or VNF2) for intrusion detection. The picture below shows a red line representing traffic going from source1 to destination, and the green line represents the duplicate traffic that is sent to VNF1 for intrusion detection. [[Image(image040.gif)]] [[BR]] === 3. Execute Experiments: === 3.1. First we need to download the source code and configuration files for the NFV Ryu controller onto the controller VM. In the window of controller, run the following: - '''wget !https://raw.githubusercontent.com/akhtarnabeel/public/master/NFV-GENI/RyuController/setup_nfv_ryu_controller.sh''' - '''chmod 755 setup_nfv_ryu_controller.sh ''' - '''./setup_nfv_ryu_controller.sh''' 3.2. Now you should have all files needed for the NFV Ryu controller. Open ''nfv.config'' file to configure the system parameters. You can use any editor to edit the file, and we use nano here as an example. - '''nano /tmp/ryu/ryu/app/nfv.config''' 3.3. You will see the details of this configuration file as follows. Change the values of ''vnf1_interface'' and ''vnf2_interface'' to the values that you noted down in ''Section 3.3.1'' in the '''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/Design Design/Setup]''' section of this tutorial. These values will tell the controller which interfaces are connected to VNF1 and VNF2. [[Image(configPic.png)]] [[BR]] '''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalanceRRwithRyu Experiment 1: Load Balancing using Round Robin Control with Ryu Controller]'''[[BR]] '''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2: Load Balancing using Proportional Integral (PI) Control with Ryu Controller]'''[[BR]] '''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/HandlingIntrusionwithRyu-ping Experiment 3: Handling Intrusion with Ryu Controller: Ping Attack]'''[[BR]] '''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/HandlingIntrusionwithRyu-portscanning Experiment 4: Handling Intrusion with Ryu Controller: Port Scanning Attack]'''[[BR]] == [wiki:GENIExperimenter/Tutorials/NFV/Ryu/Finish Next: Finish] ==