Thanks it works now -Mo
2014-04-02 1:13 GMT-05:00 YAMAMOTO Takashi <[email protected]>: > > Hi, > > It seems that I encountered a strange problem about vlan_vid, I am using > > OF1.3 parser > > > > The topology is this > > > > Switch-1 ---- Switch-2 > > > > I use the following code to set up a flow to match dl_vlan=1 on switch 2 > > ====== > > match = parser.OFPMatch(vlan_vid=1) > > please try: > > match = parser.OFPMatch(vlan_vid=1|ofproto_v1_3.OFPVID_PRESENT) > > YAMAMOTO Takashi > > > actions = [parser.OFPActionSetField(vlan_vid = 0x0002), > > parser.OFPActionOutput(2)] > > inst = > > [parser.OFPInstructionActions(ofproto_v1_3.OFPIT_APPLY_ACTIONS, actions)] > > req = parser.OFPFlowMod(datapath = switch.dp, match = match, > > instructions = inst) > > switch.dp.send_msg(req) > > ====== > > > > The incoming packets have vlan=1, the code on switch-1 I use to push vlan > > is : > > > > ===== > > > > match = parser.OFPMatch( eth_dst=dst_mac, eth_src=src_mac, > > eth_type=0x0800, ipv4_src=src_ip, ipv4_dst=dst_ip) > > actions = [parser.OFPActionPushVlan(0x8100), > > parser.OFPActionSetField(vlan_vid = 0x0001), > > parser.OFPActionSetField(eth_dst = mac), > > parser.OFPActionOutput(output_port)] > > inst = > > [parser.OFPInstructionActions(ofproto_v1_3.OFPIT_APPLY_ACTIONS, actions)] > > req = parser.OFPFlowMod(datapath = switch.dp, match = match, > > instructions = inst) > > switch.dp.send_msg(req) > > ===== > > > > I think the set vlan code is correct, because when I use ovs-ofctl to > > mannually set another rule to match for dl_vlan=1 and packet will go > > through but when I use Ryu API, it cannot. > > > > My only guess for now(by observing the resulting rules) is that > > vlan_tci(set by Ryu API) is somewhat different from dl_vlan(manually > set)? > > > > But other than that, I have really no clue... > > > > Thanks > > -Mo >
------------------------------------------------------------------------------
_______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
