Hi
I added the flow based on IPv4 addresses and TCP or UDP ports in the flow
table. I saw that the same flow is repeated three or more times although it
must be added once. Why this happens?
Here is the segment of code to add the flow
if(pkt.get_protocols(ethernet.ethernet) and pkt.get_protocols(ipv4.ipv4)):
(ip4,) = pkt.get_protocols(ipv4.ipv4) ipsrc = ip4.src
ipdst = ip4.dst protocol = ip4.proto
pkt_tcp = pkt.get_protocol(tcp.tcp) if pkt_tcp is not None:
src_port = pkt_tcp.src_port dst_port =
pkt_tcp.dst_port match = parser.OFPMatch(in_port=in_port,
eth_dst=dst, eth_src=src, eth_type=ether_types.ETH_TYPE_IP,
ipv4_src=ipsrc, ipv4_dst=ipdst, ip_proto=protocol,
tcp_src=src_port, tcp_dst=dst_port) else:
pkt_udp = pkt.get_protocol(udp.udp) if pkt_udp is not
None: src_port = pkt_udp.src_port
dst_port = pkt_udp.dst_port match =
parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src,
eth_type=ether_types.ETH_TYPE_IP,
ipv4_src=ipsrc, ipv4_dst=ipdst, ip_proto=protocol, udp_src=src_port,
udp_dst=dst_port) else: match =
parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src,
eth_type=ether_types.ETH_TYPE_IP,
ipv4_src=ipsrc, ipv4_dst=ipdst) print match # verify
if we have a valid buffer_id, if yes avoid to send both # flow_mod &
packet_out if msg.buffer_id != ofproto.OFP_NO_BUFFER:
self.add_flow(datapath, 1, match, actions, msg.buffer_id)
return else: self.add_flow(datapath, 1,
match, actions)
and here is the flow table:
datapath duration in-port eth-dst eth_src
ip_src ip_dst out-port ----------------
---------------- ----------------- --------------- --------------
---------------------- -------- -------- --------0000000000000002 8
1 f2:2f:b0:b2:45:7f da:ea:f7:30:9b:e5 10.0.0.1 10.0.0.6
2 0000000000000002 5 2 da:ea:f7:30:9b:e5
f2:2f:b0:b2:45:7f 10.0.0.6 10.0.0.1 1
0000000000000002 1 2 da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f
10.0.0.6 10.0.0.1 1 0000000000000002 3 2
da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f 10.0.0.6 10.0.0.1
1 0000000000000002 2 2 da:ea:f7:30:9b:e5
f2:2f:b0:b2:45:7f 10.0.0.6 10.0.0.1 1
0000000000000002 4 2 da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f
10.0.0.6 10.0.0.1 1
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel