Giter Club home page Giter Club logo

geminilight / virne Goto Github PK

View Code? Open in Web Editor NEW
89.0 5.0 17.0 1.41 MB

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.

Home Page: https://virne.readthedocs.io

License: Apache License 2.0

Python 99.85% Shell 0.15%
vne nfv network-virtualization resource-management virtual-network-embedding vnf vnf-placement sfc network-slicing service-chain

virne's Introduction

virne's People

Contributors

geminilight avatar lin-yifan1 avatar wangfei4532 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

virne's Issues

The solver runs incorrectly

Hello author. In solver, only learning works, but the others, such as exact, heuristic, and meta_heuristic, report errors on how to run other methods successfully. Hope to get your reply, thank you very much!
Errors:
run(config)
File "D:\code\virne-main\virne-main\main.py", line 11, in run
solver_info = REGISTRY.get(config.solver_name)
File "D:\code\virne-main\virne-main\solver\registry.py", line 40, in get
raise KeyError(f'The solver {solver_name} is not in the {self.name} registry')
KeyError: 'The solver bfs_trials is not in the Virne registry'

image

AttributeError: 'PhysicalNetwork' object has no attribute '_adj'

Hello! 我在运行项目main.py时出现如下报错,可以看下是什么原因吗?

C:\Users\Administrator\virne\Scripts\python.exe C:/Git2023/virne/main.py

-------------------- Start --------------------

Use grc_rank Solver (Type = heuristic)...

dataset/p_net\100-waxman_[0.5-0.2]-cpu_[50-100]-max_cpu_None-bw_[50-100]-max_bw_None-ltc_[0.0-1.0]
*** Generate Physical Network from setting
Create VNR Simulator from setting
Traceback (most recent call last):
File "C:\Git2023\virne\main.py", line 47, in
run(config)
File "C:\Git2023\virne\main.py", line 15, in run
scenario = BasicScenario.from_config(Env, Solver, config)
File "C:\Git2023\virne\base\scenario.py", line 52, in from_config
env = Env(p_net, v_net_simulator, controller, recorder, counter, **vars(config))
File "C:\Git2023\virne\base\environment.py", line 336, in init
super(SolutionStepEnvironment, self).init(p_net, v_net_simulator, controller, recorder, counter, **kwargs)
File "C:\Git2023\virne\base\environment.py", line 20, in init
self.init_p_net = copy.deepcopy(p_net)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 146, in deepcopy
y = copier(x, memo)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\copy.py", line 272, in _reconstruct
y.setstate(state)
File "C:\Users\Administrator\virne\lib\site-packages\networkx\classes\reportviews.py", line 994, in setstate
self._adjdict = G._succ if hasattr(G, "succ") else G._adj
AttributeError: 'PhysicalNetwork' object has no attribute '_adj'

Process finished with exit code 1

`pyproject.toml` fails at `Getting requirements to build wheel` stage

I've been following this project for a few weeks now, and I was excited to see the addition of a pyproject.toml file recently.

Unfortunately, when I try to setup the project via pip install . in the root of the repo, I get the following error:

Defaulting to user installation because normal site-packages is not writeable
Processing /*REDACTED*/virne
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      /tmp/pip-build-env-ccn_0cd0/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
        warnings.warn(msg, _BetaConfiguration)
      running egg_info
      writing virne.egg-info/PKG-INFO
      writing dependency_links to virne.egg-info/dependency_links.txt
      writing requirements to virne.egg-info/requires.txt
      writing top-level names to virne.egg-info/top_level.txt
      reading manifest file 'virne.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      writing manifest file 'virne.egg-info/SOURCES.txt'
      Traceback (most recent call last):
        File "/usr/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-ccn_0cd0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-ccn_0cd0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-ccn_0cd0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 29, in <module>
      ValueError
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Could you try to take a look at this problem? And if you are able to setup the project in your machine, could you provide what version of Python and Pip are you using? I'm on Python 3.10.9, and Pip 23.0

Thanks in advance.

virne a3c_gcn_seq2seq errors

Hello author,the a3c_gcn_seq2seq runs successfully in DR-SFCP, but an error occurs when running in virne.My pytorch version matches the sparse version, but still generates errors.
dr-sfcp_a3c_gcn_seq2seq:
image
virne_a3c_gcn_seq2seq:
image

Hoping Virne to support multiple link/path attributes

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 领域的算法很多,但代码真的很少,希望大佬可以继续完善这个项目,感激不尽。

load gml with PhysicalNetwork.load_dataset

Hello, I want to repeat the experiment in a fixed network, so I need to serialize this network. But I'm running into a little problem. As required in Scenario, I set save_dir="./dataset/topology/" in config, and then specified topology: file_path: './dataset/topology/MultiDomain.gml'. Then naturally execute the get_p_net_dataset_dir_from_setting function at Scenario.from_config. But I don't understand why it is necessary to suffix the folder with some information about the cpu size to find the topology subfolder, for example "'./dataset/topology/MultiDomain-cpu_[50-100]-max_cpu_None-bw_[50-100]-max_bw_None-ltc_[0.0-1.0]'". Secondly, when carrying out the code of load_dataset or from_config.try, there will be a small problem that self.degree_benchmark cannot be found. It seems that the setting of degree_benchmark is in the generate_topology function, but neither of these steps requires generate_topology.

AttributeError: 'TimeWindowScenario' object has no attribute 'v_net_simulator'

hello! 我在使用scenario.py文件TimeWindowScenario类时,遇到如下报错,可以看下是什么原因吗?

Running with pg_cnn2 in epoch 0: 7%|▋ | 7/100 [00:01<00:24, 3.74it/s, ac=1.00, r2c=0.41, inservice=00007]Traceback (most recent call last):
File "C:\Git2023\virne\main.py", line 51, in
run(config)
File "C:\Git2023\virne\main.py", line 18, in run
scenario.run()
File "C:\Git2023\virne\base\scenario.py", line 164, in run
solution = Solution(self.v_net_simulator.v_nets[v_net_id])
AttributeError: 'TimeWindowScenario' object has no attribute 'v_net_simulator'
Running with pg_cnn2 in epoch 0: 7%|▋ | 7/100 [00:02<00:27, 3.35it/s, ac=1.00, r2c=0.41, inservice=00007]

Process finished with exit code 1

关于learning类型的solver的环境设置

您好,我尝试在main.py中运行一些learning类型的solver,发现pg_cnn,pg_cnn2,pg_mlp会因为使用了它们对应的SubEnv而导致如下报错:
image

似乎是因为使用它们时,程序都会在virne\base\scenario.py", line 52处:
env = Env(p_net, v_net_simulator, controller, recorder, counter, **vars(config))
将一个VirtualNetworkRequestSimulator类实例v_net_simulator传递给各自对应的SubEnv.init(),但它应该是接收VirtualNetwork类实例。

而使用a3c_gcn_seq2seq和pg_seq2seq两个solver时不会出现上述BUG,因为solver_info中指出了这两个solver直接使用了base.environment.SolutionStepEnvironment,而不是它们目录下的SubEnv。这是我打印的一些solver_info信息:
{'solver': <class 'solver.learning.pg_cnn.pg_cnn_solver.PgCnnSolver'>, 'env': <class 'solver.learning.pg_cnn.sub_env.SubEnv'>, 'type': 'r_learning'}
{'solver': <class 'solver.learning.pg_cnn2.solver.PgCnn2Solver'>, 'env': <class 'solver.learning.pg_cnn2.sub_env.SubEnv'>, 'type': 'r_learning'}
{'solver': <class 'solver.learning.a3c_gcn_seq2seq.solver.A3CGcnSeq2SeqSolver'>, 'env': <class 'base.environment.SolutionStepEnvironment'>, 'type': 'r_learning'}

请问这个bug如何解决?是否是因为solver.REGISTRY注册了旧的环境设置?谢谢!

nfvdeep那个算法跑不起来

你好,nfvdeep那个算法跑不起来,我跑的版本是当前版本,项目中的算法名称是pg_mlp,能帮忙看看吗,,求求了?

如何更改优化目标

最近在学习VNE,想利用pso算法来进行优化,如果我想要更改这个算法的优化目标,需要在代码的哪些部分进行更改?
谢谢大佬!

a3c_gcn_seq2seq's net seems does not work as paper describe

hello, I find a3c_gcn_seq2seq's net seems does not work as paper describe.I found that placement decisions are directly determined by logits = self.mlp(p_node_embeddings),and context is not used.is this right? Could you please explain why or how to modify it?Thanks in advance!!!
image

'pg_seq2seq'

您好,我尝试了一下 pg_seq2seq,然后我这边报了两个错误。

  1. 在 super(PGSeq2SeqSolver, self).init('pg_cnn', controller, recorder, counter, **kwargs) 这里多接收了 'pg_cnn'
  2. 在 seq2seq 中的 SubEnv 少了在调用 super 时少了三个变量 controller, recorder, counter

您这边有什么建议吗?或者怎样修改。

gae_vne

i want to learn about gae_vne based on its code, but i can not find it in the repository. really need help, thanks

是否可以计算物理网络的能耗

我想计算物理网络节点的能耗,请问要怎样修改项目代码可以计算节点的能耗。

在节点能耗中,CPU利用率是导致服务器功耗变化的主要原因。将节点i的功耗模型P Ni定义为:

图片1

其中Pb是服务器的基线功率,Pm是在最大容量服务时的总功率,µ是CPU利用率,
Pi = Pm−Pb代表µ的能量比例因子,s (i) = 1表示节点i活动,s (i) = 0表示节点i关闭。

Assert error

The runtime keeps reporting the assertion error 'AssertionError: Node 58 and Attribute cpu: 22 - 28'

Anyone knows what leads to this error when running pgcnn

image
in solver/learning/pg_cnn/sub_env:
in concatenate(*args, **kwargs)

ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)

The paths

Is it normal that in some cases the flow-conservation constraint doesn't always return the shortests paths in the 'link_paths' of the solution ?

'pg_mlp' implementation error

Hi,

When I try to run the solver 'pg_mlp', it popped out an error:
image

Please can you help what cause this issus?
Many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.