kytos-ng / sdntrace_cp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong return of traces in bulk mode

italovalcy opened this issue · comments

Hi,

When running sdntrace-cp with more than one trace in bulk mode, the return seems to be incorrect. If I request 4 traces - three from the same switch and another one from a different switch - only two results are returned (from two different switches).

How to reproduce:

  1. Using Kytos docker image amlight/kytos:latest and Mininet with linear topology (10 switches) mn --topo linear,10 --controller=remote,ip=127.0.0.1
  2. Create three EVCs:
curl -H 'Content-type: application/json' -X POST http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc -d '{"name": "my evc1", "dynamic_backup_path": true, "enabled": true, "uni_z": {"tag": {"value": 100, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:0a:1"}, "uni_a": {"tag": {"value": 100, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:01:1"}}'

curl -H 'Content-type: application/json' -X POST http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc -d '{"name": "my evc1", "dynamic_backup_path": true, "enabled": true, "uni_z": {"tag": {"value": 101, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:0a:1"}, "uni_a": {"tag": {"value": 101, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:01:1"}}'

curl -H 'Content-type: application/json' -X POST http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc -d '{"name": "my evc1", "dynamic_backup_path": true, "enabled": true, "uni_z": {"tag": {"value": 102, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:0a:1"}, "uni_a": {"tag": {"value": 102, "tag_type": 1}, "interface_id": "00:00:00:00:00:00:00:01:1"}}'
  1. Send the trace requests:
curl -v -X PUT -H 'Content-type: application/json' http://127.0.0.1:8181/api/amlight/sdntrace_cp/traces -d '[{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 100}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 101}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 102}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:0a", "in_port": 1}, "eth": {"dl_vlan": 100}}}]'

Expected result: the sdntrace-cp should return 4 traces and their correspondent result

Actual result: only two results are returned:

root@b8c4cf3e46c6:/kytos-end-to-end-tests# curl -v -X PUT -H 'Content-type: application/json' http://127.0.0.1:8181/api/amlight/sdntrace_cp/traces -d '[{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 100}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 101}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_vlan": 102}}}, {"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:0a", "in_port": 1}, "eth": {"dl_vlan": 100}}}]'
*   Trying 127.0.0.1:8181...
* Connected to 127.0.0.1 (127.0.0.1) port 8181 (#0)
> PUT /api/amlight/sdntrace_cp/traces HTTP/1.1
> Host: 127.0.0.1:8181
> User-Agent: curl/7.74.0
> Accept: */*
> Content-type: application/json
> Content-Length: 396
>
* upload completely sent off: 396 out of 396 bytes
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: application/json
< Content-Length: 2152
< Access-Control-Allow-Origin: *
< Server: Werkzeug/2.0.3 Python/3.9.2
< Date: Thu, 22 Dec 2022 19:44:55 GMT
<
{"00:00:00:00:00:00:00:01":[[{"dpid":"00:00:00:00:00:00:00:01","port":1,"time":"2022-12-22 19:44:55.458209","type":"starting","vlan":100},{"dpid":"00:00:00:00:00:00:00:02","port":2,"time":"2022-12-22 19:44:55.458267","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:03","port":2,"time":"2022-12-22 19:44:55.458291","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:04","port":2,"time":"2022-12-22 19:44:55.458314","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:05","port":2,"time":"2022-12-22 19:44:55.458336","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:06","port":2,"time":"2022-12-22 19:44:55.458357","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:07","port":2,"time":"2022-12-22 19:44:55.458378","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:08","port":2,"time":"2022-12-22 19:44:55.458400","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:09","port":2,"time":"2022-12-22 19:44:55.458421","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:0a","port":2,"time":"2022-12-22 19:44:55.458443","type":"trace","vlan":1}]],"00:00:00:00:00:00:00:0a":[[{"dpid":"00:00:00:00:00:00:00:0a","port":1,"time":"2022-12-22 19:44:55.458469","type":"starting","vlan":100},{"dpid":"00:00:00:00:00:00:00:09","port":3,"time":"2022-12-22 19:44:55.458489","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:08","port":3,"time":"2022-12-22 19:44:55.458509","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:07","port":3,"time":"2022-12-22 19:44:55.458529","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:06","port":3,"time":"2022-12-22 19:44:55.458549","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:05","port":3,"time":"2022-12-22 19:44:55.458569","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:04","port":3,"time":"2022-12-22 19:44:55.458589","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:03","port":3,"time":"2022-12-22 19:44:55.458610","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:02","port":3,"time":"2022-12-22 19:44:55.458631","type":"trace","vlan":1},{"dpid":"00:00:00:00:00:00:00:01","port":2,"time":"2022-12-22 19:44:55.458652","type":"trace","vlan":1}]]}
* Closing connection 0