Ask Your Question
0

Flows added but packets not forwarded

asked 2015-09-08 08:31:17 -0700

headamage gravatar image

updated 2015-09-08 08:42:15 -0700

I am using the Lithium SR-1 and Mininet 2.2.0b1 I have been trying for weeks now to understand how the various features of the controler work but the documentation is not helping at all. What I want to do is simple: I have one switch with 2 nodes in mininet. I have set it up so that the switch communicates with ODL and shows up in the topology. If i enable the l2switch then packets are forwarded automatically and the nodes can ping eachother in mininet. I want to do the same thing manually without using the l2switch by setting up static flows between the two nodes. I have used Postman and successfully added two flows as follows:

<table 
xmlns="urn:opendaylight:flow:inventory">
<id>0</id>
<flow>
    <id>2</id>
    <cookie>4</cookie>
    <barrier>false</barrier>
    <idle-timeout>34</idle-timeout>
    <priority>2</priority>
    <table_id>0</table_id>
    <match>
        <ethernet-match>
            <ethernet-destination>
                <address>00:00:00:00:00:01</address>
            </ethernet-destination>
            <ethernet-type>
                <type>45</type>
            </ethernet-type>
            <ethernet-source>
                <address>00:00:00:00:00:02</address>
            </ethernet-source>
        </ethernet-match>
    </match>
    <flow-name>macflow2</flow-name>
    <hard-timeout>12</hard-timeout>
    <installHw>true</installHw>
    <cookie_mask>255</cookie_mask>
    <strict>false</strict>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <dec-mpls-ttl></dec-mpls-ttl>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
</flow>
<flow>
    <id>1</id>
    <cookie>4</cookie>
    <barrier>false</barrier>
    <idle-timeout>34</idle-timeout>
    <priority>2</priority>
    <table_id>0</table_id>
    <match>
        <ethernet-match>
            <ethernet-destination>
                <address>00:00:00:00:00:02</address>
            </ethernet-destination>
            <ethernet-type>
                <type>45</type>
            </ethernet-type>
            <ethernet-source>
                <address>00:00:00:00:00:01</address>
            </ethernet-source>
        </ethernet-match>
    </match>
    <flow-name>macflow1</flow-name>
    <hard-timeout>12</hard-timeout>
    <installHw>true</installHw>
    <cookie_mask>255</cookie_mask>
    <strict>false</strict>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <dec-mpls-ttl></dec-mpls-ttl>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
</flow>

I can successfully query ODL at http://192.168.137.175:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0 and at this point I get the config posted above. Nodes in Mininet don't ping eachother. I also have no idea where and how to pull the above information from Yang UI. There is nothing listed in the flows in Dlux. The following features are installed: aaa-authz, odl-dlux-core, odl-dlux-node, odl-dlux-yangui, odl-dlux-yangvisualizer, odl-openflowplugin-all, odl-restconf-all, odl-mdsal-apidocs, odl-adsal-all, odl-adsal-northbound

Can anyone help me please?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-09-08 20:20:04 -0700

Mandeep gravatar image

updated 2015-09-09 07:39:03 -0700

I am adding following flow to my switches and able to ping between hosts without l2switch:

Note: Just change 'localhost and/or flowid if needed

URL: "http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/100

Authentication: "admin/admin"

Content-Type: "application/json"

Payload:

{ 
  "flow": 
    { 
      "instructions": 
        {
          "instruction": 
          { 
            "order": "0", 
            "apply-actions": 
              { 
                "action": 
                  { 
                    "order": "0", 
                    "output-action": 
                      { 
                        "output-node-connector": "NORMAL" 
                      } 
                  } 
              } 
          } 
        }, 
        "table_id": "0", 
        "id": "100", 
        "cookie_mask": "10", 
        "installHw": "false", 
        "hard-timeout": "0", 
        "cookie": "10", 
        "idle-timeout": "0", 
        "flow-name": "FloodFlow", 
        "priority": "100", 
        "barrier": "false" 
    } 
}
edit flag offensive delete publish link more

Comments

thanks for this. it works now except that it should be "cookie_mask" and "table_id". Hopefully this will help someone else in the future. Can you tell me where to find the flow in Yang UI? I am looking at the inventory and it doesn't show up.

headamage ( 2015-09-09 05:23:59 -0700 )edit

Can you share what url you are using to fetch flows?

Mandeep ( 2015-09-09 07:38:33 -0700 )edit

http://192.168.137.175:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/ this is the URL i use. Is it possible to set a match rule so that only packets from a specific source IP are forwarded? I am trying to use the match rules but again, it registers the flows but no luck.

headamage ( 2015-09-09 10:30:41 -0700 )edit

in YANG UI i don't know where exactly to look to find the flows. Is it in the inventory inside each node?

headamage ( 2015-09-09 10:31:33 -0700 )edit

I think you can not see flows from YANG UI. If possible then I am not aware of. You can use Restconf on operational data store to get that.

Mandeep ( 2015-09-10 05:32:07 -0700 )edit
0

answered 2015-09-08 22:24:32 -0700

jamoluhrsen gravatar image

Hi there.

The problem with the original flows you are trying, headamage, is in a few places.

  1. you are using ethernet addresses to match on based on the mininet switch assigned addresses for the switches, and those. you want to match on the mac addresses that would come from your hosts instead.

  2. you have an ethertype of 45 (decimal) which is 0x2D and not something I recognize. if you just want to match on basic ip traffic, try an ethertype of 0x0800 (so, 2048 decimal)

  3. your hard and idle timeouts (12 and 34) will make your flows age out of your switch quick enough to be annoying when trying to get things right.

  4. your action list is asking the switch to decrement the mpls ttl value, which I don't think you are worried about.

There may be more things to consider there as well.

Mandeep's flow above is not giving any match conditions, so all packets will match. The action there is to forward NORMAL which is a special rule telling the switch to forward the traffic as it would have normally. If this is working, then I guess the underlying switch has the logic to forward the traffic to the destination.

hope it helps.

edit flag offensive delete publish link more

Comments

Yes, my flow has empty match to process every packet. My setup has OVS created via Mininet. Even if I use forward LOCAL it works fine. Not sure, but I guess it may have underlying intelligence to work as expected.

Mandeep ( 2015-09-09 00:06:18 -0700 )edit

Thanks for the pointers. Funny enough the config is copy/paste from the odl wiki and they had a 45 for ethertype. it's just extremely frustrating because there are no sources and no tutorials for beginners that work. Where can i find the complete REST API for ODL to learn what the settings mean?

headamage ( 2015-09-10 05:39:05 -0700 )edit

this link might help a little bit: https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:End_to_End_Flows

jamoluhrsen ( 2015-09-10 08:35:05 -0700 )edit

ODL's learning curve is not the easiest, I agree. ODL is made up of many projects (40+) and each will have their own REST API's, user guides, etc. Here is the openflowplugin wiki page: https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main You can link to the user guide from there.

jamoluhrsen ( 2015-09-10 08:36:31 -0700 )edit

Not really. That is exactly where I got the example that didn't work. Documentation for ODL is a joke. Thanks for the reply though. I just need something like this :https://floodlight.atlassian.net/wiki/pages/viewpage.action?pageId=1343518

headamage ( 2015-09-10 08:37:34 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-09-08 08:31:17 -0700

Seen: 454 times

Last updated: Sep 09 '15