atlanticwave-sdx / pce

Path Computation Element for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
0 stars 3 forks source link

latency required in a path cannot defaults to zero - should be infinite #175

Closed italovalcy closed 4 months ago

italovalcy commented 7 months ago

Hi,

Two constraints can be given when search for a path: latency and bandwidth. Both of them are optional. Since they are optional, the default value for latency cannot be zero (0) as per: https://github.com/atlanticwave-sdx/pce/blob/main/src/sdx_pce/topology/temanager.py#L237

In the way it is, when a request comes without latency requirements (valid request), the reply would be:

sdx-controller    | INFO:sdx_pce.topology.temanager:Setting required_latency: 0, required_bandwidth: 0
sdx-controller    | WARNING:sdx_pce.load_balancing.te_solver:The problem does not have an optimal solution.

One possibility would be to initialize latency with something like:

diff --git a/src/sdx_pce/topology/temanager.py b/src/sdx_pce/topology/temanager.py
index f7e4000..ae32eb0 100644
--- a/src/sdx_pce/topology/temanager.py
+++ b/src/sdx_pce/topology/temanager.py
@@ -234,7 +234,7 @@ class TEManager:
             return None

         required_bandwidth = request.bandwidth or 0
-        required_latency = request.latency or 0
+        required_latency = request.latency or float("inf")
         request_id = request.id

         self._logger.info(
italovalcy commented 4 months ago

Hi team, this seems to be already fixed by PR https://github.com/atlanticwave-sdx/pce/pull/178