Reference and comments on doing ping MD-SAL in OpenDayLight.

As part of digging deeper into OpenDayLight, I spent some time looking at the MD-SAL piece. My original plan was to provide tutorials on that, but folks have already been doing a wonderful job on that. See here for links on MD-SAL tutorials.

So what I did instead, was to play with an example that is small and simple: the ping tutorial:

Since ping is just a tutorial, the code is not checked into the controller codebase. However, it was made to be embedded in the controller repo. So, in case you feel lazy and don't feel like typing, you can simply pull it off of gerrit, after cloning the controller repo.

# ref link:

cd controller.git
git fetch refs/changes/91/6991/2 && git checkout FETCH_HEAD

After finished with that tutorial, I played a little more with the use of the Future<> RPC used in MD-SAL. I wanted to make the ping code able to continuously probe multiple destinations. So I enhanced the code to be async by doing this:

# ref link:    (Patch set 2)

cd controller.git
git fetch refs/changes/92/6992/2 && git checkout FETCH_HEAD

# Examples using async ping (based on patch set 2):
for x in ;
   do curl --user "admin":"admin" -X PUT http://localhost:8080/controller/nb/v2/ping/async/start/${x} ; echo ; done
while : ; do for x in ;
   do curl --user "admin":"admin" -X PUT http://localhost:8080/controller/nb/v2/ping/async/get/${x} ; echo ; done ; sleep 2 ; done
for x in ;
   do curl --user "admin":"admin" -X PUT http://localhost:8080/controller/nb/v2/ping/async/stop/${x} ; echo ; done

After a few comments from Devin and Rob, I made my changes simpler by removing the need for the extra thread and the concurrent map. That removed the background capability of the ping implementation. But simpler is always better, especially in a tutorial arena. Those simplifications are stored as the latest patch set:

# ref link:

cd controller.git
git fetch refs/changes/92/6992/4 && git checkout FETCH_HEAD

A few good links for learning/using MD-SAL in ODL:


comments powered by Disqus