Changes between Initial Version and Version 1 of GENIExperimenter/Tutorials/NFV/Ryu/HandlingIntrusionwithRyu


Ignore:
Timestamp:
10/19/16 16:43:38 (8 years ago)
Author:
wyf@bu.edu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/NFV/Ryu/HandlingIntrusionwithRyu

    v1 v1  
     1=  Experiment 3: Handing Intrusion with Ryu Controller =
     2
     3== Overview ==
     4
     5In this experiment, we will use the Ryu controller to handle the intrusion traffic. The system is the same as the one used in [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2], where we use a RINA distributed application to get the intrusion detection results from the VNFs (i.e., snort) as well as the load of VNFs. When an intrusion is detected by VNFs, its information will be passed to the Ryu controller via the RINA distributed application,  and then the Ryu controller  will block the intrusion traffic by updating the !OpenFlow rules on the OVS switch. 
     6
     7
     8{{{
     9#!html
     10<img src="http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image060.gif" hspace=50>
     11 }}}
     12
     13We use the same PI control for load balancing as in [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2], and you can find details about the PI control there.
     14
     15== (1) RINA Distributed Application ==
     16
     17Same as Part (1) RINA Distributed Application in the [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2].
     18
     19== (2) PI Controller ==
     20Same as Part (2) PI Controller in the [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2].
     21
     22== (3) PI-based Ryu Controller ==
     23Same as Part (3) PI-based Ryu Controller in the [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2]. 
     24
     25'''Note: You can see in "nfv.config" that the information of the intrusion traffic is located in the  file ''/tmp/attacker.txt'' on the controller VM, which is outputted by the RINA distributed application. Make sure the file is empty each time you run this experiment.'''
     26
     27== (4) Run Snort  ==
     28
     29''' Note: keep the RINA application processes, PI controller process and PI-based Ryu controller process from the previous 3 steps running in the background. '''
     30
     311. We need to first install our own snort rule on snort, so that it can detect the intrusion traffic specified in our rule.
     32
     33 To install our own rule and configure snort,  in separate windows for VNF1 and VNF2,   execute the following command:
     34   
     35    - ''' cd ~ '''
     36    - ''' wget !http://csr.bu.edu/rina/grw-bu2016/nfv_ryu/snort/config_snort.sh '''
     37    - ''' chmod 755 config_snort.sh '''
     38    -  ''' ./config_snort.sh '''
     39
     40Here we use a simple rule where all ICMP traffic to the ''destination'' node is considered as intrusion traffic, and the rule is specified as follows: 
     41
     42''' alert icmp any any -> 10.10.1.5 any (msg:"ICMP traffic found to Destination";sid:1000001;) '''
     43
     44in the file ''' /etc/snort/rules/my.rules'''.
     45
     46
     472. We then run Snort IDS on VNF1 and VNF2. In separate windows for VNF1 and VNF2, execute the following command:
     48
     49   - ''' sudo /usr/local/bin/snort -A full -dev -c /etc/snort/snort.conf -i eth1'''
     50 
     51   ''' Note: this command is different from [wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2], where the file ''/etc/snort/snort.conf '' specifies which rule files to load. '''
     52
     53When snort detects intrusion traffic, it will save the alert messages into the file '' /var/log/snort/alert ''. The RINA distributed application keeps reading this alert file, and pass the any intrusion information to the Ryu controller which will block the intrusion traffic.
     54
     55==  (5) Generate Regular and Intrusion Traffic ==
     56
     571. In a separate window for destination, start the netcat server by running:
     58
     59   - ''' nc -u -l 5000 ''' 
     60
     612. In another separate window for  s1, start the netcat client by running:
     62
     63   - ''' nc -u destination 5000'''
     64
     653. Type something on the s1 window and you should see it on the destination window.
     66
     674. In another separate window for s1,  send ICMP messages to destination by running the following ping command:
     68
     69   - ''' ping destination'''
     70
     71The first few ping messages are able to reach destination since it takes some time for the controller to get the intrusion detection results from VNFs via the RINA distributed application, but after a few seconds, all following messages will not be able to reach destination, and you can see the following output:
     72
     73{{{
     74#!html
     75<img src="http://csr.bu.edu/rina/grw-bu2016/nfv_ryu/pics/failedPing.png" hspace=50>
     76 }}}
     77
     78If you go to the controller window which runs the Ryu controller, you can see it drops all ICMP messages from the attacker with the following output:
     79
     80
     81{{{
     82#!html
     83<img src="http://csr.bu.edu/rina/grw-bu2016/nfv_ryu/pics/intrusion.png" hspace=50>
     84 }}}
     85
     86Meanwhile, you can type messages on the netcat client side on the s1, and all messages are still able to reach destination since only ICMP messages are blocked from s1.
     87 
     88== Next ==
     89After you are done with all experiments, close all your open windows and release your resources. In the GENI Portal, select the slice and click on the Delete button. Now you can start designing and running your own experiments!
     90
     91[wiki:GENIExperimenter/Tutorials/NFV/Ryu  Return to the NFV Ryu tutorial main page] '''.