kytos-ng / flow_manager

Kytos NApp that manages OpenFlow 1.3 entries
https://kytos-ng.github.io/api/flow_manager.html
MIT License
0 stars 6 forks source link

`/v2/flows` returns flows with `cookie_mask` attribute #158

Open Ktmi opened 1 year ago

Ktmi commented 1 year ago

When performing a GET operation on /v2/flows, the returned flows will contain the cookie_mask attribute set to 0. According to discussion with @viniarck this is not supposed to occur. Here's some example output from /v2/flows:

{
    "00:00:00:00:00:00:00:04": {
        "flows": [
            {
                "switch": "00:00:00:00:00:00:00:04",
                "table_id": 0,
                "match": {
                    "dl_vlan": 3799,
                    "dl_type": 35020
                },
                "priority": 50000,
                "idle_timeout": 0,
                "hard_timeout": 0,
                "cookie": 12321848580485677060,
                "id": "9f65bd3de40897e0e3396290a800881f",
                "stats": {
                    "byte_count": 9198,
                    "duration_sec": 655,
                    "duration_nsec": 831000000,
                    "packet_count": 219
                },
                "cookie_mask": 0,
                "instructions": [
                    {
                        "instruction_type": "apply_actions",
                        "actions": [
                            {
                                "port": 4294967293,
                                "action_type": "output"
                            }
                        ]
                    }
                ]
            },
            {
                "switch": "00:00:00:00:00:00:00:04",
                "table_id": 0,
                "match": {
                    "dl_src": "ee:ee:ee:ee:ee:03"
                },
                "priority": 50000,
                "idle_timeout": 0,
                "hard_timeout": 0,
                "cookie": 12393906174523604996,
                "id": "50f9877451949afdd4aaf9de121cdcff",
                "stats": {
                    "byte_count": 0,
                    "duration_sec": 655,
                    "duration_nsec": 677000000,
                    "packet_count": 0
                },
                "cookie_mask": 0,
                "instructions": [
                    {
                        "instruction_type": "apply_actions",
                        "actions": [
                            {
                                "port": 4294967293,
                                "action_type": "output"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
viniarck commented 1 year ago

It could get omitted here, it won't cause issues with having the cookie_mask: 0, although it can lead to confusion indeed in a context where it's just showing/listing. The cookie_mask on of_core 0x04 Flow is still handy when converting to FlowMods.

Thanks for looking into it, and mapping this.