On Thu, 04 Dec 2014 09:08:20 +0900
Yusuke Iwase <[email protected]> wrote:

> Hi,
> 
> On 2014年12月04日 01:09, Flavio Castro wrote:
>> Does Ryu support matching on VLAN using masks?
>> 
>> My match fields are only create successfully if I instantiate them like this:
>> 
>> match = parser.OFPMatch(in_port=in_port, eth_dst=dst,vlan_vid=vlan)
>> 
>> They break if I try this:
>> 
>> match = parser.OFPMatch(in_port=in_port, eth_dst=dst,vlan_vid=vlan)
>> match.set_vlan_vid(vlan)
> 
> set_vlan_vid(vlan) method is one of old API for OFPMatch and
> OFPMatch(vlan_vid=vlan) is new API.
> 
> If you need to set masked VLAN ID,
> I recommend you to use new API like as follows.
> 
> 
> 1) Packets with and without a VLAN tag
> 
>   - Match class
>     ofproto_v1_3_parser.OFPMatch()
> 
>   - Packet Matching
>     non-VLAN-tagged        MATCH
>     VLAN-tagged(vlan_id=3) MATCH
>     VLAN-tagged(vlan_id=5) MATCH
> 
> 2) Only packets without a VLAN tag
> 
>   - Match class
>     ofproto_v1_3_parser.OFPMatch(vlan_vid=0x0000)
> 
>   - Packet Matching
>     non-VLAN-tagged        MATCH
>     VLAN-tagged(vlan_id=3)   x
>     VLAN-tagged(vlan_id=5)   x
> 
> 3) Only packets with a VLAN tag regardless of its value
> 
>   - Match class
>     ofproto_v1_3_parser.OFPMatch(vlan_vid=(0x1000, 0x1000))
> 
>   - Packet Matching
>     non-VLAN-tagged          x
>     VLAN-tagged(vlan_id=3) MATCH
>     VLAN-tagged(vlan_id=5) MATCH
> 
> 4) Only packets with VLAN tag and VID equal
> 
>   - Match class
>     ofproto_v1_3_parser.OFPMatch(vlan_vid=(0x1000 | 3))
> 
>   - Packet Matching
>     non-VLAN-tagged          x
>     VLAN-tagged(vlan_id=3) MATCH
>     VLAN-tagged(vlan_id=5)   x

Can you add the above good stuff into our OF API documentation?

Thanks a lot!

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to