minisfc package

Subpackages

Submodules

minisfc.event module

@File : event.py @Time : 2024/06/18 15:57:24 @Author : Wang Xi @Version : 0.0 @Contact : wangxi_chn@foxmail.com @License : (C)Copyright 2023-2024, Wang Xi @Desc : None

class minisfc.event.Event(**kwargs)

基类:object

class minisfc.event.EventType(value)

基类:Enum

An enumeration.

NOTHING = 1
SFC_ARRIVE = 2
SFC_ENDING = 3
TOPO_CHANGE = 4
class minisfc.event.Schedule(substrateTopo: SubstrateTopo, serviceTopo: ServiceTopo)

基类:object

step() Tuple[Event, bool]

minisfc.net module

@File : net.py @Time : 2024/06/18 16:39:32 @Author : Wang Xi @Version : 0.0 @Contact : wangxi_chn@foxmail.com @License : (C)Copyright 2023-2024, Wang Xi @Desc : None

class minisfc.net.Minisfc(substrateTopo: SubstrateTopo, serviceTopo: ServiceTopo, vnfManager: VnfManager, sfcSolver: Solver, ueManager: UeManager | None = None, use_container: bool = False)

基类:object

addCLI()
addRemoteController(name='c0', ip='127.0.0.1', port=6653)
ready()
start()
stop()
update()

minisfc.solver module

@File : solver.py @Time : 2024/06/18 15:32:23 @Author : Wang Xi @Version : 0.0 @Contact : wangxi_chn@foxmail.com @License : (C)Copyright 2023-2024, Wang Xi @Desc : None

class minisfc.solver.GreedySolver(substrateTopo: SubstrateTopo, serviceTopo: ServiceTopo, **kwargs)

基类:RadomSolver

solve_embedding(event: Event) Solution
solve_migration(event: Event) Solution
class minisfc.solver.RadomSolver(substrateTopo: SubstrateTopo, serviceTopo: ServiceTopo, **kwargs)

基类:Solver

check_constraints(event: Event) SOLUTION_TYPE
get_latency_running() float
initialize(vnfManager: VnfManager)
solve_embedding(event: Event) Solution
solve_ending(event: Event) Solution
solve_migration(event: Event) Solution
class minisfc.solver.SOLUTION_TYPE(value)

基类:Enum

An enumeration.

CHANGE_FAILED_FOR_LATENCY = 11
CHANGE_FAILED_FOR_NODE_CPU = 8
CHANGE_FAILED_FOR_NODE_RAM = 9
CHANGE_SUCCESS = 7
END_SUCCESS = 12
NOTHING = 1
SET_FAILED_FOR_LATENCY = 6
SET_FAILED_FOR_NODE_CPU = 3
SET_FAILED_FOR_NODE_RAM = 4
SET_SUCCESS = 2
class minisfc.solver.Solution

基类:object

list[SubstrateNetwork.link]] Description: map from ServiceChain links to SubstrateNetwork links

Type:

dict[ServiceChain.link

map_node: dict[slice(<class 'int'>, <class 'int'>, None)]

SubstrateNetwork.node] Description: map from ServiceChain nodes to SubstrateNetwork nodes

Type:

dict[ServiceChain.node

resource: dict[slice(<class 'str'>, list[int], None)]

list[value]] Description: the resources allocated on each VNF and link in the ServiceChain

Type:

dict[resource name

class minisfc.solver.Solver(substrateTopo: SubstrateTopo, serviceTopo: ServiceTopo, **kwargs)

基类:object

initialize(vnfManager: VnfManager) None
loadParam()
saveParam()
solve_embedding(event: Event) Solution
solve_ending(event: Event) Solution
solve_migration(event: Event) Solution

minisfc.topo module

@File : topo.py @Time : 2024/06/17 19:44:24 @Author : Wang Xi @Version : 0.0 @Contact : wangxi_chn@foxmail.com @License : (C)Copyright 2023-2024, Wang Xi @Desc : None

class minisfc.topo.ServiceTopo(idList: list[int], lifeTimeDict: dict[slice(<class 'int'>, [<class 'float'>, <class 'float'>], None)], endPointDict: dict[slice(<class 'int'>, list[int, int], None)], vnfRequstDict: dict[slice(<class 'int'>, <class 'list'>, None)], qosRequesDict: dict[slice(<class 'int'>, <class 'list'>, None)], arriveFunParamDict: dict[slice(<class 'int'>, <class 'list'>, None)] = None)

基类:object

class minisfc.topo.SubstrateTopo(timeList: list[float], adjacencyMatDict: dict[slice(<class 'float'>, <class 'numpy.ndarray'>, None)], weightMatDict: dict[slice(<class 'float'>, <class 'numpy.ndarray'>, None)], nodeResourceDict: dict[float, slice(<class 'str'>, <class 'numpy.ndarray'>, None)], linkResourceDict: dict[float, slice(<class 'str'>, <class 'numpy.ndarray'>, None)])

基类:Topo

changeTopo(time)
class minisfc.topo.Topo

基类:Graph

get_adjacency_matrix()

Get the attribute values of all links in network

参数:

link_attrs_name (str) -- "capacity/remain/request"+"_"+"band"

返回:

int]: edge:value

返回类型:

dict[tuple[int,int]

Get the attribute values ​​of the links around all node aggregates

参数:

link_attrs_name (str) -- "capacity/remain/request"+"_"+"band"

返回:

values

返回类型:

list[int]

get_all_nodes_attrs_values(node_attrs_name: str) list[int]

Get the attribute values of all nodes in network

参数:

node_attrs_name (str) -- "capacity/remain/request"+"_"+"cpu/ram"

返回:

values

返回类型:

list[int]

get_kshortest_paths(source, target, k)
get_sum_resource_list(attrs_name: str)

Get the sum of attribute values of network

参数:

attrs_name (str) -- "capacity/remain/request"

返回:

value

返回类型:

list[int,int,int]

Get the attribute values of a link

参数:
  • link_id (tuple[int,int]) -- Networkx index of link

  • link_attrs_name (str) -- "capacity/remain/request"+"_"+"band"

  • opration (str) -- "get/set/decrease/increase"

  • value (int) -- opration aim value

返回:

value

返回类型:

int

opt_node_attrs_value(node_id: int, node_attrs_name: str, opration: str, value=0) int

Get the attribute values of a node

参数:
  • node_id (int) -- Networkx index of node

  • node_attrs_name (str) -- "capacity/remain/request"+"_"+"cpu/ram"

  • opration (str) -- "get/set/decrease/increase"

  • value (int) -- opration aim value

返回:

value

返回类型:

int

minisfc.trace module

@File : trace.py @Time : 2024/06/18 22:33:22 @Author : Wang Xi @Version : 0.0 @Contact : wangxi_chn@foxmail.com @License : (C)Copyright 2023-2024, Wang Xi @Desc : None

class minisfc.trace.Trace

基类:object

delete()
static get_run_id() str
static get_time_stamp()
ready(fields: list)
set(filename: str | None = None)
write(contextDict: dict)
class minisfc.trace.TraceNFVI

基类:Trace

class minisfc.trace.TraceResult

基类:Trace

Module contents