Brady, This is correct. We use this approach in genius as well as netvirt, to program table 0 flows. If you do setVlanIdPresent(false) with vlanId=0, you can see flow like below : cookie=0x8000000, duration=155.130s, table=0, n_packets=236, n_bytes=24384, priority=4,in_port=4,vlan_tci=0x0000/0x1fff actions=write_metadata:0x70000000000/0xffffff0000000001,goto_table:17
Thanks, Faseela From: openflowplugin-dev-boun...@lists.opendaylight.org [mailto:openflowplugin-dev-boun...@lists.opendaylight.org] On Behalf Of Brady Johnson Sent: Sunday, April 15, 2018 6:49 AM To: Ryan Goulding <ryandgould...@gmail.com> Cc: openflowplugin-dev <openflowplugin-dev@lists.opendaylight.org> Subject: Re: [openflowplugin-dev] How to match on VLAN I just figured it out. I was looking through the Openflow Plugin code, and found in this file: openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flow/FlowConvertor.java This piece of code: final VlanId zeroVlan = new VlanId(0); VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder(); VlanIdBuilder vlanIdBuilder = new VlanIdBuilder(); vlanIdBuilder.setVlanIdPresent(false); vlanIdBuilder.setVlanId(zeroVlan); vlanMatchBuilder.setVlanId(vlanIdBuilder.build()); VLAN_MATCH_FALSE = vlanMatchBuilder.build(); VlanMatchBuilder vlanMatchBuilder2 = new VlanMatchBuilder(); VlanIdBuilder vlanIdBuilder2 = new VlanIdBuilder(); vlanIdBuilder2.setVlanIdPresent(true); vlanIdBuilder2.setVlanId(zeroVlan); vlanMatchBuilder2.setVlanId(vlanIdBuilder2.build()); VLAN_MATCH_TRUE = vlanMatchBuilder2.build(); So, I tried the following match: final VlanId vlanId = new VlanId(vlan); VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder(); VlanIdBuilder vlanIdBuilder = new VlanIdBuilder(); vlanIdBuilder.setVlanIdPresent(true); vlanIdBuilder.setVlanId(vlanId); vlanMatchBuilder.setVlanId(vlanIdBuilder.build()); match.setVlanMatch(vlanMatchBuilder.build()); And now I can add SetVlanId and StripVlan Actions. Im hoping that matching on VlanId=0 is basically matching on any VlanId. Here are the 2 flows that I get: cookie=0xba5eba11, duration=4.454s, table=30, n_packets=0, n_bytes=0, priority=500,ip,vlan_tci=0x1000/0x1000,nw_dst=192.168.1.0/24<http://192.168.1.0/24> actions=load:0x5ad2a7aa->NXM_NX_REG1[],set_field:4196->vlan_vid,goto_table:40 cookie=0xba5eba11, duration=4.453s, table=90, n_packets=0, n_bytes=0, priority=700,vlan_tci=0x1000/0x1000 actions=pop_vlan,output:8 Thanks, Brady Johnson bjohn...@inocybe.ca<mailto:bjohn...@inocybe.ca> [http://www.inocybe.com/wp-content/uploads/2014/09/default-login-image.png] [https://lh5.googleusercontent.com/4bsvmVYKzg5a_jM7_OOqbLXBSi8HbyuNfXuS5cO9eUpXgLzSUKrmdqdSOFmdShqIg0hX4xUHo2nYSUAlBC7KRnN3-COAkcx0CLOUEQrHCx9TVrQ2-0MP_qR0XpR22Kc8sdAQzZc1]<https://twitter.com/inocybetech>[https://lh3.googleusercontent.com/mkQzuX53_XbTrmTqeiS_gh2tauU4wJ_poqn7v-NSdKZoLI0jbWxdIIhrHZh7rSB-xpU7e2SqYDhcNfE8-rxzlQn15KaqJ9BqWOl65BakoHsKrbcCMhcdsnyrJAVuUV5SIFoazHIr]<http://www.inocybe.com/>[https://lh3.googleusercontent.com/Nzy3ZqITNZfRZ_hT9N3dh7K8ow5sF68e-qmL_5CFjka1oWK2XSfPZOUN6S9gp9k84l1KWTwDPCOb2Vbh0Oi6pVm4Nl7IpXp1QrTI6gkLNcWtMNpHMq2o2CxCfgqTPDA6pKBxNwhY]<https://www.linkedin.com/company/2661537?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2661537%2Cidx%3A1-1-1%2CtarId%3A1441300264767%2Ctas%3Ainocybe>[Screenshot 2017-02-14 at 10.43.55 AM.png]<https://www.youtube.com/channel/UC9uUWABdPR0Je9Du_15FCkw> On Sat, Apr 14, 2018 at 7:38 PM, Brady Johnson <bjohn...@inocybe.ca<mailto:bjohn...@inocybe.ca>> wrote: That's right Ryan, this is Nitrogen-SR2. If nobody has experienced this, can somebody please point me to where the Openflow Plugin VLAN validation code is? That is, there must be a Config Data Store listener that validates the flows, and if there is something it doesnt like, it wont write the flows to the Operational data store. I would like to see what it considers as valid/invalid for flows with setVlanId and popVlan actions. Regards, Brady Johnson bjohn...@inocybe.ca<mailto:bjohn...@inocybe.ca> [http://www.inocybe.com/wp-content/uploads/2014/09/default-login-image.png] [https://lh5.googleusercontent.com/4bsvmVYKzg5a_jM7_OOqbLXBSi8HbyuNfXuS5cO9eUpXgLzSUKrmdqdSOFmdShqIg0hX4xUHo2nYSUAlBC7KRnN3-COAkcx0CLOUEQrHCx9TVrQ2-0MP_qR0XpR22Kc8sdAQzZc1]<https://twitter.com/inocybetech>[https://lh3.googleusercontent.com/mkQzuX53_XbTrmTqeiS_gh2tauU4wJ_poqn7v-NSdKZoLI0jbWxdIIhrHZh7rSB-xpU7e2SqYDhcNfE8-rxzlQn15KaqJ9BqWOl65BakoHsKrbcCMhcdsnyrJAVuUV5SIFoazHIr]<http://www.inocybe.com/>[https://lh3.googleusercontent.com/Nzy3ZqITNZfRZ_hT9N3dh7K8ow5sF68e-qmL_5CFjka1oWK2XSfPZOUN6S9gp9k84l1KWTwDPCOb2Vbh0Oi6pVm4Nl7IpXp1QrTI6gkLNcWtMNpHMq2o2CxCfgqTPDA6pKBxNwhY]<https://www.linkedin.com/company/2661537?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2661537%2Cidx%3A1-1-1%2CtarId%3A1441300264767%2Ctas%3Ainocybe>[Screenshot 2017-02-14 at 10.43.55 AM.png]<https://www.youtube.com/channel/UC9uUWABdPR0Je9Du_15FCkw> On Sat, Apr 14, 2018 at 7:02 PM, Ryan Goulding <ryandgould...@gmail.com<mailto:ryandgould...@gmail.com>> wrote: IIRC this is based off Nitrogen-SR2, so shouldn't be prone to the issues listed there. Thanks! Regards, Ryan Goulding On Sat, Apr 14, 2018 at 6:52 PM, M. Ranganathan <mra...@gmail.com<mailto:mra...@gmail.com>> wrote: Not sure if this would help ( I was trying something a little different than you are ) but I had some issues creating set Vlan flows in Carbon https://stackoverflow.com/questions/47610513/how-to-create-a-set-vlan-flow I had much better luck with Nitrogen Ranga On Fri, Apr 13, 2018 at 5:42 PM, Brady Johnson <bjohn...@inocybe.ca<mailto:bjohn...@inocybe.ca>> wrote: Hello, Im trying to write flows to pop-vlan or just simply set the vlan-id, but the flows arent being written to operational, nor the bridge. I tried doing an etherType match on VLAN (0x8100) but that doesnt help. The 2 use cases I have are for flows that ingress the bridge with VLAN already set are: 1) if VLAN present (could be lots of different vlan IDs), pop it. 2) if VLAN present set the VLAN id to a different one. Ive tried flows for both of these cases, and neither are written to Operational. Ideally there should be an 802.1Q TPID (Tag protocol ID) match field, where you could match on 0x8100, but I couldnt find anything like this. Regards, Brady Johnson bjohn...@inocybe.ca<mailto:bjohn...@inocybe.ca> [http://www.inocybe.com/wp-content/uploads/2014/09/default-login-image.png] [https://lh5.googleusercontent.com/4bsvmVYKzg5a_jM7_OOqbLXBSi8HbyuNfXuS5cO9eUpXgLzSUKrmdqdSOFmdShqIg0hX4xUHo2nYSUAlBC7KRnN3-COAkcx0CLOUEQrHCx9TVrQ2-0MP_qR0XpR22Kc8sdAQzZc1]<https://twitter.com/inocybetech>[https://lh3.googleusercontent.com/mkQzuX53_XbTrmTqeiS_gh2tauU4wJ_poqn7v-NSdKZoLI0jbWxdIIhrHZh7rSB-xpU7e2SqYDhcNfE8-rxzlQn15KaqJ9BqWOl65BakoHsKrbcCMhcdsnyrJAVuUV5SIFoazHIr]<http://www.inocybe.com/>[https://lh3.googleusercontent.com/Nzy3ZqITNZfRZ_hT9N3dh7K8ow5sF68e-qmL_5CFjka1oWK2XSfPZOUN6S9gp9k84l1KWTwDPCOb2Vbh0Oi6pVm4Nl7IpXp1QrTI6gkLNcWtMNpHMq2o2CxCfgqTPDA6pKBxNwhY]<https://www.linkedin.com/company/2661537?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2661537%2Cidx%3A1-1-1%2CtarId%3A1441300264767%2Ctas%3Ainocybe>[Screenshot 2017-02-14 at 10.43.55 AM.png]<https://www.youtube.com/channel/UC9uUWABdPR0Je9Du_15FCkw> _______________________________________________ openflowplugin-dev mailing list openflowplugin-dev@lists.opendaylight.org<mailto:openflowplugin-dev@lists.opendaylight.org> https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev -- M. Ranganathan _______________________________________________ openflowplugin-dev mailing list openflowplugin-dev@lists.opendaylight.org<mailto:openflowplugin-dev@lists.opendaylight.org> https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev
_______________________________________________ openflowplugin-dev mailing list openflowplugin-dev@lists.opendaylight.org https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev