> > If not I was thinking of coding up a patch that would replace the > > current dl_dst hash with a function that chose the tuple based on type > > of traffic. If the flow is a TCP or UDP one the new function would hash > > based on the 5-tuple. Other traffic would just use the dl_dst based > > hash. > > I don't know why the current code uses only destination MAC. I don't > see any rationale in the code or the history. I guess changing it to > 5-tuple would be fine.
Hi, attached is a simple patch that changes the current behavior of hashing only based on the dl_dst to use all L2, L3 and L4 fields for the hash. Hope you can push it upstream. After installing the OVS with the patch, I tested this as follows to verify the hashing. I setup the mininet environment as described here: http://sdnhub.org/resources/useful-mininet-setups/ . Then I ran the following OVS scripts. $ for i in 1 2 3 4; do sudo ovs-vsctl del-port s1 s1-eth$i sudo ovs-vsctl add-port s1 s1-eth$i -- set Interface s1-eth$i ofport_request=$i sudo ovs-ofctl mod-port s1 s1-eth$i up -O OpenFlow13 done $ sudo ovs-ofctl --protocols=OpenFlow13 add-group s1 group_id=1,type=select,\ bucket=mod_dl_dst:00:00:00:00:00:02,mod_nw_dst:10.0.0.2,output:2,\ bucket=mod_dl_dst:00:00:00:00:00:03,mod_nw_dst:10.0.0.3,output:3,\ bucket=mod_dl_dst:00:00:00:00:00:04,mod_nw_dst:10.0.0.4,output:4 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 ip,nw_dst=10.0.0.5,priority=32769,actions=group:1 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 ip,actions=mod_dl_src:00:00:00:00:00:05,mod_nw_src:10.0.0.5,goto_table:1 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 table=1,dl_type=0x800,nw_dst=10.0.0.1,actions=output:1 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 table=1,dl_type=0x800,nw_dst=10.0.0.2,actions=output:2 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 table=1,dl_type=0x800,nw_dst=10.0.0.3,actions=output:3 $ sudo ovs-ofctl --protocols=OpenFlow13 add-flow s1 table=1,dl_type=0x800,nw_dst=10.0.0.4,actions=output:4 After those rules, I did repeated queries on mininet as follows and each time it sent request to different server (Before the patch, all requests were solely sent to h4) mininet> h1 curl http://10.0.0.5:8000/cgi-bin/serverip.cgi
0001-Changing-hash-used-for-selecting-bucket-to-pay-atten.patch
Description: Binary data
_______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss