FlowForwarding / LINC-Switch

OpenFlow Software Switch written in Erlang
http://flowforwarding.org
Other
213 stars 80 forks source link

Matching on VLAN PCP generate OFPBMC_BAD_PREREQ #138

Open mihailtudoran opened 11 years ago

mihailtudoran commented 11 years ago

Tested with Luxoft's Twister framework, OpenFlow 1.3.1 module:

Test scenario:

Test result:

Debug:

Flow_mod to switch:

Openflow Protocol Header Version: 0x04 Type: Flow mod (CSM) - OFPT_FLOW_MOD (14) Length: 96 Transaction ID: 2950231661 Flow Mod Cookie: 0x0000000000000000 Cookie Mask: 0x0000000000000000 Table ID: 0 Command: New flow - OFPFC_ADD (0x00) Idle Timeout: 0 Hard Timeout: 0 Priority: 32768 Buffer ID: 0xffffffff Output Port: 4294967295 Output Group: 4294967295 Flags: 0x0000 Padding Match Type: OpenFlow Extensible Match - OFPMT_OXM (0x0001) Length: 23 OXM field Class: Basic class for OpenFlow - OFPXMC_OPENFLOW_BASIC (0x8000) 0000 000. = Field: Switch input port - OFPXMT_OFB_IN_PORT (0x00) 0 = Has mask: No Length: 4 Value: 00000001 OXM field Class: Basic class for OpenFlow - OFPXMC_OPENFLOW_BASIC (0x8000) 0000 110. = Field: VLAN id - OFPXMT_OFB_VLAN_VID (0x06) 0 = Has mask: No Length: 2 Value: 1000 OXM field Class: Basic class for OpenFlow - OFPXMC_OPENFLOW_BASIC (0x8000) 0000 111. = Field: VLAN priority - OFPXMT_OFB_VLAN_PCP (0x07) 0 = Has mask: No Length: 1 Value: 0a Padding Instruction Type: Applies the action(s) immediately - OFPIT_APPLY_ACTIONS (0x0004) Length: 24 Padding Action Type: Output to switch port - OFPAT_OUTPUT (0x0000) Length: 16 Port: 2 Max Length: 0 Padding

Response:

Openflow Protocol Header Version: 0x04 Type: Error (SM) - OFPT_ERROR (1) Length: 12 Transaction ID: 2950231661 Error Type: Error in match - OFPET_BAD_MATCH (4) Code: A prerequisite was not met - OFPBMC_BAD_PREREQ (0x0009) Data:

According to 1.3 spec, OFP_VLAN_VID is != None.

nygge commented 11 years ago

The bug is in linkus{3,4}_flow:prerequisite_for/2. We need a way of describing that the prerequisite is NOT equal to some value.