summaryrefslogtreecommitdiffstats
path: root/NOTES.txt
blob: 2c639db3384afe85dca60aefcbace2033d4fd495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
                        ODL Honeycomb Development Notes
                        ===============================
Links
=====
1) Ed's ODL Summit 2015 Honeycomb Application Development Tuturial
https://wiki.opendaylight.org/view/Controller_Core_Functionality_Tutorials:Application_Development_Tutorial
https://github.com/flavio-fernandes/odlHelloTutorial

2) Maven
http://maven.apache.org/install.html
https://maven.apache.org/guides/mini/guide-proxies.html
https://maven.apache.org/ref/3.3.3/maven-settings/settings.html
https://maven.apache.org/guides/mini/guide-configuring-maven.html
http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

3) OpenDayLight
https://wiki.opendaylight.org/view/GIT_Cheat_Sheet
https://www.opendaylight.org/project-lifecycle-releases
https://wiki.opendaylight.org/view/CrossProject:Integration_Group:System_Test:Step_by_Step_Guide
https://wiki.opendaylight.org/view/Simultaneous_Release:Beryllium_Release_Plan
https://wiki.opendaylight.org/view/OpenDaylight_Presentations:Main
https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping
https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Concepts
https://wiki.opendaylight.org/view/OpenDaylight_Controller:Netconf:Design
https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Configuring_Netconf_logging
https://wiki.opendaylight.org/view/OpenDaylight_Controller:Lithium:Netconf:Integration_Test
https://wiki.opendaylight.org/view/Controller_Core_Functionality_Tutorials:Tutorials:Netconf_Mount#Testing_against_ODL_itself_.28MD-SAL_netconf_northbound_loopback_mount.29
https://github.com/opendaylight/coretutorials
https://github.com/opendaylight/mdsal/tree/master/model  // IETF Yang Models
https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-api/pom.xml#L78  // <dependency> for 2013-07-15 version of ietf-yang-types
https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-api/pom.xml#L54  // <dependencyManagement><dependency> for mdsal.model
// Data Change Listener examples
https://github.com/opendaylight/vtn/blob/master/manager/neutron/src/main/java/org/opendaylight/vtn/manager/neutron/NeutronNetworkChangeListener.java
https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListener.java
https://github.com/opendaylight/vpnservice/blob/078ae023c9cceb14aaadea10c81a5f1d90f47789/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfaceManager.java
http://karaf.apache.org/
https://karaf.apache.org/manual/latest-2.2.x/developers-guide/features-maven-plugin-generate.html

4) Java / JNI
http://stackoverflow.com/questions/3949260/java-class-isinstance-vs-class-isassignablefrom
http://stackoverflow.com/questions/7275844/interface-as-a-type-in-java
http://www.xyzws.com/javafaq/what-does-classforname-method-do/17
https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html
https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#type_signatures

5) Misc
http://www.w3schools.com/tags/ref_urlencode.asp

Installation/Environment
========================
1) Packages to install
   apache-maven-3.3.3 (https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04)
   openjdk-7-jdk
   libssl-dev
   eclipse

2) Environment Variables:
   export ODL_USERNAME=dwallace
   export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.3
   export PATH=/usr/local/apache-maven/apache-maven-3.3.3/bin:$PATH
   export MAVEN_OPTS='-Xmx4096m -XX:MaxPermSize=2048m' 
   export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
   export PATH=$JAVA_HOME/bin:$PATH

Building/Installing ODL
=======================

How-To's
========
1) Build ODL
   - cd honeycomb/
   - mvn clean install

4) Start up ODL
   - cd honeycomb/v3po/karaf/target/assembly/bin
   - sudo bash
   - ./karaf
   Note: use "./karaf debug" to enable remote debugging.
   Note: DON'T USE CTRL-D to quit.  That fails to clean up gracefully.
         Best practice is to use "shutdown -f".
   Note: Building will run karaf which will fail if another instance
         is already running.  It also touches/creates files in
         v3po/karaf... See #5 below for clean up recipe.

5) Testing with YANGUI
   - DOESN'T WORK WITH FIREFOX! :-(
   - Install google chrome.
   - Start chrome and enter the URL: 
     http://localhost:8080/index.html#/yangui/index
   - Select "Yang UI" on left region
   - Expand (click on '+') v3po rev.2015.01.05
   - Expand (click on '+') operations
   - Enter text ("Dave") in textbox next to "me"
   - Select "Send"
   - Results show up in "version" textbox:
     "Yo Dave! VPP interface list is [GigabitEthernet8/0/1: 5, 
      TenGigabitEthernet86/0/0: 6, local0: 0]!"

6) Pre-build clean up
   - Running karaf as root touches files which will break the build.
     Do the following to clean up before building:

     shutdown -f
     sudo chown -R dwallace:floppy /scratch/dwallace/honeycomb-vpp/v3po/karaf
     
7) Adding YANG models
   NOTE: pom.xml dependency versions are managed via
         </dependencyManagement></dependency> specifications.  When including
         standard yang models (e.g. from org.opendaylight.mdsal.model), there
         needs to be a <ManagedDependency> depencency defined to tell
         maven what version to download into the local repo.  This isw
         why each dependency  in the </Dependencies> section does not
         contain version information.        
   - Add a dependency in .../honeycomb/v3po/api/pom.xml
   - Add a dependency in .../honeycomb/v3po/features/pom.xml
   - Add a bundle in ../honeycomb/v3po/features/pom.xml
     NOTE: Yangtools don't unravel nested import statements, so all
           imported yang models referenced in v3po.yang must be
           explicitly imported (e.g. ietf-interfaces)

8) Useful CURL commands for debugging netconf mounts
# show mounted nodes
curl -su admin:admin http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes?prettyPrint=true;echo

# show node configuration
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/<NODE>?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/controller-config?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/vpp1?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/vpp2?prettyPrint=true;echo

# show node connection status
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/<NODE>?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/controller-config?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp1?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp2?prettyPrint=true;echo

# show mount config modules <response in json format>
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/<NODE>/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo

# show mount config modules <response in xml format>
curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/<NODE>/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo

# show mount operational modules <response in json format>
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/<NODE>/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo
curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo

9) Clean up ODL cache/state
cd /scratch/dwallace/honeycomb-demo/r2demo/karaf/target/assembly/bin
sudo rm -rf ../data/*
sudo rm -f ../etc/opendaylight/current/*