Hi I want to declare some variables to use in python script for the RYU controller. I used the following way to declare/use this,
Class (....) def_init_(....) : ............. self.variable01 = 0 self.variable02 = 0 def _function(): self.variable 01= 1 self.variable 02= 1 def _monitor(): self.variable 01= 1 self.variable 02= 1 the problem I encountered that sometimes in works. But sometimes the variable does not hold the expected value. Even I have found that within the emulation process after passing some rounds successfully, they stop working properly. then, what will be the right way to declare/use variables in the python script for the Ryu controller. Thanks in advance :) -Tanvir ________________________________________ From: ryu-devel-requ...@lists.sourceforge.net <ryu-devel-requ...@lists.sourceforge.net> Sent: Sunday, 9 October 2016 1:23 AM To: ryu-devel@lists.sourceforge.net Subject: Ryu-devel Digest, Vol 59, Issue 7 Send Ryu-devel mailing list submissions to ryu-devel@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/ryu-devel or, via email, send a message with subject or body 'help' to ryu-devel-requ...@lists.sourceforge.net You can reach the person managing the list at ryu-devel-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Ryu-devel digest..." Today's Topics: 1. Re: [PATCH] ryu/lib/ofctl_v1_3: port name decoding fix (Micha? Rzepka) 2. Host Discovery? (Rakesh Kumar) 3. Neighbor_get method is not working (Paulo S?rgio) 4. Re: Host Discovery? (Iwase Yusuke) 5. Re: [PATCH v2] BGPSpeaker: Enhance APIs for operator.show (FUJITA Tomonori) 6. Re: [PATCH] ryu/lib/ofctl_v1_3: port name decoding fix (FUJITA Tomonori) ---------------------------------------------------------------------- Message: 1 Date: Fri, 7 Oct 2016 10:35:34 +0200 From: Micha? Rzepka <mrze...@student.agh.edu.pl> Subject: Re: [Ryu-devel] [PATCH] ryu/lib/ofctl_v1_3: port name decoding fix To: ryu-devel@lists.sourceforge.net Message-ID: <4eede4b8-8093-ed7f-0506-7068545aa...@student.agh.edu.pl> Content-Type: text/plain; charset=utf-8; format=flowed Hello, Certainly, the issue is caused by the switch and would not be found on a fully-compliant device. This patch is meant to make Ryu handle such cases gracefully and prevent ofctl_rest app from crashing. Regards, W dniu 07.10.2016 o 03:30, Iwase Yusuke pisze: > Hi Michal, > > Thank you for submitting your patch! > It looks good to me. > > BTW, is this problem means that HP switch sends non ascii/utf-8 decodable > characters in OFPMP_PORT_DESC reply messages? > If so, I guess HP switch does not seem to follow the OpenFlow Spec. > > The OpenFlow Spec does not say clearly about the "name" field in "struct > ofp_port" though, but about the each field in "struct ofp_desc", the Spec > says clearly like: > --- > /* Body of reply to OFPMP_DESC request. Each entry is a NULL-terminated > * ASCII string. */ > struct ofp_desc { > --- > Therefore, also the "name" field in OFPMP_PORT_DESC reply should be > encoded > as ASCII string for consistence. > > This problem seems to be a bug of HP switch for me... > What do you think? > > Thanks, > Iwase > > On 2016?10?05? 22:56, Micha? Rzepka wrote: >> The patch resolves issue experienced when decoding certain values of >> name field in OFPMP_PORT_DESCRIPTION body. Non-decodable bytes are >> replaced with utf-8 replacement character. >> >> This issue was observed while retrieving OFPMP_PORT_DESC reply from >> OpenFlow 1.3 compliant HP switch. One of ofp_struct structures >> describing OFPP_LOCAL port has a name field with value 4f 46 50 50 5f 4c >> 4f 43 41 4c 00 81 ff ff ff ff that translates to OFPP_LOCAL....... >> Attempt to decode the value, as in modified line, raises an exception >> "UnicodeDecodeError: 'utf8' codec can't decode byte 0x81 in position 11: >> invalid start byte". In the submitted patch, non-decodable characters >> are replaced with utf-8 REPLACEMENT CHARACTER (U+FFFD), which is >> sufficient for the get_port_desc method to work seamlessly. Similar >> usages of str.decode method may be found in ofctl_v1_3, ofctl_v1_4, >> ofctl_v1_5 and need to be fixed in the future. >> >> Signed-off-by: Michal Rzepka <mrze...@student.agh.edu.pl> >> --- >> ryu/lib/ofctl_v1_3.py | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git ryu/lib/ofctl_v1_3.py ryu/lib/ofctl_v1_3.py >> index 3cac36d..4744a2e 100644 >> --- ryu/lib/ofctl_v1_3.py >> +++ ryu/lib/ofctl_v1_3.py >> @@ -1014,7 +1014,7 @@ def get_port_desc(dp, waiters, to_user=True): >> stats = msg.body >> for stat in stats: >> d = {'hw_addr': stat.hw_addr, >> - 'name': stat.name.decode('utf-8'), >> + 'name': stat.name.decode('utf-8', errors='replace'), >> 'config': stat.config, >> 'state': stat.state, >> 'curr': stat.curr, >> -- Micha? Rzepka Teleinformatyka, rok IV ------------------------------ Message: 2 Date: Fri, 7 Oct 2016 10:19:36 -0500 From: Rakesh Kumar <kuma...@illinois.edu> Subject: [Ryu-devel] Host Discovery? To: <ryu-devel@lists.sourceforge.net> Cc: "Evchenko, Konstantin" <evche...@illinois.edu> Message-ID: <CAL1h9KrqU9=sfsr33fudhzyfmvely6_no18+gr_x3wj0ktc...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" So, I am using RYU 4.0 with following apps: ryu-manager --observe-links ryu.app.ofctl_rest ryu.app.rest_topology I am using mininet. The topology has two switches connected via a single link between them. Each switch has two hosts connected with it. From the REST API, I can access all the switch-switch links, but when I try to access the hosts from the API endpoint at: "v1.0/topology/hosts", an empty list is returned, even though there are four hosts in the mininet topology. Could anyone elaborate on how to get this API endpoint to return the four hosts correctly? Also saw a patch thread here: https://sourceforge.net/p/ryu/mailman/message/34194496/ But it seems like the patch has not been merged with the main repo. - rakesh -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 3 Date: Sat, 8 Oct 2016 10:53:32 +0000 From: Paulo S?rgio <paulop...@hotmail.com> Subject: [Ryu-devel] Neighbor_get method is not working To: "ryu-devel@lists.sourceforge.net" <ryu-devel@lists.sourceforge.net> Message-ID: <cy1pr0501mb1787728dabc9426a7f8b05dcb5...@cy1pr0501mb1787.namprd05.prod.outlook.com> Content-Type: text/plain; charset="iso-8859-1" Hi, I'm trying to call the method BGPSpeaker.neighbor_get() and this is returning me this following error: time.struct_time(tm_year=2016, tm_mon=10, tm_mday=8, tm_hour=7, tm_min=48, tm_sec=10, tm_wday=5, tm_yday=282, tm_isdst=0) is not JSON serializable. Is this a bug? If I'm using the cli format it works fine. -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 4 Date: Sat, 8 Oct 2016 22:12:13 +0900 From: Iwase Yusuke <iwase.yusu...@gmail.com> Subject: Re: [Ryu-devel] Host Discovery? To: kuma...@illinois.edu Cc: ryu-devel@lists.sourceforge.net, evche...@illinois.edu Message-ID: <95f81ec2-8c6e-e0d7-2d4d-484f08dd7...@gmail.com> Content-Type: text/plain; charset=UTF-8 Hi, The patch you pointed seems to be merged to the upstream. https://github.com/osrg/ryu/commit/af63e5f51954fe1f080c1804940affce9a5d13cb But I couldn't have found out why... Does anyone know why? Thanks, Iwase On 2016?10?08? 00:19, Rakesh Kumar wrote: > So, I am using RYU 4.0 with following apps: > > ryu-manager --observe-links ryu.app.ofctl_rest ryu.app.rest_topology > > I am using mininet. The topology has two switches connected via a single link > between them. Each switch has two hosts connected with it. From the REST API, > I can access all the switch-switch links, but when I try to access the hosts > from the API endpoint at: "v1.0/topology/hosts", an empty list is returned, > even though there are four hosts in the mininet topology. > > Could anyone elaborate on how to get this API endpoint to return the four > hosts correctly? > > > Also saw a patch thread here: > https://sourceforge.net/p/ryu/mailman/message/34194496/ > > But it seems like the patch has not been merged with the main repo. > > > - > rakesh > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Ryu-devel mailing list > Ryu-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------ Message: 5 Date: Sat, 08 Oct 2016 22:42:37 +0900 (JST) From: FUJITA Tomonori <to...@acm.org> Subject: Re: [Ryu-devel] [PATCH v2] BGPSpeaker: Enhance APIs for operator.show To: iwase.yusu...@gmail.com Cc: ryu-devel@lists.sourceforge.net Message-ID: <20161008.224237.625859878544543208.to...@acm.org> Content-Type: Text/Plain; charset=us-ascii On Tue, 4 Oct 2016 15:53:20 +0900 IWASE Yusuke <iwase.yusu...@gmail.com> wrote: > This patch enhances the APIs of BGPSpeaker class which call > 'operator.show' APIs. > > Note: This patch renames the argument 'routetype' of neighbor_get() > into 'route_type' for the consistency of APIs. > > Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com> > --- > ryu/services/protocols/bgp/bgpspeaker.py | 51 > +++++++++++++++++++++++++------- > 1 file changed, 41 insertions(+), 10 deletions(-) Applied, thanks! ------------------------------ Message: 6 Date: Sat, 08 Oct 2016 23:10:10 +0900 (JST) From: FUJITA Tomonori <to...@acm.org> Subject: Re: [Ryu-devel] [PATCH] ryu/lib/ofctl_v1_3: port name decoding fix To: mrze...@student.agh.edu.pl Cc: ryu-devel@lists.sourceforge.net Message-ID: <20161008.231010.1305564732068185731.to...@acm.org> Content-Type: Text/Plain; charset=euc-kr On Wed, 05 Oct 2016 15:56:43 +0200 Micha? Rzepka <mrze...@student.agh.edu.pl> wrote: > The patch resolves issue experienced when decoding certain values of > name field in OFPMP_PORT_DESCRIPTION body. Non-decodable bytes are > replaced with utf-8 replacement character. > > This issue was observed while retrieving OFPMP_PORT_DESC reply from > OpenFlow 1.3 compliant HP switch. One of ofp_struct structures > describing OFPP_LOCAL port has a name field with value 4f 46 50 50 5f 4c > 4f 43 41 4c 00 81 ff ff ff ff that translates to OFPP_LOCAL....... > Attempt to decode the value, as in modified line, raises an exception > "UnicodeDecodeError: 'utf8' codec can't decode byte 0x81 in position 11: > invalid start byte". In the submitted patch, non-decodable characters > are replaced with utf-8 REPLACEMENT CHARACTER (U+FFFD), which is > sufficient for the get_port_desc method to work seamlessly. Similar > usages of str.decode method may be found in ofctl_v1_3, ofctl_v1_4, > ofctl_v1_5 and need to be fixed in the future. > > Signed-off-by: Michal Rzepka <mrze...@student.agh.edu.pl> > --- > ryu/lib/ofctl_v1_3.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks! ------------------------------ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ------------------------------ _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel End of Ryu-devel Digest, Vol 59, Issue 7 **************************************** ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel