Changes between Initial Version and Version 1 of GENIExperimenter/Tutorials/NFV/Pox/Execute/LoadBalanceRR

05/31/17 14:16:37 (5 years ago)
Nabeel Akhtar



  • GENIExperimenter/Tutorials/NFV/Pox/Execute/LoadBalanceRR

    v1 v1  
     1= [wiki:GENIExperimenter/Tutorials/NFV/Execute NFV Tutorial Part II: Execute] =
     3== Experiment 1:  Load Balancing using Round Robin Control ==
     5In the first experiment, we will look at a Round Robin load balancer for a VNF Snort application.
     7Snort will be running as IDS on VNF1 and VNF2 and we will try to balance the load across the two VNF instances by directing each new flow request to one of the two VNF instances in a round robin fashion.
     10We will use the '''Netcat''' application to generate traffic between a source and destination.
     12Netcat is a useful application for network debugging and investigation. It is used for reading from and writing to network connections using TCP or UDP. In other words, it is like talking on the phone. One (a node)  talks and another one, on the other side, listens and talks back. Using netcat, you can see the communication between a source and destination.
     14 1.     Open the ''controller'' window and execute the following:
     16 {{{
     18    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cd /tmp/pox/ext <br></b> </span>
     19    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>nano port.config <br></b> </span>
     24 Here change the controller_type to '''RR''' as shown below:
     27<img src="" hspace=5>
     28 }}}
     29 2.     Run the NFV_controller in the ''controller'' window:
     33    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cd /tmp/pox/ <br></b> </span>
     34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>python --verbose NFV_controller<br></b> </span>
     39 3.     Open the ''VNF1'' and ''VNF2'' windows and run Snort IDS on each of the VNFs as shown below:
     43    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>sudo /usr/local/bin/snort -A console -v -c / -i eth1 <br></b> </span>
     46 You should see the window shown below on the ''VNF1'' and ''VNF2'' windows.
     49<img src="" hspace=5>
     50 }}}
     52 4.     In the destination window, run the netcat server:
     56    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>nc -u -l 5000 <br></b> </span>
     60 5.     In the ''s1'' window, run the netcat client to send traffic to the ''destination'' node:
     64    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>nc -u destination 5000 <br></b> </span>
     67 6.     Type something on the ''s1'' window and you should see it on the ''destination'' window. Now if you look at the ''VNF1'' and ''VNF2'' windows running Snort IDS, you could see packets arriving at the VNF1 and VNF2 nodes in a Round Robin fashion. An example of such an output is shown below on the VNF window running Snort IDS.
     71<img src="" hspace=50>
     72 }}}
     74 In the ''controller'' window, you can see that the controller chooses VNF1 and VNF2 in a Round Robin fashion as shown below:
     78<img src="" hspace=50>
     79 }}}
     84 {{{
     86<table id="Table_02" width = "700" border="0" cellpadding="0" cellspacing="10" >
     87 <tr>
     88<td> <img src = ""> </td>
     89<td> <b>OPTIONAL: Review the RR Controller Code:</b> </td> </tr></table>
     91 The Round Robin code is based on the following algorithm:
     95<img src="" hspace=50>
     96 }}}
     98 If you want to see the code for the Round Robin load balancer, you can see it by executing:
     102    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cd /tmp/pox/ext <br></b> </span>
     103    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cat<br></b> </span>
     106 The code that corresponds to Round Robin control is shown below:
     110<img src="" hspace=50>
     111 }}}
     114 Here if the VNF selected for the previous flow was VNF1, VNF2 is selected for the next flow, and vice versa. Once a VNF is selected, packets are sent to the selected VNF:
     118<img src="" hspace=50>
     119 }}}
     121'''[wiki:GENIExperimenter/Tutorials/NFV/Execute Back to Part II: Execute]'''[[BR]]
     122'''[wiki:GENIExperimenter/Tutorials/NFV/Execute/LoadBalancePI Experiment 2:  Load Balancing using Proportional Integral (PI) Control]'''[[BR]]
     124== [wiki:GENIExperimenter/Tutorials/NFV/Finish Next: Finish] ==