[OPNFLWPLUG-664] Failed to add flows with actions ICMP code and type in OF1.3 Created: 29/Mar/16  Updated: 27/Sep/21  Resolved: 18/Jul/16

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Karthik Sivasamy Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive OF13_FLOW_ICMP.zip     Zip Archive of_karaf_logs.zip    
External issue ID: 5618

 Description   

I have been testing with Beryllium SR1 distribution for VTN project, and faced issue while adding flows with action ICMP code and type for OF1.3.

That is after adding flows when i verify using dump-flows in mininet actions mod_tp_src and mod_tp_dst are not displayed in OF1.3. But for OF1.0 mod_tp_src and mod_tp_dst are shown in dump-flows.

To cross verify, i have tested the above scenario with Openflowplugin Restconf command and faced same issue. Below are the steps i have followed,

1) Configured mininet with sudo mn --topo tree,2 --controller remote,ip=10.106.138.117 --switch ovsk,protocols=OpenFlow10

2) Add flows with action set-tp-dst-action and set-tp-src-action using below command, and response code is success

curl -v --user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/134 -d '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <strict>false</strict> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <set-tp-dst-action> <port>109</port> </set-tp-dst-action> </action> <action> <order>1</order> <set-tp-src-action> <port>108</port> </set-tp-src-action> </action> <action> <output-action> <output-node-connector>3</output-node-connector> </output-action> <order>2</order> </action> </apply-actions> </instruction> </instructions> <table_id>2</table_id> <id>134</id> <cookie_mask>255</cookie_mask> <match> <ethernet-match> <ethernet-type> <type>0x800</type> </ethernet-type> <ethernet-destination> <address>ff:ff:29:01:19:61</address> </ethernet-destination> <ethernet-source> <address>00:00:00:11:23:ae</address> </ethernet-source> </ethernet-match> <ipv4-source>17.0.0.0/8</ipv4-source> <ipv4-destination>172.168.0.0/16</ipv4-destination> <ip-match> <ip-protocol>1</ip-protocol> </ip-match> <in-port>0</in-port> </match> <cookie>11</cookie> <flow-name>FooXf11</flow-name> <priority>11</priority> </flow>'

< HTTP/1.1 200 OK
< Set-Cookie: JSESSIONID=lw27td6lxerhh9af3fnhneta;Path=/restconf
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Set-Cookie: rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Tue, 29-Mar-2016 04:32:56 GMT
< Content-Length: 0

3) Checked flowentries in mininet for OF1.0 and actions mod_tp_src and mod_tp_dst are applied in node.
mininet> dpctl dump-flows -OOpenFlow10

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0xb, duration=26.914s, table=0, n_packets=0, n_bytes=0, idle_age=26, priority=11,icmp,in_port=0,dl_src=00:00:00:11:23:ae,dl_dst=ff:ff:29:01:19:61,nw_src=17.0.0.0/8,nw_dst=172.168.0.0/16,nw_tos=108,icmp_type=6,icmp_code=3 actions=mod_tp_dst:109,mod_tp_src:108,output:3
      • s2 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
      • s3 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):

I have followed the same above scenario in OF1.3, failed to display flows in mininet.

1)1) Configured mininet with sudo mn --topo tree,2 --controller remote,ip=10.106.138.117 --switch ovsk,protocols=OpenFlow13

2) Add flows with action set-tp-dst-action and set-tp-src-action using below command, and response code is success. Used the same command which i tried for OF1.0, which is above.

3) Checked flowentries in mininet for OF1.3 and but flow is not created. Output is as below,
mininet> dpctl dump-flows -OOpenFlow10

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
      • s2 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
      • s3 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        mininet>

I would like to know is there any issues in adding flows with actions ICMP code and type. Since the scenario which is working for OF1.0.

For your information i have attached karaf.log with TRACE enabled for Openflowplugin.

Attached with of_karaf_log.zip file.



 Comments   
Comment by Karthik Sivasamy [ 29/Mar/16 ]

Attachment of_karaf_logs.zip has been added with description: Trace Enabled logs for Openflowplugin

Comment by Anil Vishnoi [ 30/Mar/16 ]

set-tp-src and set-tp-dst fields are specific to openflow 1.0 switches, these actions were removed from openflow 1.3 spec. For openflow 1.3, please use set-field actions to set any packet header value.

Comment by Karthik Sivasamy [ 30/Mar/16 ]

Hi Anil,

As you said i have used set-field for icmpv4 actions. Below is the command which i have tried,

curl -v --user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:3/table/2/flow/256 -d '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <strict>false</strict> <flow-name>set-field-tcp-src</flow-name> <id>256</id> <cookie_mask>255</cookie_mask> <cookie>101</cookie> <table_id>2</table_id> <priority>2</priority> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <set-field> <icmpv4-match> <icmpv4-type>3</icmpv4-type> <icmpv4-code>1</icmpv4-code> </icmpv4-match> </set-field> </action> </apply-actions> </instruction> </instructions> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> <ipv4-source>10.0.0.1/32</ipv4-source> <ipv4-destination>10.0.0.3/32</ipv4-destination> <ip-match> <ip-protocol>1</ip-protocol> </ip-match> </match> </flow>'

The above command to add flows executed successfully with return code 200.

In Dumpflow i have checked flows which are not displayed
mininet> dpctl dump-flows -OOpenFlow13

      • s1 ------------------------------------------------------------------------
        OFPST_FLOW reply (OF1.3) (xid=0x2):
      • s2 ------------------------------------------------------------------------
        OFPST_FLOW reply (OF1.3) (xid=0x2):
      • s3 ------------------------------------------------------------------------
        OFPST_FLOW reply (OF1.3) (xid=0x2):
        mininet>

Note: Using OVS version 2.3.1

I have captured packets for port 6633 in controller side, and analysed in pcap file in wireshark tool.

Here i have Attahced pcap file --> icmp_of13.pcap

In attached icmp_of13.pcap file Line 401 which is OFPT_FLOW_MOD ,
In OFPT_FLOW_MOD -> openflow 1.3 -> Insructions -> Action -> 0xM field, in which i can see only ICMP Type field but ICMP code is not present.

In attahced icmp_of13.pcap file Line 402 OFPT_ERROR,
In openflow 1.3 below are displayed.
TYPE: OFPET_BAD_ACTION (2)
CODE: OFPBAC_BAD_SET_ARGUMENT(15)

The same above error which i observed in pcap file when i installed flows with ICMP actions using VTN Manager RESTCONF.

So, please clarify my query below.
a) The command which i configured with set-field for ICMP code and type formation are correct or not ? If it is wrong please provide me a correct steps to add flows with ICMP code and type.

b) If the command is correct, is it OFplugin BUG ?

Kindly correct me if i missed anything in testing.

In Karaf log i have observed below error messages,

2016-03-30 15:59:01,728 | TRACE | OFmsgHarvester-0 | QueueKeeperHarvester | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | messageHarvester is about to make a starve sleep
2016-03-30 15:59:01,728 | DEBUG | OFmsgProcessor-1 | TicketProcessorFactoryImpl | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | message received, type: ErrorMessage
2016-03-30 15:59:01,728 | TRACE | OFmsgProcessor-1 | TicketProcessorFactoryImpl | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | translating ticket: ErrorMessage, ticket: 959291382
2016-03-30 15:59:01,728 | DEBUG | OFmsgProcessor-1 | TicketProcessorFactoryImpl | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | translatorKey: 4 + org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage
2016-03-30 15:59:01,729 | DEBUG | OFmsgProcessor-1 | AbstractErrorTranslator | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | Error Message received: type=2[BADACTION], code=15[BADSETARGUMENT], data=[04 0e 00 a0 00 00 02 6f 00 00 00 00 00 00 00 0b 00 00 00 00 00 00 00 ff 02 00 00 00 00 00 00 0b ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 01 00 43 80 00 00 04 00 00 00 00 80 00 06 06]
2016-03-30 15:59:01,729 | TRACE | OFmsgProcessor-1 | TicketProcessorFactoryImpl | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | translator: org.opendaylight.openflowplugin.openflow.md.core.translator.ErrorTranslator@4784b4bd elapsed time 561063 ns
2016-03-30 15:59:01,729 | DEBUG | OFmsgProcessor-1 | TicketProcessorFactoryImpl | 261 - org.opendaylight.openflowplugin - 0.2.1.Beryllium-SR1 | message processing done (type: ErrorMessage, ticket: 959291382)

Comment by Karthik Sivasamy [ 31/Mar/16 ]

Anil,

I have modified the OFPlugin resctconf command by having two different action filed for ICMP code and type. Now i can see in pcap file two actions which contains action Field:
OFPXMT_OFB_ICMPV4_TYPE (19)
OFPXMT_OFB_ICMPV4_CODE (20).
But still same OFTP_ERROR for the flows created i.e.,(Type: OFPET_BAD_ACTION (2) and Code: OFPBAC_BAD_SET_ARGUMENT (15))

Below are the command which i tried to have two different action field for ICMP type and code.

curl -v --user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:3/table/2/flow/256 -d '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <strict>false</strict> <flow-name>set-field-tcp-src</flow-name> <id>256</id> <cookie_mask>255</cookie_mask> <cookie>101</cookie> <table_id>2</table_id> <priority>2</priority> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <set-field> <icmpv4-match> <icmpv4-type>3</icmpv4-type> </icmpv4-match> </set-field> </action> <action> <order>1</order> <set-field> <icmpv4-match> <icmpv4-code>1</icmpv4-code> </icmpv4-match> </set-field> </action> </apply-actions> </instruction> </instructions> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> <ipv4-source>10.0.0.1/32</ipv4-source> <ipv4-destination>10.0.0.3/32</ipv4-destination> <ip-match> <ip-protocol>1</ip-protocol> </ip-match> </match> </flow>'

The same BAD_ACTION and BAD_SET_ARGUMENT error we had seen in pcap file while testing using VTN Manger restconf to add ICMP codee and type. But in VTN manager karaf log we didnt see any issue regarding adding flows. So to cross check we tested using OFPlugin to know the issues.

I would like to know the issue is in "OVS" or openflowplugin. please let me know what is the actual reason for the failure.

Attached karaf logs and pcap file in OF13_FLOW_ICMP.zip

Comment by Karthik Sivasamy [ 31/Mar/16 ]

Attached zip file OF13_FLOW_ICMP.zip which has,

OF_ICMP.pcap --> pcap file which i have captured while using OpenFlowPlugin restconf command to test with ICMP code and type.

VTN_ICMP.pcap --> pcap file which i have captured while using VTN Manager restconf command to test with ICMP code and type.

Trace enabled karaf logs. In which i have observed error message in karaf.log.3.

Comment by Karthik Sivasamy [ 31/Mar/16 ]

Attachment OF13_FLOW_ICMP.zip has been added with description: OFPlugin and VTN pcap file and Karaf logs

Comment by Karthik Sivasamy [ 14/Jul/16 ]

Bug Verification :
==================

Tested with Beryllium SR2 dsitro to check/verify ICMP code and type are added in flowentries with OFplugin.

Since ICMP code and type are not supported in ovs2.3.0 for OF1.3
I have updated mininet with latest OVS 2.5.0.

Issue is not reproduced. Now i can see in flowentries created with ICMP code and type actions successfully.

Below are the command which i tried to have two different action field for ICMP type and code.

And i followed the same steps which i tested earlier when i got issue.

1) Configured mininet with sudo mn --topo tree,2 --controller remote,ip=10.106.138.117 --switch ovsk,protocols=OpenFlow13

2) Add flows with action set-tp-dst-action and set-tp-src-action using below command, and response code is success.

curl -v --user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:3/table/2/flow/256 -d '<?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <strict>false</strict> <flow-name>set-field-tcp-src</flow-name> <id>256</id> <cookie_mask>255</cookie_mask> <cookie>101</cookie> <table_id>2</table_id> <priority>2</priority> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <set-field> <icmpv4-match> <icmpv4-type>3</icmpv4-type> </icmpv4-match> </set-field> </action> <action> <order>1</order> <set-field> <icmpv4-match> <icmpv4-code>1</icmpv4-code> </icmpv4-match> </set-field> </action> </apply-actions> </instruction> </instructions> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> <ipv4-source>10.0.0.1/32</ipv4-source> <ipv4-destination>10.0.0.3/32</ipv4-destination> <ip-match> <ip-protocol>1</ip-protocol> </ip-match> </match> </flow>'

In Mininet i can see actions "ICMP code and type" changes:

Mininet Flowentries Output:
===========================

Here in below output in switch s3 you can see ICMP type and code entries.

mininet> dpctl dump-flows

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0x7f57ffffffffffff, duration=70.147s, table=0, n_packets=28, n_bytes=2380, idle_age=4, priority=0 actions=CONTROLLER:65535
      • s2 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0x7f57ffffffffffff, duration=72.755s, table=0, n_packets=15, n_bytes=1275, idle_age=4, priority=0 actions=CONTROLLER:65535
      • s3 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0x7f57ffffffffffff, duration=70.629s, table=0, n_packets=15, n_bytes=1275, idle_age=4, priority=0 actions=CONTROLLER:65535
        cookie=0x65, duration=86.111s, table=2, n_packets=0, n_bytes=0, idle_age=86, hard_age=3, priority=2,icmp,nw_src=10.0.0.1,nw_dst=10.0.0.3
        =====================================================================
        actions=load:0x6->NXM_OF_ICMP_TYPE[],load:0x3->NXM_OF_ICMP_CODE[]

======================================================================

Generated at Wed Feb 07 20:33:04 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.