Re: [Ryu-devel] RYU pop vlan tag and push vlan tag
Brought to you by:
nz_gizmoguy
From: Wei-Li T. <al...@xi...> - 2014-10-14 01:57:01
|
2014-10-14 9:43 GMT+08:00 Hui-Lan Lee <gra...@gm...>: > Hi Yusuke, > Thanks for your kindly response. > It is working in scenario 1. > But in scenario 2 , it is still not working. > > scenario(2) host1 connect to port 1 with no-vlan, host2 connect > to port2 with tag vlan 6. Then host1 ping host2 . > Could you help me figure out the problems? > > curl -X POST -d '{"dpid":"0000000000000001", > "priority":"32764","match":{"in_port":2, > "dl_vlan":6},"actions":[{"type":"POP_VLAN","ethertype":33024},{"type":"OUTPUT","port":1}]}' > http://127.0.0.1:8080/stats/flowentry/add > > curl -X POST -d '{"dpid":"0000000000000001", > "priority":"32764","match":{"in_port":1,"dl_vlan":0},"actions":[{"type":"SET_FIELD","field":"vlan_vid","value":4102},{"type":"OUTPUT","port":2}]}' > http://127.0.0.1:8080/stats/flowentry/add > Hi, Specifying "dl_vlan": 0 means you are going to match a VLAN-tagged packet with VLAN ID=0, and you should first push a VLAN tag to a non-VLAN-tagged packet before setting vlan_vid for it. Since there's no way to specify an exact match of VLAN-untagged flows for ofctl_rest at present, I suggest you lower the priority of the second flow entry. curl -X POST -d '{"dpid":"0000000000000001", "priority":"32763","match":{"in_port":1},"actions":[{"type":"PUSH_VLAN","ethertype":33024}, {"type":"SET_FIELD","field":"vlan_vid","value":4102},{"type":"OUTPUT","port":2}]}' http://127.0.0.1:8080/stats/flowentry/add > Thanks. > > 2014-10-14 9:00 GMT+08:00 Yusuke Iwase <iwa...@gm...>: > >> Hi, >> >> On 2014年10月11日 01:56, Hui-Lan Lee wrote: >> > Hi Yusuke, >> > You are right, it is working well right now. >> > Thanks~~~ >> > Then I change to openflow 1.3 , >> > add flow entry using command: >> > curl -X POST -d '{"dpid":"0000000000000001", >> "priority":"32764","match":{"in_port":2, >> "dl_vlan":6},"actions":[{"type":"PUSH_VLAN","ethertype":33024},{"type":"SET_FIELD","field":"vlan_vid","value":5},{"type":"OUTPUT","port":1}]}' >> http://127.0.0.1:8080/stats/flowentry/add >> >> I think you need to set OFPVID_PRESENT bit in OXM_OF_VLAN_VID set-field >> actions. >> >> e.g.) >> ..., {"type":"SET_FIELD","field":"vlan_vid","value":4101}, ... >> >> When you use ofctl_rest.py with OpenFlow 1.3 and try to set vlan_vid=5 in >> set-field action, >> you need bitwise OR operation like as follows. >> >> value = vlan_vid | OFPVID_PRESENT(0x1000 = 4096) >> = 5 | 4096 >> = 4101 >> >> For details, please refer to "7.2.3.8 Header Match Fields" in OpenFlow >> Spec 1.3.4. >> >> > >> > RYU shows the error message: >> > error msg ev version: 0x4 msg_type 0x1 xid 0xedfd27a5 >> OFPErrorMsg(code=15,data="\x04\x0e\x00p\xed\xfd'\xa5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x01\x00\x0c\x80\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00",type=2) >> type 0x2 code 0xf 0x4 0xe 0x0 0x70 0xed 0xfd 0x27 0xa5 0x0 0x0 0x0 0x0 0x0 >> 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x7f >> 0xfc 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0 0x0 >> 0x0 0x0 0x0 0x1 0x0 0xc 0x80 0x0 0x0 0x4 0x0 0x0 0x0 0x2 0x0 0x0 0x0 0x0 >> > (3294) accepted ('127.0.0.1', 34484) >> > >> > Am I doing something wrong ? >> > >> > 2014-10-10 15:00 GMT+08:00 Yusuke Iwase <iwa...@gm... >> <mailto:iwa...@gm...>>: >> > >> > Hi >> > >> > On 2014年10月07日 05:07, Hui-Lan Lee wrote: >> > > Hi, >> > > I design 2 scenarios in mininet, >> > > (1) host1 connect to port1 with tag vlan5, host2 connect to >> port2 with tag vlan 6 . Then host1 ping host2 . >> > > (2) host1 connect to port 1 with no-vlan, host2 connect to >> port2 with tag vlan 6. Then host1 ping host2 . >> > > >> > > I am running RYU : >> > > #./bin/ryu-manager --verbose --observe-links >> ryu.topology.switches ryu.app.rest_topology ryu.app.ofctl_re >> > > st ryu.app.simple_switch >> > > ~/ryu/ryu/gui$ ./controller.py >> > > >> > > in these two scenarios, I add static flow entry but they don't >> work, Either in case(1) or in case(2), host1 and host2 all cann't ping each >> other. Could you help me checkout what's wrong with my static flow entry? >> > > (1) >> > > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"OUTPUT","port":"1"}, >> {"type":"SET_VLAN_VID","vlan_vid":"5"}], "match":{"in_port":"2", >> "dl_vlan":"6"}}' http://127.0.0.1:8080/stats/flowentry/add >> > > >> > > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"OUTPUT","port":"2"}, >> {"type":"SET_VLAN_VID","vlan_vid":"6"}], "match":{"in_port":"1", >> "dl_vlan":"5"}}' http://127.0.0.1:8080/stats/flowentry/add >> > > >> > > (2) >> > > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32500","actions":[{"type":"OUTPUT","port":"2"}, >> {"type":"SET_VLAN_VID","vlan_vid":"6"}], "match":{"in_port":"1"}}' >> http://127.0.0.1:8080/stats/flowentry/add >> > > >> > > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"OUTPUT","port":"1"}, >> {"type":"STRIP_VLAN","ethertype":33024}], "match":{"in_port":"2", >> "dl_vlan":"6"}}' http://127.0.0.1:8080/stats/flowentry/add >> > >> > I think the specified order of "actions" is wrong in your flow >> entries. >> > In Open Flow Spec 1.0, action list for inserted flow entries MUST >> be processed in the order specified. >> > >> > So, How about commands as follows? >> > >> > (1) >> > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"SET_VLAN_VID","vlan_vid":"5"}, >> {"type":"OUTPUT","port":"1"}], "match":{"in_port":"2", "dl_vlan":"6"}}' >> http://127.0.0.1:8080/stats/flowentry/add >> > >> > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"SET_VLAN_VID","vlan_vid":"6"}, >> {"type":"OUTPUT","port":"2"}], "match":{"in_port":"1", "dl_vlan":"5"}}' >> http://127.0.0.1:8080/stats/flowentry/add >> > >> > (2) >> > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32500","actions":[{"type":"SET_VLAN_VID","vlan_vid":"6"}, >> {"type":"OUTPUT","port":"2"}], "match":{"in_port":"1"}}' >> http://127.0.0.1:8080/stats/flowentry/add >> > >> > curl -X POST -d '{"dpid": "0000000000000001", >> "priority":"32768","actions":[{"type":"STRIP_VLAN"}, >> {"type":"OUTPUT","port":"1"}], "match":{"in_port":"2", "dl_vlan":"6"}}' >> http://127.0.0.1:8080/stats/flowentry/add >> > >> > Just I changed the order of your flow entries. >> > (And "STRIP_VLAN" takes no arguments and consists like "ethertype") >> > >> > > >> > > >> > > >> ------------------------------------------------------------------------------ >> > > Slashdot TV. Videos for Nerds. Stuff that Matters. >> > > >> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk >> > > >> > > >> > > >> > > _______________________________________________ >> > > Ryu-devel mailing list >> > > Ryu...@li... <mailto: >> Ryu...@li...> >> > > https://lists.sourceforge.net/lists/listinfo/ryu-devel >> > > >> > >> > >> > > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Ryu-devel mailing list > Ryu...@li... > https://lists.sourceforge.net/lists/listinfo/ryu-devel > > -- Sincerely, Wei-Li Tang RD Engineer, Xinguard Inc. |