Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


How does request routing works

asked 2014-05-20 07:53:18 -0700

shoaib gravatar image

How does request routing works on a per node/host basis for example

) How is a network element that does not support OF managed identified/operated upon

2) Nodes could be running various OS's, how is any node operation directed to the correct plugin.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-20 08:31:09 -0700

Tony Tkacik gravatar image

updated 2014-05-20 09:44:47 -0700

Number 1 - Depends on Protocol and Southbound plugin, MD-SAL does not have any enforcement for this, since this is pure functionality of southbound protocols.

Number 2 MD-SAL only provides capabilities for request-routing based on YANG model and identifier of target which is supplied by consumer when invoking request.

MD-SAL RPC Request Routing explained (detailed)

MD-SAL request routing is done purely on registration-basis southbound plugins

So its up to model creator to define their routing model and their routing distinguisher.

In flow capable use case this is done by using Instance Identifier (URI to device representation in MD-SAL datastore) in rpc messages and Openflow plugin explicitly register itself as implementaiton for particular path.

E.g. YANG Model (Opendaylight Inventory):

Declaration of routing context type

  38     identity node-context {
  39         description "Identity used to mark node context";
  40     }

line 39, declares identity named node-context, which is used as marker for node-based routing and is used at other places to reference that routing type.

Declaration of inventory model / valid routing paths

  82     /** Base structure **/
  83     container nodes {
  84         list node {
  85             key "id";
  86             ext:context-instance "node-context";
  88             uses node;
  89         }
  90     }

Line 82 to 85 defines basic structure of inventory data store - which means we have top level container nodes which contains multiple node identified by id.
Line 86: Marks parent (node) as valid route distinguisher in node-context based routing.

So far we declared new routing type for MD-SAL and valid routing paths (eg. nodes/node)

Declaration of Routed RPC

To declare RPC to be routed based on node-context we need to add leaf which will hold node-context value to RPC input

  01     rpc example-routed-rpc  {
  02          input {
  03               leaf node {
  04                   ext:context-reference "node-context";
  05                   type "instance-identifier";
  06               }
  07          }
  08     }

line 1: we define example-routed-rpc line 2,3,5: we define input for that rpc, that it contains leaf node which should contain route distinguisher. line 4: we are using YANG extension to mark that leaf as container for route distinguisher.

Based on this information MD-SAL is able to construct a routing for that RPC.

Registering implementations / Invoking rpcs

Implementations of that RPC (southbound plugins) will specify instance-identifier for node for which they want to provide this implementation during registration and consumers are required to specify that instance-identifier (identifier of node) when invoking RPC.

Simple code which showcases that for add-flow via Binding-Aware APIs ( ):

  61             @Override
  62             public void onSessionInitiated(ProviderContext session) {
  63                 assertNotNull(session);
  64                 firstReg = session.addRoutedRpcImplementation(SalFlowService.class, salFlowService1);
  65             }

Line 64: We are registering salFlowService1 as implementation of SalFlowService RPC

  107         NodeRef nodeOne = createNodeRef("foo:node:1");
  109         /**
  110          * Provider 1 registers path of node 1
  111          */
  112         firstReg.registerPath(NodeContext.class, nodeOne);

Line 107: We are creating NodeRef (encapsulation of InstanceIdentifier) for "foo:node:1". Line 112: We register salFlowService1 as implementation for nodeOne.

The salFlowService1 will be executed only for RPCs which contains Instance Identifeir for foo:node:1.

edit flag offensive delete publish link more


We have put together a sample app that I believe illustrates some of this here:

Devin Avery ( 2014-05-20 13:35:38 -0700 )edit

answered 2014-05-20 10:13:02 -0700

To add to what Tony has explained, I documented my understanding on how MD-SAL identifies to which southbound plugin request needs to be routed here:

Hope that helps as well.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools



Asked: 2014-05-20 07:53:18 -0700

Seen: 1,173 times

Last updated: May 20 '14