kytos-ng / pathfinder

Kytos main path finder Network Application (NApp)
https://kytos-ng.github.io/api/pathfinder.html
MIT License
0 stars 7 forks source link

chore: parametrized `dynamic_single` pool to handle out of order events #58

Closed viniarck closed 11 months ago

viniarck commented 1 year ago

Related to https://github.com/kytos-ng/kytos/pull/399 (it depends on it)

Summary

Side note

We could still completely leverage async but it'll be addressed in a future opportunity on issue #57

Local Tests

I ran a stress test with link_flap on a ring topology (same script as used on this related PR https://github.com/kytos-ng/topology/pull/132), 500 flaps over 5 iteration to simulate topology update, by the end of the test pathfinder still found both expected paths:

❯ sudo python flap.py
link_flap test iteration 0
         waiting for 10 secs before next iteration
link_flap test iteration 1
         waiting for 10 secs before next iteration
link_flap test iteration 2
         waiting for 10 secs before next iteration
link_flap test iteration 3
         waiting for 10 secs before next iteration
link_flap test iteration 4
         waiting for 10 secs before next iteration
❯ curl -s -X POST -H 'Content-type: application/json' http://127.0.0.1:8181/api/kytos/pathfinder/v3/ -d '{"source": "00:00:00:00:00:00:00:01:1", "destination":  "00:00:00:00:00:00:00:03:
1"}' | jq -r
{
  "paths": [
    {
      "hops": [
        "00:00:00:00:00:00:00:01:1",
        "00:00:00:00:00:00:00:01",
        "00:00:00:00:00:00:00:01:4",
        "00:00:00:00:00:00:00:03:3",
        "00:00:00:00:00:00:00:03",
        "00:00:00:00:00:00:00:03:1"
      ],
      "cost": 5
    },
    {
      "hops": [
        "00:00:00:00:00:00:00:01:1",
        "00:00:00:00:00:00:00:01",
        "00:00:00:00:00:00:00:01:3",
        "00:00:00:00:00:00:00:02:2",
        "00:00:00:00:00:00:00:02",
        "00:00:00:00:00:00:00:02:3",
        "00:00:00:00:00:00:00:03:2",
        "00:00:00:00:00:00:00:03",
        "00:00:00:00:00:00:00:03:1"
      ],
      "cost": 8
    }
  ]
}

Mid test when the interface was going down, only one path was found as expected:

❯ curl -s -X POST -H 'Content-type: application/json' http://127.0.0.1:8181/api/kytos/pathfinder/v3/ -d '{"source": "00:00:00:00:00:00:00:01:1", "destination":  "00:00:00:00:00:00:00:03:
1"}' | jq -r
{
  "paths": [
    {
      "hops": [
        "00:00:00:00:00:00:00:01:1",
        "00:00:00:00:00:00:00:01",
        "00:00:00:00:00:00:00:01:3",
        "00:00:00:00:00:00:00:02:2",
        "00:00:00:00:00:00:00:02",
        "00:00:00:00:00:00:00:02:3",
        "00:00:00:00:00:00:00:03:2",
        "00:00:00:00:00:00:00:03",
        "00:00:00:00:00:00:00:03:1"
      ],
      "cost": 8
    }
  ]
}

End-to-End Tests

I'll dispatch e2e exec shortly and I'll post the results here later.