Hi,

On my environment, I could get port_desc response.


$ ryu-manager ryu.app.ofctl_rest --verbose
...
(10220) wsgi starting up on http://0.0.0.0:8080
connected socket:<eventlet.greenio.base.GreenSocket object at 0x7f4bb6e35a10> 
address:('127.0.0.1', 49389)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f4bb6e4d410>
move onto config mode
EVENT ofp_event->dpset EventOFPSwitchFeatures
switch features ev 
version=0x5,msg_type=0x6,msg_len=0x20,xid=0xfa24c6a1,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=1,n_buffers=256,n_tables=254)
move onto main mode
EVENT ofp_event->dpset EventOFPStateChange
DPSET: register datapath <ryu.controller.controller.Datapath object at 
0x7f4bb6e35c90>
(10220) accepted ('127.0.0.1', 40956)
EVENT ofp_event->RestStatsApi EventOFPPortDescStatsReply
127.0.0.1 - - [30/Mar/2016 10:59:28] "GET /stats/portdesc/1 HTTP/1.1" 200 878 
0.010504

$ sudo ovs-vsctl list bridge
...
name                : "s1"
...
protocols           : ["OpenFlow14"]
...

$ curl -X GET http://localhost:8080/stats/portdesc/1 | python -m json.tool
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100   769  100   769    0     0  60776      0 --:--:-- --:--:-- --:--:-- 64083
{
     "1": [
         {
             "config": 1,
             "hw_addr": "32:f9:ce:8d:44:40",
             "length": 72,
             "name": "s1",
             "port_no": 4294967294,
             "properties": [
                 {
                     "advertised": 0,
                     "curr": 0,
                     "curr_speed": 0,
                     "length": 32,
                     "max_speed": 0,
                     "peer": 0,
                     "supported": 0,
                     "type": "ETHERNET"
                 }
             ],
             "state": 1
         },
         {
             "config": 0,
             "hw_addr": "ca:06:49:c6:bd:ff",
             "length": 72,
             "name": "s1-eth1",
             "port_no": 1,
             "properties": [
                 {
                     "advertised": 0,
                     "curr": 2112,
                     "curr_speed": 10000000,
                     "length": 32,
                     "max_speed": 0,
                     "peer": 0,
                     "supported": 0,
                     "type": "ETHERNET"
                 }
             ],
             "state": 0
         },
         {
             "config": 0,
             "hw_addr": "2a:57:4f:66:cb:ca",
             "length": 72,
             "name": "s1-eth2",
             "port_no": 2,
             "properties": [
                 {
                     "advertised": 0,
                     "curr": 2112,
                     "curr_speed": 10000000,
                     "length": 32,
                     "max_speed": 0,
                     "peer": 0,
                     "supported": 0,
                     "type": "ETHERNET"
                 }
             ],
             "state": 0
         }
     ]
}

$ ryu --version
ryu 4.0

$ git branch
* (detached from v4.0)
   master

$ python --version
Python 2.7.6

$ sudo ovs-vsctl --version
ovs-vsctl (Open vSwitch) 2.5.0
Compiled Mar 16 2016 11:34:45
DB Schema 7.12.1

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"


Please check your environment again.

Thanks,
Iwase

On 2016年03月29日 23:57, mark wrote:
> Dear All,
>
> i'm testing the new Ryu4.0 with OpenFlow1.4 version.
> when start ryu.app.ofctl_rest.py, i can see switch register well on ryu,
> but if i query switch portdesc, i get error, below.
>
> could you please help to verify this issue?
>
> BR<
> Mark
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f277569f0d0>
> move onto config mode
> EVENT ofp_event->dpset EventOFPSwitchFeatures
> *switch features ev 
> version=0x5*,msg_type=0x6,msg_len=0x20,xid=0xf4e78c81,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=43,n_buffers=3145728,n_tables=1)
> move onto main mode
> EVENT ofp_event->dpset EventOFPStateChange
> DPSET: register datapath <ryu.controller.controller.Datapath object at 
> 0x7f277569f410>
> (22900) accepted ('10.1.9.7', 49521)
> EVENT ofp_event->RestStatsApi EventOFPPortDescStatsReply
> Traceback (most recent call last):
>    File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 481, 
> in handle_one_response
>      result = self.application(self.environ, start_response)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/app/wsgi.py", line 201, 
> in __call__
>      return super(wsgify_hack, self).__call__(environ, start_response)
>    File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
>      resp = self.call_func(req, *args, **self.kwargs)
>    File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in 
> call_func
>      return self.func(req, *args, **kwargs)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/app/wsgi.py", line 263, 
> in __call__
>      return controller(req)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/app/wsgi.py", line 125, 
> in __call__
>      return getattr(self, action)(req, **kwargs)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/app/ofctl_rest.py", line 
> 584, in get_port_desc
>      groups = _ofctl.get_port_desc(dp, self.waiters)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ofctl_v1_4.py", line 
> 815, in get_port_desc
>      d = stat.to_jsondict()[stat.__class__.__name__]
>    File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 
> 265, in to_jsondict
>      dict_[k] = encode(k, v)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 
> 263, in <lambda>
>      encode = lambda k, x: self._encode_value(k, x, encode_string)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 
> 206, in _encode_value
>      return cls._get_encoder(k, encode_string)(v)
>    File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 
> 82, in encode
>      return six.text_type(v, 'utf-8')
> */UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 11: 
> invalid start byte/*
> *10.1.9.7 - - [29/Mar/2016 10:45:16] "GET /stats/portdesc/43 HTTP/1.1" 500 
> 1939 0.019539*
>
> ====================================================================================
> This message may contain information which is private, privileged or 
> confidential of INNO-Tech Network & Service Inc.
> If you are not the intended recipient of this message, please notify the 
> sender and destroy/delete the message.
> Any review, retransmission, dissemination or other use of, or taking of any 
> action in reliance upon this information,
> by persons or entities other than the intended recipient is prohibited.
> ====================================================================================
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to