kytos-ng / sdntrace

Napp that traces OpenFlow paths in the dataplane
https://kytos-ng.github.io/api/sdntrace.html
GNU Lesser General Public License v3.0
0 stars 5 forks source link

sdntrace `PUT /trace` endpoint is always requiring `dl_vlan` in the body #16

Closed viniarck closed 1 year ago

viniarck commented 2 years ago

PUT /trace is always requiring dl_vlan in the body, which can turn into an issue if you're trying to trace a port-based circuit, for instance this payload isn't considered valid:

{
    "trace": {
        "switch": {
            "dpid": "00:00:00:00:00:00:00:01",
            "in_port": 1
        },
        "eth": {}
    }
}
{
    "result": {
        "error": "Error: dl_vlan not provided"
    }
}

But, in practice it should work, if you're trying to trace this port-based circuit:

{
    "request": {
        "trace": {
            "eth": {},
            "switch": {
                "dpid": "00:00:00:00:00:00:00:01",
                "in_port": 1
            }
        }
    },
    "request_id": 30002,
    "result": [
        {
            "dpid": "00:00:00:00:00:00:00:01",
            "port": 1,
            "time": "2022-02-14 18:24:11.854740",
            "type": "starting"
        },
        {
            "dpid": "00:00:00:00:00:00:00:02",
            "port": 2,
            "time": "0:00:00.509496",
            "type": "trace"
        },
        {
            "dpid": "00:00:00:00:00:00:00:03",
            "port": 2,
            "time": "0:00:01.019950",
            "type": "trace"
        },
        {
            "msg": "none",
            "reason": "done",
            "time": "0:00:02.534195",
            "type": "last"
        }
    ],
    "start_time": "2022-02-14 18:24:11.854740",
    "total_time": "0:00:02.534750"
}