GeminiLight / virne

Virne is a simulator for resource allocation problems in network virtualization, mainly for virtual network embedding (VNE). It also is adaptable to VNE's variants, such as service function chain deployment (SFC Deployment), network slicing, etc.
https://virne.readthedocs.io
Apache License 2.0
94 stars 18 forks source link

Hoping Virne to support multiple link/path attributes #21

Closed lin-yifan1 closed 10 months ago

lin-yifan1 commented 1 year ago

I used virne to create a physical network and several virtual networks with both bandwidth and latency attributes, by modifying the yaml setting files. However, when I ran the program, I encountered the following error:

Traceback (most recent call last):
  File "/home/*/virne/main.py", line 25, in <module>
    run(config)
  File "/home/*/virne/main.py", line 13, in run
    scenario.run()
  File "/home/*/virne/virne/base/scenario.py", line 99, in run
    solution = self.solver.solve(instance)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/solver/heuristic/node_rank.py", line 45, in solve
    link_mapping_result = self.link_mapping(v_net, p_net, solution)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/solver/heuristic/node_rank.py", line 84, in link_mapping
    link_mapping_result = self.controller.link_mapping(v_net, p_net, solution=solution, 
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 812, in link_mapping
    return self.safely_link_mapping(v_net, p_net, solution, sorted_v_links, shortest_method, k, inplace)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 845, in safely_link_mapping
    route_result, route_info = self.route(v_net, p_net, v_link, p_pair, solution, shortest_method=shortest_method, k=k)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 423, in route
    return self.safely_route(v_net, p_net, v_link, pl_pair, solution, shortest_method, k, rank_path_func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 459, in safely_route
    check_result, check_info = self.check_path_constraints(v_net, p_net, v_link, p_path)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 238, in check_path_constraints
    result, info = self.check_link_constraints(v_net, p_net, v_link, p_link)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 208, in check_link_constraints
    final_result, link_satisfiability_info = self.check_attributes(v_link, p_link, self.all_link_attrs)
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/*/virne/virne/base/controller.py", line 135, in check_attributes
    result, value = attr.check(v, p)
    ^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable bool object

By examining the code I concluded that Virne does not support multiple link attributes or path constraints (e.g, latency) checking (I noticed the TODO sign in the check_path_constraints method). Hoping the new version of Virne will support these features.


Btw, 这个项目真的特别棒!VNE 领域的算法很多,但代码真的很少,希望大佬可以继续完善这个项目,感激不尽。

GeminiLight commented 1 year ago

Thanks! This feature has been in our update plans. Actually, latency constraints in VNE are complex due to multifaceted guarantees at various levels, including link-to-path and graph-to-graph. We intend to implement this feature as concisely and easily as possible. Please look forward to the update of the later version of Virne!