kytos-ng / telemetry_int

Kytos Telemetry Napp
MIT License
0 stars 2 forks source link

chore: intra evpl ends up with a redundant `set_vlan` action #49

Closed viniarck closed 9 months ago

viniarck commented 9 months ago

Currently, there's a redundant set_vlan for intra EVPL, where it's also keeping the set_vlan when adding metadata, since we know that sink int flows is also copying the same action and will have the set_vlan there too setting the correct vlan we can get rid of this one and only leave the vlan to be set again in the egress right after pop_int.

Here's an example of the situation:

{
            "flow": {
                "owner": "telemetry_int",
                "cookie": 12158165323357325131,
                "match": {
                    "in_port": 15,
                    "dl_vlan": 100
                },
                "instructions": [
                    {
                        "instruction_type": "apply_actions",
                        "actions": [
                            {
                                "action_type": "add_int_metadata"
                            },
                            {
                                "action_type": "set_vlan",
                                "vlan_id": 100
                            },
                            {
                                "action_type": "output",
                                "port": 19
                            }
                        ]
                    }
                ],
                "table_id": 2,
                "table_group": "base",
                "priority": 20000,
                "idle_timeout": 0,
                "hard_timeout": 0
            },
            "flow_id": "3a76cdb678f9a84ed73f71042ddfd734",
            "id": "d119aac7acf0df7df934170d60423173",
            "inserted_at": "2023-09-13T16:53:13.248000",
            "state": "installed",
            "switch": "00:00:00:00:00:00:00:01",
            "updated_at": "2023-09-13T17:10:52.748000"
        }
{
            "flow": {
                "owner": "telemetry_int",
                "cookie": 12158165323357325131,
                "match": {
                    "in_port": 20,
                    "dl_vlan": 100
                },
                "instructions": [
                    {
                        "instruction_type": "apply_actions",
                        "actions": [
                            {
                                "action_type": "pop_int"
                            },
                            {
                                "action_type": "set_vlan",
                                "vlan_id": 100
                            },
                            {
                                "action_type": "output",
                                "port": 16
                            }
                        ]
                    }
                ],
                "table_id": 2,
                "table_group": "base",
                "priority": 20000,
                "idle_timeout": 0,
                "hard_timeout": 0
            },
            "flow_id": "a106e78268412ccc15c5363a433b40b8",
            "id": "222cff88d642d4e18804296f8db1cad2",
            "inserted_at": "2023-09-13T16:53:13.248000",
            "state": "installed",
            "switch": "00:00:00:00:00:00:00:01",
            "updated_at": "2023-09-13T17:10:52.748000"
        }