Hi,
On 2016年02月05日 15:18, Anees Mohsin Hadi Al-Najjar wrote:
> Dear all,
>
>
>
> I would like to CRAFT NOT REDIRECT the ICMP packet from the Ryu controller.
>
>
>
> I did that:
>
> “
>
> @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
>
> def packet_in_handler(self, ev):
>
>
>
> msg = ev.msg
>
> datapath = msg.datapath
>
> ofproto = datapath.ofproto
>
> parser = datapath.ofproto_parser
>
> pkt = packet.Packet(msg.data)
>
> in_port = msg.match['in_port']
>
> # print "in_port--->", in_port
>
>
>
> ######### ICMP ##############
>
> pkt2 = packet.Packet()
>
>
> pkt2.add_protocol(ethernet.ethernet(ethertype=0x0800,dst='00:00:00:00:01:02',src='00:00:00:00:01:01'))
>
>
> pkt2.add_protocol(ipv4.ipv4(ttl=255,csum=0,dst='192.168.10.2',src='192.168.10.1',proto=1,option=None))
>
>
> pkt2.add_protocol(icmp.icmp(type_=icmp.ICMP_ECHO_REQUEST,code=icmp.ICMP_ECHO_REPLY_CODE,csum=0,data=icmp.echo(id_=0,
> seq=0, data=None)))
>
>
>
> pkt2.serialize()
>
> self.logger.info("packet-out %s" % (pkt2,))
>
> data=pkt2.data
>
>
>
> actions = [parser.OFPActionOutput(port=2)]
>
> out =
> parser.OFPPacketOut(datapath=datapath,actions=actions,in_port=ofproto.OFPP_CONTROLLER,data=data)
>
> datapath.send_msg(out)
>
> ######### ICMP ##############
>
> “
>
>
>
>
>
> When the controller has been called by Packet_In massage, I got the following
> error:
>
>
>
> “hub: uncaught exception: Traceback (most recent call last):
>
> File "/home/ubuntu/ryu/ryu/lib/hub.py", line 52, in _launch
>
> func(*args, **kwargs)
>
> File "/home/ubuntu/ryu/ryu/base/app_manager.py", line 275, in _event_loop
>
> handler(ev)
>
> File "/home/ubuntu/Desktop/2Ints-Client-2IP_GWRs-R-1Server-Ryu-ICMP.py",
> line 344, in packet_in_handler
>
> datapath.send_msg(out)
>
> File "/home/ubuntu/ryu/ryu/controller/controller.py", line 234, in send_msg
>
> msg.serialize()
>
> File "/home/ubuntu/ryu/ryu/ofproto/ofproto_parser.py", line 205, in
> serialize
>
> self._serialize_body()
>
> File "/home/ubuntu/ryu/ryu/ofproto/ofproto_v1_3_parser.py", line 2380, in
> _serialize_body
>
> assert self.buffer_id == 0xffffffff
>
> AssertionError
>
>
>
> ”
This messages shows that the specified "buffer_id" in OFPPacketOut is invalid.
OpenFlow Spec 1.3.5 says:
---
7.3.7 Packet-Out Message
...
The buffer_id is the same given in the ofp_packet_in message. If the
buffer_id is OFP_NO_BUFFER,
then the packet data is included in the data array, and the packet
encapsulated in the message is
processed by the actions of the message. OFP_NO_BUFFER is 0xffffffff. If
buffer_id is valid, the corresponding
packet is removed from the buffer and processed by the actions of the message.
...
---
If you set a packet data into "data" field in OFPPacketOut,
you should explicitly specify "buffer_id=ofproto.OFP_NO_BUFFER", I think.
Thanks,
Iwase
>
>
>
> I hope to get advice how to solve this problem
>
>
>
>
>
> Anees AL-Najjar
>
> RHD Student
>
> School of Information Technology and Electrical Engineering (ITEE)
>
> Office: 331, Building (78)
>
> University of Queensland
>
> Brisbane, QLD
>
> Australia
>
>
>
> Emails: 1- [email protected]
>
> [email protected]
>
> Mobile: +61420407168
>
>
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel