1 # ALTO SPCE (Simple Path Computation Engine)
3 The ALTO SPCE module provides a simple path computation engine for ALTO and other projects. It works in the
4 OpenDaylight(ODL) SDN Controller.
8 One prerequisite for installing ALTO SPCE is that the ODL development environment should be setup by
9 following [this link](https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup).
11 With this prerequisite satisfied, execute `mvn clean install` in the directory of alto-spce project
12 to start the installation. After the installation, you can execute `./karaf/target/assembly/bin/karaf`
13 to start the alto-spce with ODL.
17 You can also deploy this module into a running ODL controller without stopping the controller, by
18 running `./deploy.sh <distribution_directory>`, where `<distribution_directory>` is the path of your own running ODL distribution.
20 For example, if you start your ODL controller from `/root/distribution-karaf-0.4.0-SNAPSHOT/bin/karaf`, you can use the command `./deploy.sh /root/distribution-karaf-0.4.0-SNAP`.
22 > **NOTE:** If you have checked out the latest commit in master branch, you will need a `karaf-0.4.1-SNAPSHOT` distribution rather than `karaf-0.4.0-SNAPSHOT`.
24 And then, you can check whether the features of alto-spce are loaded in your karaf shell as follows:
27 karaf@root()> feature:list | grep alto-spce
30 If the features are loaded, you can install them by:
33 karaf@root()> feature:install odl-alto-spce
39 karaf@root()> log:tail
42 You could use this command to get the tailing log. If you see **AltoSpceProvider Session Initiated!**,
43 it means that alto-spce has been installed successfully.
49 Please make sure that your have configured **l2switch** correctly. Two .xml files below could be found in `/karaf/target/assembly/etc/opendaylight/karaf`.
51 In **54-arphandler.xml**, please set
54 <is-proactive-flood-mode>false</is-proactive-flood-mode>
57 In **58-l2switchmain.xml**, please set
60 <is-learning-only-mode>true</is-learning-only-mode>
63 ### Creating a network using Mininet
66 sudo mn --controller=remote,ip=<Controller IP> --mac --topo=linear,3 --switch ovsk,protocols=OpenFlow13
69 The command above will create a virtual network consisting of 3 switches. And one host is attached to each switch.
73 l2switch uses ARP packets to discover hosts.
75 If we use mininet, we could use `ping` to let l2switch get the ARP packets it needs.
81 After this command, l2switch will discover host1 and host5.
84 ### Setup/Remove a path with python-odl library
86 We have forked [python-odl](https://github.com/SPRACE/python-odl) project to support alto-spce. You could get the code [here](https://github.com/snlab/python-odl).
89 # Import essential modules.
90 >>> import odl.instance
91 >>> import odl.altospce
93 # Initiate a ODLInstance object.
94 >>> myodl = odl.instance.ODLInstance("http://127.0.0.1:8181",("admin","admin"))
96 # Initiate a ALTOSpce object.
97 >>> myaltospce = odl.altospce.ALTOSpce(server="http://127.0.0.1:8181",credentials=("admin","admin"),odl_instance=myodl)
99 # Setup a path between host1(10.0.0.1) and host5(10.0.0.5)
100 >>> myaltospce.path_setup(src="10.0.0.1",dst="10.0.0.5",objective_metrics=["bandwidth"])
101 {'path': [u'10.0.0.5|openflow:6:3|openflow:5:3|openflow:1:1|openflow:2:1|openflow:3:1|10.0.0.1', u'10.0.0.1|openflow:3:3|openflow:2:3|openflow:1:2|openflow:5:1|openflow:6:1|10.0.0.5'], 'error-code': 'OK'}
103 # Remove the path between host1(10.0.0.1) and host5(10.0.0.5)
104 # To identify the path please use the 'path' indicated in myaltospce.path_setup
105 >>> myaltospce.path_remove(["10.0.0.5|openflow:6:3|openflow:5:3|openflow:1:1|openflow:2:1|openflow:3:1|10.0.0.1","10.0.0.1|openflow:3:3|openflow:2:3|openflow:1:2|openflow:5:1|openflow:6:1|10.0.0.5"])
109 Enjoy your alto-spce!
111 ## Try the demo system out
113 We have deploy a demo system in http://alto.yale.edu:8181/index.html and you can try it out. There is a brief usage:
115 You can setup or remove a path by using `python-odl` library. Just follow the section ["Setup/Remove a path with python-odl library"](#setupremove-a-path-with-python-odl-library) and replace `127.0.0.1` by `alto.yale.edu`.
117 Also you can send a HTTP request like the following template to query ALTO Endpoint Cost Service (ECS):
120 curl -X POST -H "Content-type: application/alto-endpointcostfilter+json" \
121 -d '{"cost-type":{"cost-mode":"numerical","cost-metric":"hopcount"},"endpoints":{"srcs":[<SOURCE_IP_LIST>],"dsts":[<DESTINATION_IP_LIST>]}}' \
122 http://alto.yale.edu:8181/alto/endpointcost/default