Hello everyone,
In my application I want to match destination address while adding flows. I am
using OFP1.3. The main problem is when I match the destination ip I used
match = datapath.ofproto_parser.OFPMatch(
dl_dst=ipv4_to_bin(dst))
Here this dl_dst creates problem because it is not a valid parameter of
OFPMatch may be. But I do not know what should I do to match the ipv4 address.
Can anyone please tell me what should I write in the match field to match
destination ip in OFP1.3 ? Detailed explanation of my problem is given
below(notice only the bold sections)-
when packet_in occurs- msg = ev.msg pkt =
packet.Packet(msg.data) nw = pkt.get_protocol(ipv4.ipv4)
src = nw.src
dst = nw.dst
I add flow as follow- ........ ........
print "Adding flows"
actions = [datapath.ofproto_parser.OFPActionOutput(out_port)]
self.add_flow(datapath, dst, actions)
print "Flow Added"
My add_flow function is as follow-
def add_flow(self, datapath, dst, actions):
ofproto = datapath.ofproto
match = datapath.ofproto_parser.OFPMatch(
dl_dst=ipv4_to_bin(dst))
mod = datapath.ofproto_parser.OFPFlowMod(
datapath=datapath, match=match, cookie=0,
command=ofproto.OFPFC_ADD, idle_timeout=0,
hard_timeout=0,
priority=ofproto.OFP_DEFAULT_PRIORITY,
flags=ofproto.OFPFF_SEND_FLOW_REM, actions=actions)
datapath.send_msg(mod)
My application prints that "Adding flows" but after that when it goes to the
add_flow function. it gives the following error-
hub: uncaught exception: Traceback (most recent call last):
File "/home/sakib/ryu/ryu/lib/hub.py", line 52, in _launch
func(*args, **kwargs)
File "/home/sakib/ryu/ryu/base/app_manager.py", line 274, in _event_loop
handler(ev)
File "/home/sakib/Desktop/shortest_path/shortest_path2.py", line 155, in
_packet_in_handler
self.add_flow(datapath, dst, actions)
File "/home/sakib/Desktop/shortest_path/shortest_path2.py", line 77, in
add_flow
dl_dst=ipv4_to_bin(dst))
File "/home/sakib/ryu/ryu/ofproto/ofproto_v1_3_parser.py", line 831, in
__init__
(k, v) in kwargs.iteritems())
File "/home/sakib/ryu/ryu/ofproto/ofproto_v1_3_parser.py", line 831, in
<genexpr>
(k, v) in kwargs.iteritems())
File "/home/sakib/ryu/ryu/ofproto/oxm_fields.py", line 233, in _normalize_user
(n, v, m) = mod.oxm_from_user(k, uv)
File "/home/sakib/ryu/ryu/ofproto/oxm_fields.py", line 180, in _from_user
(num, t) = _get_field_info_by_name(name_to_field, name)
File "/home/sakib/ryu/ryu/ofproto/oxm_fields.py", line 170, in
_get_field_info_by_name
raise KeyError('unknown match field ' + name)
KeyError: 'unknown match field dl_dst'
Thanks in advance for your cooperation.
RegardsSakib
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel