-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added VNF resource consumption functions #78
Added VNF resource consumption functions #78
Conversation
…der now attempts to load functions
Local tests work and produced the intended output. Travis tests encounter severe problems, do to the fact that "test_simulator.py" do not use the simulator interface function
|
SF load is now recorded from the beginning. Next commit will change travis.yaml to explicit load resource funtions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Is this ready to merge?
@qarawlus Please have a look at the changes, so you are aware 👍
Now it should be ready to merge. |
Closes #54 |
for node_id, placed_sf_list in actions.placement.items(): | ||
available_sf = {} | ||
for sf in placed_sf_list: | ||
available_sf[sf] = self.simulator.params.network.nodes[node_id]['available_sf'].get(sf, {'load': 0.0}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each node stores a list of SFs that where placed and there current load as a node attribute. When changing the placement the list has to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the .get(sf, {'load': 0.0})
gets the current load of the SF at the node and defaults to 0 if the SF wasn't available?
When testing the changes with our RL algorithm, I ran into the following error:
Seems like there's something wrong with the available SF at each node. I'm going through the code to better understand what's the issue right now. Thankful for any tips you might have. |
I think I have the error: When reducing the load at an SF because a flow is done processing, It's possible that the placement changes in between starting and stopping to process a flow and that at the time of accessing the dict, the SF is no longer available at the node. |
Yes, i think that is exactly what happens. In the previous version a SF could be removed while a flow is still in process without violating capacity demands, the capacity when finished processing would simply increased. With this version the load has to be recorded precisely. |
Yep. I'm not sure what would be the best way to handle this.
|
a) Drop flows when VNF is removed
b) Allow flows to finish processing
Any thoughts or ideas? |
I need to get rid of the error, so my current fix goes with b) and allows flows to finish processing when an SF is removed. #80 But it doesn't account for resource consumption of these (almost) removed VNFs and simply ignores it. Not perfect, but hopefully not a big issue - should keep it in mind anyways. This is in line with what we had previously. Any better solution is more than welcome |
I think option a) would lead to more serious consequences especially when a flow is simultaneously processed by multiple VNFs. Option b) is the way to go. The primary decision if a flow gets processed is based on the placement. If a SF is no longer included in the placement a flow will not be processed by it. |
Yes, that's also what I thought. Not sure how much effort this would be? |
I'm looking into it. |
VNF/SF can no specifiy a resource function which defines the needed capacity dependent on the individual SF load. If no resource function is specified, the default function
f(x)=x
will be used. When using resource functions a path parameter must be passed to thesimulator.init
function.The
reader
when constructing thesf_list
will try to load "A.py" in the specified path."A.py" has to contain a
resource_function(load)
function.Note: do not include ".py" in the yaml resource_function_id field.
Note: resource functions are optional. Passing no path to the simulator will assign the default function to all SFs with warnings.