Software Defined Networking
1832842 Members
2996 Online
110047 Solutions
New Discussion

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

 
chrisxcai
Occasional Advisor

[HP 3500yl] Attach a flow to a meter via Ryu controller

Hi,

 

           We are trying to attach flows to existing meter for HP 3500yl swiches to do rate-limiting. However, the Ryu controller we use received error message after it send the corresponding flowMod message to attach the flow.

The code for sending flowMod message is:

 

match = parser.OFPMatch()
inst = [parser.OFPInstructionMeter(1)]
mod = parser.OFPFlowMod(datapath=datapath, priority=0,match=match, instructions=inst,table_id=100,
)
datapath.send_msg(mod)

 

 

            Ryu can create meter successfully by sending openflow message and there is already a meter with meter_id = 1 created. The error message we receive for above code is:

 

error msg ev version: 0x4 msg_type 0x1 xid 0xde9b9884 OFPErrorMsg(code=0,data='\x04\x0e\x00@\xde\x9b\x98\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x04\x00\x00\x00\x00\x00\x06\x00\x08\x00\x00\x00\x01',type=2) type 0x2 code 0x0 0x4 0xe 0x0 0x40 0xde 0x9b 0x98 0x84 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x64 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xff 0xff 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x0 0x4 0x0 0x0 0x0 0x0 0x0 0x6 0x0 0x8 0x0 0x0 0x0 0x1

 

           Error type 2, code 0 corresponds to OFPET_BAD_ACTION, OFPBAC_BAD_TYPE.  We wonder if there is problem on the Ryu side or the switch side. Anyone who succeeded to create meter and attach flows to meters are also welcome to share experience. Thanks!

             

12 REPLIES 12
sdnindia
Trusted Contributor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hello chrisxcai,

 

Could you please provide the below details

1– What firmware version is being used?

2- Are you using OpenFlow 1.0 or 1.3?

3- What kind of a meter are you trying to create as per the specification i.e. a dscp remark meter or a drop meter ?

4- Are you able to successfully create the meter first before you tried to associate the meter with a flow?

Please let us know if you were able to do the same with the Flare controller successfully?

 

Thanks,

HP SDN Team

chrisxcai
Occasional Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

 

Hi, thanks a lot for your reply!

 

Here are the information:

 

 

1– What firmware version is being used?

We are using 15.04

 

2- Are you using OpenFlow 1.0 or 1.3?

We have configured the switch to use 1.3 only for the openflow instance

 

3- What kind of a meter are you trying to create as per the specification i.e. a dscp remark meter or a drop meter ?

We are trying add a simple drop meter.

 

4- Are you able to successfully create the meter first before you tried to associate the meter with a flow?

We are able to create the meter via the API call of Ryu, but the subsequent call of accociating the meter with a flow fails with the error message.

 


Please let us know if you were able to do the same with the Flare controller successfully?

Would you like to give a point to the Flare controller?Thanks.

 

 

Meanwhile, we have tried to test with the HP SDN VAN controller and experienced similar issue. We are able to add a meter via the REST API of HP SDN VAN controller. But the REST API  of accociating a flow with the exisiting meter does not take effect.  We specify the flow rule's instruction field as "{meter:1}", to indicate we want to assciate this flow to meter 1. 

 

 

 

 

chrisxcai
Occasional Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

New update:

We found that by using the REST API of HP SDN controller, we can add trivial flow rules if the instruction does not associate this flow to a meter, for example , if a flow's instruciton looks like:

 

instruction = [{"apply_actions": []}]

 

it can be pushed to the switch:

 Flow 8
 Match
  Incoming Port : Any                   Ethernet Type    : IP
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 123                   Duration         : 164 seconds
  Hard Timeout  : 400 seconds           Idle Timeout     : 300 seconds
  Byte Count    : 0                     Packet Count     : 0
  Flow Table ID : 200                   Controller ID    : 1
  Activity Count: NA                    Cookie           : 0x1238
  Hardware Index     : NA
 Instructions
   Apply Actions

 

 

 

Set priority to 123 for ease of recognition.

 

However, if the flow's instruction is:

instruction = [{"meter":1},{"apply_actions": []}]

 

it will not be pushed to the switch

 

sdnindia
Trusted Contributor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hello chrisxcai,

 

Please provide the outputs for below commands-

1)            show version

2)            show run

3)            show openflow instance <name> flows

4)            show openflow instance <name> meters

5)            show openflow instance <name>

 

Also the packet capture of the flow-mod/rule which has the meter attached, when it is pushed from the controller to the switch.

 

 

Thanks,

HP SDN Team

chrisxcai
Occasional Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hi , here is the information:

 

 

show version:

Image stamp:    /ws/swbuildm/K_rel_memphis_qaoff/code/build/btm(swbuildm_K_rel_memphis_qaoff_rel_memphis)
                Oct 31 2013 12:27:49
                K.15.14.0003
                1459
Boot Image:     Primary

show run:
Running configuration:

; J9470A Configuration Editor; Created on release #K.15.14.0003
; Ver #05:08.7f.ff.3f.ef:5d
hostname "HP-Switch2"
module 1 type j94dda
ip default-gateway 10.1.0.1
snmp-server community "public" unrestricted
openflow
   controller-id 1 ip 10.0.2.20 controller-interface vlan 1
   controller-id 2 ip 10.0.2.21 controller-interface vlan 1
   instance "vlan2"
      listen-port
      member vlan 2
      controller-id 1
      controller-id 2
      version 1.3 only
      limit hardware-rate 10000000
      limit software-rate 10000
      max-backoff-interval 1
      enable
      exit
   enable
   exit
lldp admin-status 2,4-6 disable
vlan 1
   name "DEFAULT_VLAN"
   no untagged 1-20
   untagged 21-24
   ip address 10.0.2.1 255.255.0.0
   exit
vlan 2
   name "openflow"
   untagged 1-12
   ip address 10.2.0.1 255.0.0.0
   exit
vlan 3
   name "OpenStack"
   untagged 13-20
   no ip address
   exit

 

 

 

 

 

 

 


show openflow instance vlan2 flows:
OpenFlow Flow Table

 Flow 1
 Match
  Incoming Port : Any                   Ethernet Type    : IP
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : UDP
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : 67                    Destination Port : 68
 Attributes
  Priority      : 31500                 Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : NA                    Packet Count     : 0
  Flow Table ID : 100                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xfffc0000babadada
  Hardware Index     : 0
 Instructions
   Goto Table ID                 : 200

 Flow 2
 Match
  Incoming Port : Any                   Ethernet Type    : IPv6
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IPv6 FLabel   : Any
  IPv6 Ext. Hdr : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 1                     Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : NA                    Packet Count     : 2
  Flow Table ID : 100                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xffff000000000000
  Hardware Index     : 0
 Instructions
   Apply Actions
    Normal

 Flow 3
 Match
  Incoming Port : Any                   Ethernet Type    : IP
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 1                     Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : NA                    Packet Count     : 14306
  Flow Table ID : 100                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xffff000000000000
  Hardware Index     : 0
 Instructions
   Apply Actions
    Normal

 Flow 4
 Match
  Incoming Port : Any                   Ethernet Type    : Any
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 0                     Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : NA                    Packet Count     : 0
  Flow Table ID : 100                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xffff000000000000
  Hardware Index     : NA
 Instructions
   Goto Table ID                 : 200

 Flow 5
 Match
  Incoming Port : Any                   Ethernet Type    : IP
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : UDP
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : 67                    Destination Port : 68
 Attributes
  Priority      : 31500                 Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : 0                     Packet Count     : 0
  Flow Table ID : 200                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xfffc0000babadada
  Hardware Index     : NA
 Instructions
   Apply Actions
    Controller Port
    Normal

 Flow 6
 Match
  Incoming Port : Any                   Ethernet Type    : ARP
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  ARP Opcode    : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 31000                 Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : 0                     Packet Count     : 0
  Flow Table ID : 200                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xfffd0000babadada
  Hardware Index     : NA
 Instructions
   Apply Actions
    Controller Port
    Normal

 Flow 7
 Match
  Incoming Port : Any                   Ethernet Type    : 0x8999
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 60000                 Duration         : 1200 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : 0                     Packet Count     : 0
  Flow Table ID : 200                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xfffb0000faded000
  Hardware Index     : NA
 Instructions
   Apply Actions
    Controller Port

 Flow 8
 Match
  Incoming Port : Any                   Ethernet Type    : Any
  Source MAC    : Any                   Destination MAC  : Any
  VLAN ID       : Any                   VLAN priority    : Any
  Source Protocol Address : Any
  Target Protocol Address : Any
  IP Protocol   : Any
  IP ECN        : Any                   IP DSCP          : Any
  Source Port   : Any                   Destination Port : Any
 Attributes
  Priority      : 0                     Duration         : 1201 seconds
  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds
  Byte Count    : 0                     Packet Count     : 0
  Flow Table ID : 200                   Controller ID    : 2
  Activity Count: NA                    Cookie           : 0xffff000000000000
  Hardware Index     : NA
 Instructions
   Apply Actions
    Normal


 show openflow instance vlan2 meters

 OpenFlow Instance Meters

 Meter ID             : 1                   
 Flow Count           : 0                   
 Input Packet Count   : 0                                
 Duration             : 0                                

                        Packet  
 Band Type Rate         Count   
 --------- ------------ --------
 Drop      1500 kbps    0       


show openflow instance vlan2


 Configured OF Version    : 1.3 only  
 Negotiated OF Version    : 1.3  
 Instance Name            : vlan2                            
 Admin. Status            : Enabled
 Member List              : VLAN 2              
 Listen Port              : 6633           
 Oper. Status             : Up      
 Oper. Status Reason      : NA                                      
 Datapath ID              : 00022c27d7787280        
 Mode                     : Active    
 Flow Location            : Hardware and Software         
 No. of Hw Flows          : 4     
 No. of Sw Flows          : 4     
 Hw. Rate Limit           : 10000000 kbps       
 Sw. Rate Limit           : 10000 pps      
 Conn. Interrupt Mode     : Fail-Secure         
 Maximum Backoff Interval : 1 seconds      
 Probe Interval           : 10 seconds     
 Hw. Table Miss Count     : NA                  
 No. of Sw Flow Tables    : 1  
 Egress Only Ports        : None                                    
 Table Model              : Policy Engine and Software              

 Controller Id Connection Status Connection State Secure Role  
 ------------- ----------------- ---------------- ------ ------
 1             Disconnected      Backoff          No     Equal
 2             Connected         Active           No     Equal



two packets were sent when pushing the flow rule associating the meter with flow by Ryu:

No.     Time           Source                Destination           Protocol Length Info
      1 0.000000000    10.0.2.21             10.0.2.1              TCP      130    6633 > 61842 [PSH, ACK] Seq=1 Ack=1 Win=240 Len=64 TSval=1924126 TSecr=1822872014

Frame 1: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: Vmware_5e:bc:44 (00:0c:29:5e:bc:44), Dst: Hewlett-_78:72:80 (2c:27:d7:78:72:80)
Internet Protocol Version 4, Src: 10.0.2.21 (10.0.2.21), Dst: 10.0.2.1 (10.0.2.1)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    Total Length: 116
    Identification: 0x8a05 (35333)
    Flags: 0x02 (Don't Fragment)
    Fragment offset: 0
    Time to live: 64
    Protocol: TCP (6)
    Header checksum: 0x9869 [validation disabled]
    Source: 10.0.2.21 (10.0.2.21)
    Destination: 10.0.2.1 (10.0.2.1)
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 61842 (61842), Seq: 1, Ack: 1, Len: 64
    Source port: 6633 (6633)
    Destination port: 61842 (61842)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    [Next sequence number: 65    (relative sequence number)]
    Acknowledgment number: 1    (relative ack number)
    Header length: 32 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 240
    [Calculated window size: 240]
    [Window size scaling factor: -1 (unknown)]
    Checksum: 0x187c [validation disabled]
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
    [SEQ/ACK analysis]
Data (64 bytes)
    Data&colon; 040e0040204c7ea400000000000000000000000000000000...
    [Length: 64]

0000  2c 27 d7 78 72 80 00 0c 29 5e bc 44 08 00 45 00   ,'.xr...)^.D..E.
0010  00 74 8a 05 40 00 40 06 98 69 0a 00 02 15 0a 00   .t..@.@..i......
0020  02 01 19 e9 f1 92 3f 4f cb c9 1a a8 0c 2d 80 18   ......?O.....-..
0030  00 f0 18 7c 00 00 01 01 08 0a 00 1d 5c 1e 6c a6   ...|........\.l.
0040  d1 ce 04 0e 00 40 20 4c 7e a4 00 00 00 00 00 00   .....@ L~.......
0050  00 00 00 00 00 00 00 00 00 00 c8 00 00 00 00 00   ................
0060  00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00   ................
0070  00 00 00 01 00 04 00 00 00 00 00 06 00 08 00 00   ................
0080  00 01                                             ..

No.     Time           Source                Destination           Protocol Length Info
      3 0.001097000    10.0.2.21             10.0.2.1              TCP      66     6633 > 61842 [ACK] Seq=65 Ack=77 Win=240 Len=0 TSval=1924127 TSecr=1822877024

Frame 3: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Vmware_5e:bc:44 (00:0c:29:5e:bc:44), Dst: Hewlett-_78:72:80 (2c:27:d7:78:72:80)
Internet Protocol Version 4, Src: 10.0.2.21 (10.0.2.21), Dst: 10.0.2.1 (10.0.2.1)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    Total Length: 52
    Identification: 0x8a06 (35334)
    Flags: 0x02 (Don't Fragment)
    Fragment offset: 0
    Time to live: 64
    Protocol: TCP (6)
    Header checksum: 0x98a8 [validation disabled]
    Source: 10.0.2.21 (10.0.2.21)
    Destination: 10.0.2.1 (10.0.2.1)
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 61842 (61842), Seq: 65, Ack: 77, Len: 0
    Source port: 6633 (6633)
    Destination port: 61842 (61842)
    [Stream index: 0]
    Sequence number: 65    (relative sequence number)
    Acknowledgment number: 77    (relative ack number)
    Header length: 32 bytes
    Flags: 0x010 (ACK)
    Window size value: 240
    [Calculated window size: 240]
    [Window size scaling factor: -1 (unknown)]
    Checksum: 0x183c [validation disabled]
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
    [SEQ/ACK analysis]

0000  2c 27 d7 78 72 80 00 0c 29 5e bc 44 08 00 45 00   ,'.xr...)^.D..E.
0010  00 34 8a 06 40 00 40 06 98 a8 0a 00 02 15 0a 00   .4..@.@.........
0020  02 01 19 e9 f1 92 3f 4f cc 09 1a a8 0c 79 80 10   ......?O.....y..
0030  00 f0 18 3c 00 00 01 01 08 0a 00 1d 5c 1f 6c a6   ...<........\.l.
0040  e5 60                                             .`

 

 

Let me know if you need more information, thanks.

sdnindia
Trusted Contributor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hello chrisxcai,

 

Please see below our logs with same setup as you are using-

HP-3500yl-24G(openflow)# show ver

Image stamp:

/ws/swbuildm/K_rel_memphis_qaoff/code/build/btm(swbuildm_K_rel_memphis_qaoff_rel_memphis)

                Oct 31 2013 12:27:49

                K.15.14.0003

                1459

Boot Image:     Secondary

 

HP-3500yl-24G(openflow)# show run

 

Running configuration:

 

; J8692A Configuration Editor; Created on release #K.15.14.0003

; Ver #05:08.7f.ff.3f.ef:5d

hostname "HP-3500yl-24G"

module 1 type j86xxa

snmp-server community "public" unrestricted

openflow

   controller-id 1 ip 10.20.30.42 controller-interface vlan 2

   instance "t1"

      listen-port

      member vlan 3

      controller-id 1

      version 1.3 only

      enable

      exit

   enable

   exit

vlan 1

   name "DEFAULT_VLAN"

   no untagged 2,23-24

   untagged 1,3-22

   ip address dhcp-bootp

   exit

vlan 2

   name "VLAN2"

   untagged 2

   ip address 10.20.30.40 255.255.255.0

   exit

vlan 3

   name "VLAN3"

   untagged 23-24

   no ip address

   exit

 

 

HP-3500yl-24G$ show openflow inst t1

 

Configured OF Version    : 1.3 only

Negotiated OF Version    : 1.3

Instance Name            : t1

Admin. Status            : Enabled

Member List              : VLAN 3

Listen Port              : 6633

Oper. Status             : Up

Oper. Status Reason      : NA

Datapath ID              : 0003c8cbb8dde0c0

Mode                     : Active

Flow Location            : Hardware and Software

No. of Hw Flows          : 2

No. of Sw Flows          : 1

Hw. Rate Limit           : 0 kbps

Sw. Rate Limit           : 100 pps

Conn. Interrupt Mode     : Fail-Secure

Maximum Backoff Interval : 60 seconds

Probe Interval           : 10 seconds

Hw. Table Miss Count     : NA

No. of Sw Flow Tables    : 1

Egress Only Ports        : None

Table Model              : Policy Engine and Software

 

Controller Id Connection Status Connection State Secure Role

------------- ----------------- ---------------- ------ ------

1             Connected         Active           No     Equal

 

Creating a meter…………….

 

HP-3500yl-24G$

 

root@Ubuntu5151:~# dpctl tcp:10.20.30.40:6633 meter-mod cmd=add,flags=1,meter=123 drop:rate=100

 

SENDING:

meter_mod{cmd="add", flags="0x1"", meter_id="7b"", bands=[{type = drop, rate="100", burst_size="0"}]}

 

 

 

HP-3500yl-24G$ show openflow instance t1 meter

 

OpenFlow Instance Meters

 

Meter ID             : 123

Flow Count           : 0

Input Packet Count   : 0

Duration             : 0

 

                        Packet

Band Type Rate         Count

--------- ------------ --------

Drop      100 kbps     0

 

 

Adding a rule with a meter using the dpctl utility ……………

 

root@Ubuntu5151:~# dpctl tcp:10.20.30.40:6633 flow-mod cmd=add,table=100 eth_type=0x800,ip_src=10.1.1.1 meter:123 apply:

meter:123

apply:

 

SENDING:

flow_mod{table="100", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", prio="32768", buf="none", port="any", group="any", flags="0x0", match=oxm{eth_type="0x800", ipv4_src="10.1.1.1"}, insts=[meter{meter="123"}, apply{acts=[]}]}

 

 

 

Verify if the rule with meter instruction is installed properly…………

 

HP-3500yl-24G$ show openflow inst t1 flows

 

OpenFlow Flow Table

 

Flow 1

Match

  Incoming Port : Any                   Ethernet Type    : Any

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : Any

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 0                     Duration         : 327 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : 0                     Packet Count     : NA

  Flow Table ID : 0                     Controller ID    : NA

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : NA

Instructions

   Goto Table ID                 : 100

 

Flow 2

Match

  Incoming Port : Any                   Ethernet Type    : Any

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : Any

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 0                     Duration         : 263 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : NA                    Packet Count     : 0

  Flow Table ID : 100                   Controller ID    : 1

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : NA

Instructions

   Goto Table ID                 : 200

 

Flow 3

Match

  Incoming Port : Any                   Ethernet Type    : IP

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : 10.1.1.1/32

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 32768                 Duration         : 68 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : NA                    Packet Count     : 0

  Flow Table ID : 100                   Controller ID    : listen-port

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : 0

Instructions

   Meter ID                      : 123

   Apply Actions

 

Flow 4

Match

  Incoming Port : Any                   Ethernet Type    : Any

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : Any

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 0                     Duration         : 263 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : 0                     Packet Count     : 0

  Flow Table ID : 200                   Controller ID    : 1

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : NA

Instructions

   Apply Actions

    Controller Port

 

HP-3500yl-24G$

 

Verifying the ref_count of meters………

 

HP-3500yl-24G$ show openflow instance t1 meter

 

OpenFlow Instance Meters

 

Meter ID             : 123

Flow Count           : 1

Input Packet Count   : 0

Duration             : 0

 

                        Packet

Band Type Rate         Count

--------- ------------ --------

Drop      100 kbps     0

 

HP-3500yl-24G$ show openflow inst t1 message-statistics

 

OpenFlow

Message Type     Received        Rejected

---------------- --------------- --------

OFPT_FLOW_MOD     3              0

OFPT_PORT_MOD     0              0

OFPT_GROUP_MOD    0              0

OFPT_METER_MOD    1              0

 

Adding another rule with meter instruction……………

 

root@Ubuntu5151:~# dpctl tcp:10.20.30.40:6633 flow-mod cmd=add,table=100 eth_type=0x800,ip_src=11.1.1.1 meter:123 apply:

meter:123

apply:

 

SENDING:

flow_mod{table="100", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", prio="32768", buf="none", port="any", group="any", flags="0x0", match=oxm{eth_type="0x800", ipv4_src="11.1.1.1"}, insts=[meter{meter="123"}, apply{acts=[]}]}

 

 

 

Verifying the ref_count for the meter…….

 

HP-3500yl-24G$ show openflow instance t1 meter

 

OpenFlow Instance Meters

 

Meter ID             : 123

Flow Count           : 2

Input Packet Count   : 0

Duration             : 0

 

                        Packet

Band Type Rate         Count

--------- ------------ --------

Drop      100 kbps     0

 

Verify the flow-mod requests processed by the switch…………

 

HP-3500yl-24G$ show openflow inst t1 message-statistics

 

OpenFlow

Message Type     Received        Rejected

---------------- --------------- --------

OFPT_FLOW_MOD     4              0

OFPT_PORT_MOD     0              0

OFPT_GROUP_MOD    0              0

OFPT_METER_MOD    1              0

 

Verifying the rule are installed……………

 

 

HP-3500yl-24G$ show openflow inst t1 flows eth ip

 

OpenFlow Flow Table

 

Flow 1

Match

  Incoming Port : Any                   Ethernet Type    : IP

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : 10.1.1.1/32

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 32768                 Duration         : 594 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : NA                    Packet Count     : 0

  Flow Table ID : 100                   Controller ID    : listen-port

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : 0

Instructions

   Meter ID                      : 123

   Apply Actions

 

Flow 2

Match

  Incoming Port : Any                   Ethernet Type    : IP

  Source MAC    : Any                   Destination MAC  : Any

  VLAN ID       : Any                   VLAN priority    : Any

  Source Protocol Address : 11.1.1.1/32

  Target Protocol Address : Any

  IP Protocol   : Any

  IP ECN        : Any                   IP DSCP          : Any

  Source Port   : Any                   Destination Port : Any

Attributes

  Priority      : 32768                 Duration         : 205 seconds

  Hard Timeout  : 0 seconds             Idle Timeout     : 0 seconds

  Byte Count    : NA                    Packet Count     : 0

  Flow Table ID : 100                   Controller ID    : listen-port

  Activity Count: NA                    Cookie           : 0x0

  Hardware Index     : 0

Instructions

   Meter ID                      : 123

   Apply Actions

 

HP-3500yl-24G$

 

Also do let us know below-

  1. The wireshark packet capture of the flow-mode request coming from the controller.
  2. Output of the command   show openflow instance <name> message
  3. BTW why are you adding a rule with empty apply-instruction and a meter instruction (with drop action)? If a rule has an empty apply action, all packets hitting that rule will get dropped.

 

 

Thanks,

HP SDN Team

chrisxcai
Occasional Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hi, thanks for replying!

 

1. I am not sure if I am misunderstanding what you need. The plain text of packet capture of flowMod sent from controller to switch is posted at previous post, I am copying them here, one flowMod result in two packets:

 

two packets were sent when pushing the flow rule associating the meter with flow by Ryu:

No.     Time           Source                Destination           Protocol Length Info
      1 0.000000000    10.0.2.21             10.0.2.1              TCP      130    6633 > 61842 [PSH, ACK] Seq=1 Ack=1 Win=240 Len=64 TSval=1924126 TSecr=1822872014

Frame 1: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: Vmware_5e:bc:44 (00:0c:29:5e:bc:44), Dst: Hewlett-_78:72:80 (2c:27:d7:78:72:80)
Internet Protocol Version 4, Src: 10.0.2.21 (10.0.2.21), Dst: 10.0.2.1 (10.0.2.1)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    Total Length: 116
    Identification: 0x8a05 (35333)
    Flags: 0x02 (Don't Fragment)
    Fragment offset: 0
    Time to live: 64
    Protocol: TCP (6)
    Header checksum: 0x9869 [validation disabled]
    Source: 10.0.2.21 (10.0.2.21)
    Destination: 10.0.2.1 (10.0.2.1)
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 61842 (61842), Seq: 1, Ack: 1, Len: 64
    Source port: 6633 (6633)
    Destination port: 61842 (61842)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    [Next sequence number: 65    (relative sequence number)]
    Acknowledgment number: 1    (relative ack number)
    Header length: 32 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 240
    [Calculated window size: 240]
    [Window size scaling factor: -1 (unknown)]
    Checksum: 0x187c [validation disabled]
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
    [SEQ/ACK analysis]
Data (64 bytes)
    Data&colon; 040e0040204c7ea400000000000000000000000000000000...
    [Length: 64]

0000  2c 27 d7 78 72 80 00 0c 29 5e bc 44 08 00 45 00   ,'.xr...)^.D..E.
0010  00 74 8a 05 40 00 40 06 98 69 0a 00 02 15 0a 00   .t..@.@..i......
0020  02 01 19 e9 f1 92 3f 4f cb c9 1a a8 0c 2d 80 18   ......?O.....-..
0030  00 f0 18 7c 00 00 01 01 08 0a 00 1d 5c 1e 6c a6   ...|........\.l.
0040  d1 ce 04 0e 00 40 20 4c 7e a4 00 00 00 00 00 00   .....@ L~.......
0050  00 00 00 00 00 00 00 00 00 00 c8 00 00 00 00 00   ................
0060  00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00   ................
0070  00 00 00 01 00 04 00 00 00 00 00 06 00 08 00 00   ................
0080  00 01                                             ..

No.     Time           Source                Destination           Protocol Length Info
      3 0.001097000    10.0.2.21             10.0.2.1              TCP      66     6633 > 61842 [ACK] Seq=65 Ack=77 Win=240 Len=0 TSval=1924127 TSecr=1822877024

Frame 3: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Vmware_5e:bc:44 (00:0c:29:5e:bc:44), Dst: Hewlett-_78:72:80 (2c:27:d7:78:72:80)
Internet Protocol Version 4, Src: 10.0.2.21 (10.0.2.21), Dst: 10.0.2.1 (10.0.2.1)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    Total Length: 52
    Identification: 0x8a06 (35334)
    Flags: 0x02 (Don't Fragment)
    Fragment offset: 0
    Time to live: 64
    Protocol: TCP (6)
    Header checksum: 0x98a8 [validation disabled]
    Source: 10.0.2.21 (10.0.2.21)
    Destination: 10.0.2.1 (10.0.2.1)
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 61842 (61842), Seq: 65, Ack: 77, Len: 0
    Source port: 6633 (6633)
    Destination port: 61842 (61842)
    [Stream index: 0]
    Sequence number: 65    (relative sequence number)
    Acknowledgment number: 77    (relative ack number)
    Header length: 32 bytes
    Flags: 0x010 (ACK)
    Window size value: 240
    [Calculated window size: 240]
    [Window size scaling factor: -1 (unknown)]
    Checksum: 0x183c [validation disabled]
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
    [SEQ/ACK analysis]

0000  2c 27 d7 78 72 80 00 0c 29 5e bc 44 08 00 45 00   ,'.xr...)^.D..E.
0010  00 34 8a 06 40 00 40 06 98 a8 0a 00 02 15 0a 00   .4..@.@.........
0020  02 01 19 e9 f1 92 3f 4f cc 09 1a a8 0c 79 80 10   ......?O.....y..
0030  00 f0 18 3c 00 00 01 01 08 0a 00 1d 5c 1f 6c a6   ...<........\.l.
0040  e5 60                                             .`

 

 

show openflow instance vlan2 message

 OpenFlow
 Message Type     Received        Rejected
 ---------------- --------------- --------
 OFPT_FLOW_MOD     111            111           
 OFPT_PORT_MOD     0              0             
 OFPT_GROUP_MOD    0              0             
 OFPT_METER_MOD    0              0

 

It shows all the flowMod trying to associate the meter get rejected.

 

 

For 3, we are just doing test to see if we can assocaite a flow rule with meter, we understand this rule will drop packet. We make instruction to have empty apply-action to help to isolate the problem.

Let us know if you need anything else, thank you!

 

 

 

sdnindia
Trusted Contributor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hello chrisxcai

 

1.You have shared the plain text of the packet capture coming from the controller. We cannot parse this and we would need a wire-shark capture of the flow-mod requests and responses between the switch and the controller. If we have the wireshark capture, we have OpenFlow plugins to parse the headers and can identify the problem. All you have to do is run wireshark on the controller and capture the packets on the interface connected to the switch. You can download wireshark from https://www.wireshark.org/download.html

https://www.wireshark.org/about.html  

2.  Output of the command   show openflow instance <name> message

show openflow instance vlan2 message

OpenFlow

Message Type     Received        Rejected

---------------- --------------- --------

OFPT_FLOW_MOD     111            111          

 OFPT_PORT_MOD     0              0            

 OFPT_GROUP_MOD    0              0            

 OFPT_METER_MOD    0              0

 

There are two issues here:

a.            The flow-mod requests are getting rejected and we do not know the reason as to why they are getting rejected, the wireshark capture of the packets would be of help.

b.            We do not see any meter-mod requests from the controller, so there are no meters installed by the controller?

c.             Apart from the above command, please share the output of the command “show openflow instance <name> meters” when the problem happens.

So please provide the below-

  • Packet capture using wireshark application. The packets between controller and switch need to be captured when problem happens.
  • “Show openflow instance <name> message” when problem happens.
  • “show openflow instance <name> meter” when problem happens.

 

If  you can share the RYU controller script(which installs meters and rules) with us, we can run and debug the problem further.

 

 

Thanks,

HP SDN Team

chrisxcai
Occasional Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Hi, thanks for your feedback,

 

1. The wireshark packet capture of the flow-mode request coming from the controller.

 

Since the forum does not allow .pcap attachment, please use the following dropbox link.

 

 https://www.dropbox.com/s/fx6exgzyjtgrsxq/ryu.pcap?dl=0

 

 

 I used Wireshark' "save as" to export the packets as .pcap file, let me know if it is not in right format and how to export it in a right way.

 

I used a while loop to send the FLOW_MOD messeges, which tries to associate a flow rule with the meter every 5 seconds for clairity.

 

 

 

 

 

2. Show openflow instance <name> message” when problem happens.

 OpenFlow
 Message Type     Received        Rejected
 ---------------- --------------- --------
 OFPT_FLOW_MOD     17             17            
 OFPT_PORT_MOD     0              0             
 OFPT_GROUP_MOD    0              0             
 OFPT_METER_MOD    1              0 

 

I understand the FLOW_MOD messges are getting rejected, but not sure why.

 

3. “show openflow instance <name> meter” when problem happens.


 OpenFlow Instance Meters

 Meter ID             : 1                   
 Flow Count           : 0                   
 Input Packet Count   : 0                                
 Duration             : 0                                

                        Packet  
 Band Type Rate         Count   
 --------- ------------ --------
 Drop      100 kbps     0    

 

The meter was already installed.

The reason last time show message does not show the OFPT_METER_MOD is since the meter is added, we did not try to add it again in the script.

 

 

 

Please find this ryu python script simple_switch_13_rl.py. For clarity I used a while loop to send the FLOW_MOD message every five seconds. It should be placed at ryu/app/ folder.

 

 https://www.dropbox.com/s/xeir2ihyawc4jar/simple_switch_13_rl.py?dl=0

 

If you have a ryu controller, you can run it with

 

PYTHONPATH=. ./bin/ryu-manager ryu/app/simple_switch_13_rl.py

 

at the ryu root folder

 

 

Thanks a lot for your help!

Dennis Handly
Acclaimed Contributor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

>the forum does not allow .pcap attachment

 

Just attach a .zip of that file.

zefanya_
Member

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

i have the same problem. have you found the solution?

Ramzah_Rehman
Advisor

Re: [HP 3500yl] Attach a flow to a meter via Ryu controller

Same problem. Meter is added but cannot associate meter to a flow. Need help