Dear ryu's community,
I want to create a ryu application which contains an OpenFlow match on a
subnet:
OFPMatch(eth_type=ether.ETH_TYPE_IP, ipv4_dst='192.168.0.0/24',
ipv4_src='192.168.0.0/24')
Apparently the internal representation of these match fields (ipv4_dst,
ipv4_src) uses the IPAddress class instead of the IPNetwork class.
This result in the following failure:
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line
50, in _launch
func(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line
256, in _event_loop
handler(ev)
File
"/local/home/guegantj/SDN/ryu/virtual-gateway/learningswitch.py", line
46, in __switch_features_handler
match_local_traffic(datapath, self.__subnet),
File
"/local/home/guegantj/SDN/ryu/virtual-gateway/utils/matchutils.py", line
42, in match_local_traffic
ipv4_dst=subnet, ipv4_src=subnet)
File
"/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py",
line 768, in __init__
(k, v) in kwargs.iteritems())
File
"/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py",
line 768, in <genexpr>
(k, v) in kwargs.iteritems())
File
"/usr/local/lib/python2.7/dist-packages/ryu/ofproto/oxm_fields.py", line
210, in normalize_user
(n, v, m) = mod.oxm_from_user(k, uv)
File
"/usr/local/lib/python2.7/dist-packages/ryu/ofproto/oxm_fields.py", line
176, in from_user
value = t.from_user(value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/addrconv.py",
line 27, in text_to_bin
return self._addr(text, **self._addr_kwargs).packed
File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py",
line 289, in __init__
% self.__class__.__name__)
ValueError: IPAddress() does not support netmasks or subnet prefixes!
See documentation for details.
According to the OpenFlow specification 1.3, a subnet should be handled:
OXM_OF_IPV4_SRC | Required | IPv4 source address. Can use subnet mask or
arbitrary bitmask .
OXM_OF_IPV4_DST | Required | IPv4 destination address. Can use subnet
mask or arbitrary bitmask .
How can I use subnets, in my project, in an efficient and smart way?
My guess is that I can:
- Try to patch the library for this case. If so, may I have hints for
where should I look at ? (addrconv.py, IPv4Addr class in oxm_fields.py...)
- Append OXM fields directly into the OFPMatch object. If so, what is
the best solution to do this?
- Do an OFPMatch for each host in the subnet.
Sincerely,
Jean Guegant
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel