negative (-) port numbers and ether type in flow statistics from REST API

177 views
Skip to first unread message

Franziska Corradi

unread,
Dec 6, 2015, 7:07:32 AM12/6/15
to ONOS Discuss
Hello all,

While working with ONOS REST API, i found some strange values in the REST reply for flow Statistics.

If I look at Wireshark I see for instance an LLDP Packet in the flow-stats-reply with
 ethertype : 35020  (0x88cc)
 port out :  4294967293
[see picture from Wireshark below]

the information that I think is supposed to be related to that, from the REST API  (http://10.1.0.16:8181/onos/v1/flows) gives
ether type: -30516
port out: -3
[see JSON output  from REST Request  below]

ARP packets show similar values, the ARP Ethertype shows up correct in the REST Response, but also with some negative port Value.

Does anyone knows what this "high" port number stands for ? is this the general port to communicate with the controller or like a Broadcast port or something?

Why are these values shown differently in the in the REST reply ?

Thanks for clarification.
Regards
Fränzi





{
  "flows": [
    {
      "id": "10414575354596821",
      "appId": "org.onosproject.core",
      "groupId": 0,
      "priority": 40000,
      "timeout": 0,
      "isPermanent": true,
      "deviceId": "of:0000000000000001",
      "state": "ADDED",
      "life": 241,
      "packets": 0,
      "bytes": 0,
      "lastSeen": 1449400662116,
      "treatment": {
        "instructions": [
          {
            "type": "OUTPUT",
            "port": -3
          }
        ],
        "deferred": []
      },
      "selector": {
        "criteria": [
          {
            "type": "ETH_TYPE",
            "ethType": -30516
          }
        ]
      }
    },
    {

Auto Generated Inline Image 1

Marc De Leenheer

unread,
Dec 6, 2015, 11:20:13 AM12/6/15
to Franziska Corradi, ONOS Discuss

Top values in the port number space represent logical values (flood, local etc.). The bug you're hitting looks like anp unsigned to signed conversion error.

Can you file an issue on our jira for this?

marc

--
You received this message because you are subscribed to the Google Groups "ONOS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-discuss...@onosproject.org.
To post to this group, send email to onos-d...@onosproject.org.
Visit this group at http://groups.google.com/a/onosproject.org/group/onos-discuss/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-discuss/e80a8d14-98b0-4583-ba33-10f24ac620e4%40onosproject.org.

Andrea Campanella

unread,
Dec 6, 2015, 2:40:32 PM12/6/15
to Marc De Leenheer, Franziska Corradi, ONOS Discuss
Hi,

the ethType output by the REST api has been changed in EMU to 0x0000 format to be more human readable (see https://en.wikipedia.org/wiki/EtherType#Notable_values).
Regarding the output port please do as Marc requested and file a issue on Jira so we can fix as soon as possible.

Have a nice sunday.

Andrea Campanella

and...@onlab.us




On Dec 6, 2015, at 8:20 AM, Marc De Leenheer <ma...@onlab.us> wrote:

Top values in the port number space represent logical values (flood, local etc.). The bug you're hitting looks like anp unsigned to signed conversion error.

Can you file an issue on our jira for this?

marc

On Dec 6, 2015 4:07 AM, "Franziska Corradi" <franzisk...@gmail.com> wrote:
Hello all,

While working with ONOS REST API, i found some strange values in the REST reply for flow Statistics.

If I look at Wireshark I see for instance an LLDP Packet in the flow-stats-reply with
 ethertype : 35020  (0x88cc)
 port out :  4294967293
[see picture from Wireshark below]

the information that I think is supposed to be related to that, from the REST API  (http://10.1.0.16:8181/onos/v1/flows) gives
ether type: -30516
port out: -3
[see JSON output  from REST Request  below]

ARP packets show similar values, the ARP Ethertype shows up correct in the REST Response, but also with some negative port Value.

Does anyone knows what this "high" port number stands for ? is this the general port to communicate with the controller or like a Broadcast port or something?

Why are these values shown differently in the in the REST reply ?

Thanks for clarification.
Regards
Fränzi


<Auto.png>

Franziska Corradi

unread,
Dec 8, 2015, 8:48:37 AM12/8/15
to ONOS Discuss
Hello,

thanks for the Input, I did as told and opend a bug ONOS-3562 for this problem. If I need to add more inforamtion please let me know. I'm not a Programmer and dont know
if the information is sufficent. I'm happy to help as good as I can.

Is there any Documentation about these "high" Port Values? or where could I find more Information about what Port Number belongs to which port type ?

Thanks
Fränzi

Charles Chan

unread,
Dec 8, 2015, 12:02:05 PM12/8/15
to Franziska Corradi, ONOS Discuss
These port numbers are defined in OpenFlow specification. You can search for ofp_port_no

Charles

--
You received this message because you are subscribed to the Google Groups "ONOS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-discuss...@onosproject.org.
To post to this group, send email to onos-d...@onosproject.org.
Visit this group at http://groups.google.com/a/onosproject.org/group/onos-discuss/.

Jonathan Hart

unread,
Dec 8, 2015, 1:47:34 PM12/8/15
to Charles Chan, Franziska Corradi, ONOS Discuss
Yes you can look in the OpenFlow spec, and also these values are defined in the ONOS code in the  org.onosproject.net.PortNumber class.

-3 is the value for the CONTROLLER logical port in OpenFlow, which means send the packet to the controller.

Thanks,

Jono

Franziska Corradi

unread,
Dec 12, 2015, 6:39:41 AM12/12/15
to ONOS Discuss
Thank you all very much. This helps me a lot.

Regards
Fränzi

On Sunday, December 6, 2015 at 1:07:32 PM UTC+1, Franziska Corradi wrote:

Andrea Campanella

unread,
Dec 13, 2015, 1:45:29 PM12/13/15
to Franziska Corradi, ONOS Discuss
Perfect. Let us know anything else we can do.

Andrea Campanella

and...@onlab.us




--
You received this message because you are subscribed to the Google Groups "ONOS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-discuss...@onosproject.org.
To post to this group, send email to onos-d...@onosproject.org.
Reply all
Reply to author
Forward
0 new messages