Hi,

On 2016年07月18日 22:47, Felix Breidenstein wrote:
> Hi everyone,
>
> i am currently writing my bachelor thesis at TU Darmstadt in Germany.
> Part of my task is to transform Ryu into a Server/Client application
> where the server is connected to the switches and the client (running on
> another machine) runs the Ryu applications. For the network
> communication between the two parts I use the to_jsondict() and
> from_jsondict() functions before transmitting the events.
>
> I now stumbled across the fact that after I use from_jsondict() some of
> the fields in the object are empty. Here is a short piece of test code I
> put into a packet handler function of an app:
>
>> print("Before: {}".format(msg))
>> foo = msg.to_jsondict()
>> new_msg = ofproto_parser.ofp_msg_from_jsondict(datapath, foo)
>> print("After: {}".format(new_msg))
>
> The output is this:
>
> Before:
> version=0x4,msg_type=0xa,msg_len=0x54,xid=0x0,OFPPacketIn(buffer_id=4294967295,cookie=0,data=b'...',match=OFPMatch(oxm_fields={'in_port':
> 2}),reason=1,table_id=0,total_len=42)
> After:
> version=None,msg_type=None,msg_len=None,xid=None,OFPPacketIn(buffer_id=4294967295,cookie=0,data=b'...',match=OFPMatch(oxm_fields={'in_port':
> 2}),reason=1,table_id=0,total_len=42)
>
>
> As you can see some fields like version, msg_type or msg_len are now
> "None". Is there a reason for this behaviour?

The "None" fields (version, msg_type, msg_len, xid) will be set when 
msg.serialize() method is called.
So ofp_msg_from_jsondict() method does not set these fields.
    
https://github.com/osrg/ryu/blob/master/ryu/ofproto/ofproto_parser.py#L186-L200

Thanks,
Iwase

>
> Does anybody of you have an idea how to get around this problem? Some
> Ryu apps need these fields.
>
>
> Best regards,
>    Felix Breidenstein
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to