SDN Identity Manager

Author: Martin Holkovič, iholkovic@fit.vutbr.cz

Description: The SDNIM tool combines the identity management system SIMS with 
the SDN controller Pyretic, which allows to use knowledge of user identities 
within network management. Linking is enabled by extension of SDN controller 
and by created Pyretic application for managing and sharing information 
received from the SIMS to other applications. With this tool, it is possible to 
create additional Pyretic network management applications based on user 
identity from the network. Several use cases are also part of the tool, which 
are aimed at filtering traffic, routing and billing.

List of elements:
Pyretic - OpenFlow controller for managing OpenFlow switches (OVS-switch)
Switch - Arbitrary computer switch
OVS-switch - OpenFlow switch, can also be implemented in software
WIS - Web Information System for user authentication
SIMS - Identity management system for managing identity of users, system has to 
be connected to user network and also to managing network (network connected to 
controller)

Architecture:
                                                          
                       +---------+                        
                       | Pyretic |                        
                       +---------+                        
                            |                             
                            |                             
                       +---------+                        
                       | Switch  |-----------------------+
                       +---------+                       |
                         |  |  |                         |
         +---------------+  |  +---------------+         |
         |                  |                  |         |
   +------------+     +------------+     +------------+  |
   | OVS-switch |     | OVS-switch |     | OVS-switch |  |
   +------------+     +------------+     +------------+  |
         |                                     |         |
      +-----+                               +------+     |
      | WIS |                               | SIMS |-----+
      +-----+                               +------+      
                                                          

Installation:
1. SIMS:
-	copy folder from ./source_files/SIMS to somewhere on disk
-	copy all files from ./source_files/patch/SIMS/ to folder ./src/src/
-	sudo apt-get install bash build-essential python-dev python-ipy \
    python3-ipy libpcap-dev python-pcapy python-scapy libdb-dev libmysql++-dev \
    graphviz

2. Pyretic:
-	install Ubuntu 14.04
-	install Guest Addition
-	extract archive pox-carp.zip from ./source_files/controller to directory 
	~/pox/
-	extract archive pyretic-master.zip from ./source_files/controller to 
	~/pyretic/
-	sudo apt-get install python-setuptools 
-	sudo apt-get install python-dev python-pip python-netaddr screen hping3 \
    ml-lpt graphviz ruby1.9.1-dev libboost-dev libboost-test-dev \
    libboost-program-options-dev libevent-dev automake libtool flex bison \
    pkg-config g++ libssl-dev python-all python-all-dev python-all-dbg
-	sudo pip install networkx bitarray netaddr ipaddr pytest ipdb sphinx \
    pyparsing==1.5.7 yappi
-	sudo gem install Jekyll
-	copy file asynchat.py from ./source_files/controller (file is used in next 
	step)
-	sudo mv asynchat.py /usr/lib/python2.7/
-	sudo chown root:root /usr/lib/python2.7/asynchat.py
-	export PATH=$PATH:$HOME/pyretic:$HOME/pox   
-	export PYTHONPATH=$HOME/pyretic:$HOME/mininet:$HOME/pox
-	copy all files from ./source_files/patch/Pyretic/ to folder 
	~/pyretic/pyretic/examples
-	chmod +x ~/pyretic/patch.sh
-	~/pyretic/patch.sh
-	copy and extract archive iricollector.zip from ./source_files/iricollector
-	sudo apt-get install python3-ipy
-	in file iri-collector.ini specify IP address of SIMS in section - [iricore]
-	go to folder ~/pyretic/pyretic/examples
-	edit file shared.py
-	specify IP address if SIMS - item 'sims_ip'
-	specify all IP addresses of DHCP servers to variable dhcpServers

3. OVS-switch:
-	apt-get install openvswitch-common openvswitch-switch
-	sudo apt-get install mininet
-	ovs-vsctl --if-exists del-br br0
-	ovs-vsctl add-br br0
-	ovs-vsctl set-fail-mode ovs-switch secure
# add all required interfaces to switch configuration (e.g., eth0)
-	ovs-vsctl add-port eth0
-	ifconfig eth0 0

# every switch has to have unique ID (e.g., ID=1)
-	ovs-vsctl set bridge br0 other-config:datapath-id=0000000000000001
# on every switch specify IP address of controller (e.g., IP=192.168.1.208)
-	ovs-vsctl set-controller br0 tcp:192.168.1.208:6633 

4. WIS:
-	sudo apt-get install apache2 php5
-	sudo chown $USER:$USER /var/www/html
-	copy all files from ./source_files/WIS to /var/www/html
-	copy and extract archive iricollector.zip from ./source_files/iricollector
-	sudo apt-get install python3-ipy
-	in file iri-collector.ini specify IP address of SIMS in section - [iricore]

Running:
SIMS:
-	go to folder ./src
-	python interface2sdn.py 21102 21099
-	open new terminal
-	go to folder ./src
-	./sims.sh start info
-	to stop script sims.sh, use command ./sims.sh stop-please


COLLECTOR:
-	go to folder with controller
-	sudo python3 iricollector.py info


CONTROLLER:
-	edit file run.py
-	choosing which use case will be used is done by editing the variable 
	usecase on line 18
-	go to folder ~/pyretic/
-	python pyretic.py -m p0 -v low pyretic.examples.run

