vSFC
Bases: VirtualEntity
Source code in PyCloudSim\entity\v_sfc.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
after
property
Same as entity.
entry
property
The entry point of the SFC, aka the microservice that will accept user's request at the beginning.
exit
property
The exit point of the SFC, aka the microservice that will return user's request at the last.
internal
property
Return true if the vSFC is internal, aka the engaged microservices does not need to communicate with the user.
microservices
property
The microservices of the vSFC.
network_service: Optional[vNetworkService]
property
The associated network service.
path
property
The path of the engaged microservices, must be a list of tuple of two microservice and request type.
ready
property
Return true if the vSFC is ready, aka all its microservices are ready.
users
property
The users of the vSFC.
__init__(entry=None, exit=None, path=None, network_service=None, internal=False, at=simulation.now, after=None, label=None)
Create a vSFC (with respective of a network service)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entry |
Optional[vMicroservice]
|
the entry point of the SFC, aka the microservice that will accept user's request at the beginning. Defaults to None, must be set if the sfc is not internal. |
None
|
exit |
Optional[vMicroservice]
|
the exit point of the SFC, aka the microservice that will return user's request at the last. Defaults to None. |
None
|
path |
Optional[List[Tuple[vMicroservice, vMicroservice]]]
|
the path of the engaged microservices, must be a list of tuple of two microservice. Defaults to None. |
None
|
network_service |
Optional[vNetworkService]
|
the associated network service. Defaults to None. |
None
|
process_length |
Union[int, Callable]
|
the process length of each request. Defaults to 100, can alse be a callable function. |
required |
packet_size |
Union[int, Callable]
|
the packet size of each packet. Defaults to 65536, can alse be a callable function. |
required |
num_packets |
Union[int, Callable]
|
the number of packets per request. Defaults to 1, can alse be a callable function. |
required |
priority |
int
|
the priority of the SFC. Defaults to 0. |
required |
num_users |
int
|
the number of users. Defaults to 1. |
required |
internal |
bool
|
set true for internal SFC, aka the engaged microservices does not need to communicate with the user. Defaults to False. |
False
|
retry |
bool
|
if true, failed user will have its request being re-initialized. Defaults to False. |
required |
at |
Union[int, float, Callable]
|
when the SFC will be created. Defaults to simulation.now. |
now
|
after |
Optional[Entity | List[Entity]]
|
the other SFCs that must complete before this SFC. Defaults to None. |
None
|
label |
Optional[str]
|
short description of this SFC. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_sfc.py
evaluate()
Evaluate the vSFC and all its microservices. Change the status of the vSFC to READY if all its microservices are ready.