Ask Your Question

Adding Flows to push MPLS via RESTCONF

asked 2016-08-02 12:53:35 -0700

bjammal gravatar image

Hello All,

I'm a beginner in SDN and ODL and I am trying to add OpenFlow flows to OVS switches with mininet but the flows are not being reflected when I examine the packets in wireshark. Here's my scenarios.

  • 3 switches with a linear topology and 3 hosts connected: sudo mn --topo linear --controller remote --switch ovsk,protocols=OpenFlow13
  • ODL controller running on the same VM as mininet

What I would like to do is to configure MPLS manually. For example, as a starting point I'm trying to add MPLS labels for packet going from Host1 to Host3. and I'm trying to accomplish this using RESTCONF API and I'm getting status code 200 (OK) for the requests I send. Below are the XML body of the RESTCONF requests.

  • For IP packets incoming on port 1 of Switch1, to push MPLS label with a value of 12 and forward it out of port 2:

<flow xmlns="urn:opendaylight:flow:inventory"> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <push-mpls-action>0x8847</push-mpls-action> </action> <action> <order>1</order> <set-field> <protocol-match-fields> <mpls-label>12</mpls-label> </protocol-match-fields> </set-field> </action> <action> <order>2</order> <output-action> <output-node-connector>2</output-node-connector> </output-action> </action> </apply-actions> </instruction> </instructions> <table_id>0</table_id> <id>100</id> <match> <ethernet-match> <ethernet-type> <type>0x800</type> </ethernet-type> </ethernet-match> <in-port>1</in-port> </match> <hard-timeout>0</hard-timeout> <cookie>10</cookie> <installhw>true</installhw> <idle-timeout>0</idle-timeout> <flow-name>flow-action-push-mpls</flow-name> <priority>220</priority></flow>

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

Headers = {'content-type': 'application/xml','accept': 'application/json'}

Request type = PUT

Authentication = Basic Auth

Then when I inspect packets with wireshark on port 2 of switch 1, I can't see the MPLS header. Am I missing anything?

PS. I installed mininet using package manager and not using the prebuilt VM.

edit retag flag offensive close merge delete


I checked the flow table in the switch and didn't see the flow entry. /var/logs/openvswitch/ovs-vswitchd.log shows "connection failed (connection refused)" error! what could be the reason that the switch is not able to connect to the controller?

bjammal ( 2016-08-02 14:53:32 -0700 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-08-08 03:38:20 -0700

bjammal gravatar image

I found out that the OpenvSwitch was not running on my host! I had to restart the service in /etc/init.d/openvswitch-switch. I checked the status using $sudo /etc/init.d/openvswitch-switch status, normally it should say that openvswitch is running but it wasn't the case. To restart the service I did sudo /etc/init.d/openvswitch-switch restart

After this, I was able to connect between the switches and the controller. But my flows were not pushed from the controller to the switches for a reason that I am still not sure what is it, but I guess that I had some missing xml tags, and it was fixed when I referred to the ODL end-to-end flows example, took the example i'm interested in, and customized it to my needs.

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


Asked: 2016-08-02 12:53:35 -0700

Seen: 200 times

Last updated: Aug 08 '16