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 6 forks source link

bug: `tp` (transport header) should only be required if `ip.nw_proto` is TCP (int 6) or UDP (int 17) #83

Closed viniarck closed 5 months ago

viniarck commented 5 months ago

If you try to send let's say a ICMP header (protocol number 1), although we don't have a correct fully serialization of ICMP it just set the ip protocol field accordingly (same way as it used to send protocol value 0 with whatever serialization), it shouldn't require a tp layer layer here. The tp transport layer for now is just for TCP (int 6) or UDP (int 17):

❯ echo '{ "trace": { "switch": { "dpid": "00:00:00:00:00:00:00:01", "in_port": 15}, "eth"
: {"dl_type": 2048, "dl_vlan": 2222}, "ip": { "nw_proto": 1 } } }' | http PUT http://127.
0.0.1:8181/api/amlight/sdntrace/v1/trace 
HTTP/1.1 200 OK
content-length: 45
content-type: application/json
date: Fri, 14 Jun 2024 12:58:22 GMT
server: uvicorn

{
    "result": {
        "error": "Error: tp not provided"
    }
}

cc'ing @Alopalao