Hello!

Yes, you absolutely right, according OpenFlow Spec the behavior of my
Switch is wrong, because data field is empty. We will fix it, of course.

The reason why i written this path is that i used old version of
Ryu-controller(commit b5c4b9ae519ac1c1bef4087ba602c602da4a4e95) and all
worked correct, because wasn't expanded output of OFPErrorMsg. I'm sorry
for my mistake.

Attached path works correct for me (tested with empty data field) -
controller not crashes.

Thank you for attention!

On Mon, Dec 14, 2015 at 5:06 AM, Yusuke Iwase <[email protected]>
wrote:

> Hi,
>
> Please keep mailing list.
>
> On 2015年12月11日 19:48, Yury Yurochko wrote:
> > Hello!
> > Controller crashes if i use msg.data.
> > The reason is that msg.data for OFPErrorMsg calculated like:
> >     msg.data = msg.buf[ofproto.OFP_ERROR_MSG_SIZE:]
> > Here len(buf) is 12 and OFP_ERROR_MSG_SIZE is 12 => msg.data is empty
> string (see ofproto/ofproto_v1_3_parser.py).
>
> Certainly, OFPErrorMsg length is 12 bytes, msg.data will be empty string,
> but, OpenFlow Spec says:
> ---
> OpenFlow Spec 1.3.5
>
> 7.4.4 Error Message
>
> The field data is variable in length and interpreted based on the type and
> code. Unless specified
> otherwise, the data field contains at least 64 bytes of the failed request
> that caused the error message
> to be generated, if the failed request is shorter than 64 bytes it should
> be the full request without any
> padding.
> ---
>
> So I think msg.data should include at least 64 bytes of the failed request
> by default.
>
> On my environment, Ryu outputs the followings if controller recieved
> OFPErrorMsg.
> ---
> EventOFPErrorMsg received.
> version=0x4, msg_type=0x1, msg_len=0x4c, xid=0xd0917e2d
>  `-- msg_type: OFPT_ERROR(1)
> OFPErrorMsg(type=0x4, code=0x9,
> data=b'\x04\x0e\x00\x58\xd0\x91\x7e\x2d\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x67\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x01\x00\x0c\x80\x00\x18\x04\xc0\xa8\x00\x01\x00\x00\x00\x00')
>  |-- type: OFPET_BAD_MATCH(4)
>  |-- code: OFPBMC_BAD_PREREQ(9)
>  `-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0xd0917e2d  # <--
> we need msg.data to output this line
>      `-- msg_type: OFPT_FLOW_MOD(14)
> ---
>
> If cotroller crashes in your network, how about the attached patch?
>
> Thanks,
> Iwase
>
> >
> > Maybe i don't understand some details?
> >
> > Sorry for my english.
> >
> > Regards,
> > Yury Yurochko
>

Regards,
Yury Yurochko
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to