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

mranga's profile - activity

2018-07-12 23:36:29 -0800 received badge  Notable Question (source)
2018-07-12 23:36:29 -0800 received badge  Famous Question (source)
2018-01-18 02:03:30 -0800 received badge  Notable Question (source)
2017-11-07 13:26:19 -0800 received badge  Popular Question (source)
2017-10-24 05:27:11 -0800 received badge  Popular Question (source)
2017-10-24 05:24:38 -0800 received badge  Popular Question (source)
2017-10-06 15:09:22 -0800 asked a question Where to report BUG in L2-Switch ?

I set up the following configuration:

     <?xml version="1.0" encoding="UTF-8"?>
     <arp-handler-config xmlns="urn:opendaylight:packet:arp-handler-config">


     <?xml version="1.0" encoding="UTF-8"?>
      <l2switch-config xmlns="urn:opendaylight:l2switch:l2switch-config">

I connected with mininet using:

      mn --controller=remote

I observed the following error:

at org.opendaylight.genius.arputil.internal.ArpUtilImpl.getInterfaceName([280:org.opendaylight.genius.arputil-impl:0.2.1.Carbon]
at org.opendaylight.genius.arputil.internal.ArpUtilImpl.onPacketReceived([280:org.opendaylight.genius.arputil-impl:0.2.1.Carbon]
at org.opendaylight.yangtools.yang.binding.util.NotificationListenerInvoker.invokeNotification([85:org.opendaylight.mdsal.yang-binding:0.10.1.Carbon]
2017-10-06 12:57:00 -0800 commented answer Application composition : Changing table-ID for L2 Switch.

Even if I could set the table id importing l2switchconfig into the project will not work. Each bundle has its own classloader.

2017-10-06 10:03:02 -0800 asked a question L2-Switch : Per instance configuration.


I want to use L2-switch feature in my ACL application. If I configure l2-switch using the method outlined here:

that would imply ALL instances of L2-switch are identically configured. i.e. if the user installs another feature that wants the default configuration of L2-switch it would not be possible. Is there a way of instructing l2-switch to use a specific configuration on a specific instantiation. Ideally, if l2-switch can ask my application for its configuration and use that instead of reading a static file, that would be great.

Thus, I could, for example apply ACLs to a specific switch and not to another switch. For the switch on which I want to apply ACLs, I want l2-switch to put its flow rules in table 1. For the other switch, I want l2-switch to just use its default behavior. Is there any way to accomplish this with the current architecture of l2-switch?

In general I see this as being a problem for application composition. Static configuration applies for all instances. It would be nice if it were possible to supply a "configuration provider" to a component on startup rather than using a shared file system. Perhaps this is already possible through mdsal but I don't see how to do it. Some guidance would be great.



2017-10-06 06:24:30 -0800 received badge  Popular Question (source)
2017-10-06 05:24:39 -0800 asked a question How to delete all flows for testing.


I am building a service conposition based on L2switch + some code I am developing. I want to delete all flows during testing. However, it appears l2switch makes the flow rules persistent so that when I restart karaf and try to test the old flow rules are still there when I look at them in mininet. How can I clean out the old flow rules from persistent store?



2017-10-06 04:48:29 -0800 answered a question No Flows appear in OpenDaylight Node Tab

I used l2switch successfully with Carbon

Install odl-l2switch-all. ( as suggested by @VincentJahjah )

2017-10-05 13:25:56 -0800 asked a question Application composition : Changing table-ID for L2 Switch.

Hello, I want to write an ACL application which defaults to the behavior of l2 switch. For this I need two tables - one with the l2switch rules and one with my filter rules. However, l2switch wants to put its flow rules in table 0. How can I instruct l2switch to put its flow rules in another table ID (say table 1) ? I see that there are config files I can put here


To change the switch behavior and table location.

See :

Is there a way for my application to access the config datastore at provider initiaialization to directly update it rather than deal with this config file.



2017-10-03 03:43:23 -0800 received badge  Popular Question (source)
2017-10-03 03:09:29 -0800 received badge  Popular Question (source)
2017-10-02 07:59:03 -0800 received badge  Notable Question (source)
2017-09-29 10:59:47 -0800 commented question yangtool search path

I solved the problem by simply including the necessary packet-fields in the api/src/main/yang directory. Being a maven newbie, I just create the artifact and go from there.

2017-09-29 10:57:45 -0800 asked a question Data Structure and ID relationships.

I have struggled with figuring out how ODL is put together because I could find no clear documentation (other than scattered code fragments) on what the Identifiers are and how they map to different structures. If there is a data structure diagram of this kind available anywhere ( perhaps a UML diagram) that would go a great way towards easing my pain. Is there such documentation somewhere ?


2017-09-29 05:12:30 -0800 received badge  Popular Question (source)
2017-09-28 12:02:58 -0800 asked a question What is the openflow port?

When a packet arrives at my application, I get the node id from the notification and I get something like


Where x is a number 1,2,3 and so on. First question is what is x?

Second, consider openflow:1. If a second switch connects will I see openflow:2 ? Can these identifiers be used as keys ? (i.e. a given switch has a unique node ID string ).


2017-09-28 09:04:55 -0800 answered a question Correlating PacketIn with a switch InstanceId<FlowCapableNode>

OK So I found a way to do this in Carbon MDSAL. Here's what I did:

In my DataTreeChangeListner<flowcapablenode>

       public class WakeupOnFlowCapableNode implements DataTreeChangeListener<FlowCapableNode> {
      public void onDataTreeChanged(Collection<DataTreeModification<FlowCapableNode>> modifications) {


    for (DataTreeModification<FlowCapableNode> modification : modifications) {

               if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {

                           InstanceIdentifier<FlowCapableNode> ii = modification.getRootPath().getRootIdentifier();

            String nodeUri = ii.firstKeyOf(Node.class).getId().getValue();

                            // Now put the nodeUri into a map 
                            idMap.put(nodeUri, ii)


In my PacketIn listener I have

public void onPacketReceived(PacketReceived notification) {"onPacketReceived");
    NodeConnectorId nodeConnectorId = notification.getMatch().getInPort();
    // Get the node connector URI for the inbound packet.
    String nodeConnectorUri = nodeConnectorId.getValue();

The latter returns something like


I can strip off the last :1 and use the prefix to lookup the map entry in the DataTreeChangedListner.

Now I need to understand openflow URIs. What does openflow:1:1 mean?

2017-09-28 08:33:38 -0800 commented answer Correlating PacketIn with a switch InstanceId<FlowCapableNode>

Thanks. I am working with Carbon. I don't see EthernetPacketListener in Carbon MDSAL. Just PacketListener. Also, when I do packet.getIngress i see that it is marked Deprecated as is NodeId.

2017-09-27 13:05:22 -0800 asked a question Correlating PacketIn with a switch InstanceId<FlowCapableNode>

I have a listener for connecting switches that gets a notification on inbound Switch connections. I am able to record the InstanceIdentifier<flowcapablenode> when the switch connects and my DataTreeChange Listener gets called. I install a table miss flow and later a packet arrives.

If ODL is managing multiple switches, how can I differentiate one switch from another when I get PacketIn notification?

i.e. I want to correlate a given inbound packet with an InstanceIdentifier<flowcapablenode>.

How can I do this? thanks.

2017-09-27 13:00:03 -0800 received badge  Popular Question (source)
2017-09-27 12:59:05 -0800 received badge  Notable Question (source)
2017-09-18 05:39:24 -0800 received badge  Popular Question (source)
2017-09-17 18:33:19 -0800 asked a question yangtool search path


I am developing some code for Opendaylight Carbon where I need a more recent version of a yang data model than one that is included with the distribution. For example, I want to use ietf-packet-fields@2017-06-16.yang . How can I make the build pick up that version of the yang file instead of the one that is in my .m2 repository?



2017-09-16 17:23:37 -0800 received badge  Editor (source)
2017-09-16 17:14:41 -0800 answered a question Seeking sample Carbon code to install flow.

Finally got this to work. See the answer to my previous question.

2017-09-16 17:13:20 -0800 answered a question Flow not installed in switch.

After some hacking, I finally got it to work. Here's what I had to do:

In my provider I have :

    public SdnmudProvider(final DataBroker dataBroker, SalFlowService flowService,
        PacketProcessingService packetProcessingService, NotificationService notificationService,
        IMdsalApiManager mdsalApiManager) {
    this.dataBroker = dataBroker;
    this.flowService = flowService;
    this.packetProcessingService = packetProcessingService;
    this.notificationService = notificationService;
    this.mdsalApiManager = mdsalApiManager;


 private static InstanceIdentifier<?> getWildcardPath() {
      return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class);

         * Method called when the blueprint container is created.
public void init() {"SdnmudProvider Session Initiated");
    FlowCommitWrapper flowCommitWrapper = new FlowCommitWrapper(dataBroker, mdsalApiManager, flowService);
    SdnMudHandler sdnMudHandler = new SdnMudHandler(flowCommitWrapper);
    WakeupOnFlowCapableNode wakeupListener = new WakeupOnFlowCapableNode(sdnMudHandler);

    final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class)

    final DataTreeIdentifier<FlowCapableNode> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, getWildcardPath());

    this.dataTreeChangeListenerRegistration = this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier,

            new PacketInDispatcherImpl(sdnMudHandler, mdsalApiManager, flowCommitWrapper));"start() <--");


The key seems to be to generate the right DataTreeIdentifier.

Then I install the flow using the following when the switch appears.

      public void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) {

    ReadWriteTransaction modification = dataBrokerService.newReadWriteTransaction();
    final InstanceIdentifier<Flow> path1 = flowNodeIdent.child(Table.class, new TableKey(flow.getTableId()))
            .child(Flow.class, flow.getKey());
    modification.merge(LogicalDatastoreType.CONFIGURATION, path1,, true);
    CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
    Futures.addCallback(commitFuture, new FutureCallback<Void>() {
        public void onSuccess(Void aVoid) {
            LOG.debug("Write of flow on device succeeded.");

        public void onFailure(Throwable throwable) {
            LOG.error("Write of flow on device failed.", throwable);


Later when a packet arrives, I use this method to install other flows.

A bit verbose but it works (for now).

2017-09-16 15:33:39 -0800 commented question Flow not installed in switch.

@sunilkumarms How can I check the config datastore ? I am just getting into this so any pointers appreciated. Thank you.

2017-09-16 04:43:34 -0800 received badge  Popular Question (source)
2017-09-15 11:20:44 -0800 asked a question Seeking sample Carbon code to install flow.


Any pointers to some minimal sample code to install a flow in a switch. I'd love to see a complete skeletal sample. Any pointers would be appreciated.

Thank you


2017-09-14 11:45:12 -0800 asked a question Flow not installed in switch.


I use the following code snippet to install a flow in a switch:

  FlowEntityBuilder flowEntityBuilder = new FlowEntityBuilder();

MatchInfo matchInfo = new MatchEthernetSource(macAddress);

InstructionInfo instructionInfo = new InstructionGotoTable(tableId);
FlowEntity flowEntity = flowEntityBuilder.addInstructionInfoList(instructionInfo).addMatchInfoList(matchInfo).build();

I connect with mininet but when I go to look at the flow, I do not see anything. No execptions thrown. How can I debug such problems? Any pointers appreciated. Thanks

2017-09-13 08:45:01 -0800 answered a question Extracting MAC address of packets

Posting here in case somebody finds it useful.

See answer from Karthik Prasad.

2017-09-12 09:56:53 -0800 received badge  Enthusiast
2017-09-11 14:58:30 -0800 asked a question Extracting MAC address of packets


Are there utilities available in ODL for packet manpulation. I'd like to extract various things from the data packet. Are there any utility classes available for that?

I've seen some code in the openflow plugin example that uses offsets into the data packet to get the MAC etc. but I'd prefer to use a standard utility package for this if available.

Thank you

2017-09-10 14:06:16 -0800 asked a question Behavior on restart


I am implementing ACLs using ODL and this is my first experience with this. Config data is stored in MDSAL.

When the container restarts does the listener get DataTreeChanged Notifications for the data in the config data store?

Thank you,


2017-09-09 12:50:03 -0800 asked a question How to get the Datapath ID when switch connects?

Note: Also posted on StackOverflow (please skip if you already read this there).

I am attempting to build an SDN app with opendaylight. I use the Carbon (latest) release and the openflow plugin. I am trying to use the "genius" utility package as it has a lot of support for installing flows and such. I expect multiple switches to connect so I have to specify the "datapath ID" (dpid) in installing the flow. How do I determine the dpid when the switch connects? I can get the Node ID but how to go from there to a DPID?

Thank you,


2017-09-06 15:18:25 -0800 asked a question Updating examples to Carbon

Sorry but this is going to be a bit of a rant...

It would be terrific if there were a few "how to" type docs with the latest ODL version (carbon) that just runs "out of the box". I find the learning curve to be needlessly steep. Many learning resources on opendaylight project are out of date. A newbie like me can find the going daunting.

Can anybody point to a small (but meaningful) "step by step" programmer guide or set of code skeletons for the latest version that the project that is the best place to get started? I find several good pages that are out of sync.

Understood that this is open source. I can contribute. How can I update wiki?



2017-09-05 19:33:57 -0800 answered a question opeflow plugin: How to get notification when switch connects

Actually this does work as advertised. I Had previously made a mistake. I have to build the project from the root.

   mvn clean install

Does it. I would like to know why I get MULTIPLE notifications when mininet connects.

To get rid of the MULTIPLE notifications issue :

     final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class)

    //final DataTreeIdentifier<Table> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL,
    //  instanceIdentifier);
    final DataTreeIdentifier<FlowCapableNode> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, getWildcardPath());

    this.dataTreeChangeListenerRegistration = this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier,
2017-09-05 12:14:25 -0800 asked a question opeflow plugin: How to get notification when switch connects


I am writing my first ODL application with the openflow plugin. I am working with carbon. I want to get a notification when a switch connects. I am trying the following code in the provider :

               WakeupOnNode wakeupListener = new WakeupOnNode();
    // final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.create(Node.class).augmentation(FlowCapableNode.class).child(Table.class);

    final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class).

    final DataTreeIdentifier<Table> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);

    this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier, wakeupListener);

But alas I see no notification appear in my WakeupOnNode listener.

( I took this code from the openflowplugin samples.) Where can I find some documentation on how to do this?

Thank you in advance for your help.