SF scheduler and monitoring documents
[docs.git] / manuals / developer-guide / src / main / asciidoc / sfc / odl-sfc-sf-scheduler-dev.adoc
1 === Service Function Scheduling Algorithms
2
3 ==== Overview
4 When creating the Rendered Service Path (RSP), the earlier release of SFC
5 chose the first available service function from a list of service function
6 names. Now a new API is introduced to allow developers to develop their own
7 schedule algorithms when creating the RSP. There are four scheduling algorithms
8 (Random, Round Robin, Load Balance and Shortest Path) are provided as examples
9 for the API definition. This guide gives a simple introduction of how to develop
10 service function scheduling algorithms based on the current extensible framework.
11
12 ==== Architecture
13 The following figure illustrates the service function selection framework and
14 algorithms.
15
16 .SF Scheduling Algorithm framework Architecture
17 image::sfc-sf-selection-arch.png["SF Selection Architecture",width=500]
18
19 The YANG Model defines the Service Function Scheduling Algorithm type
20 identities and how they are stored in the MD-SAL data store for the scheduling
21 algorithms.
22
23 The MD-SAL data store stores all informations for the scheduling algorithms,
24 including their types, names, and status.
25
26 The API provides some basic APIs to manage the informations stored in the
27 MD-SAL data store, like putting new items into it, getting all scheduling
28 algorithms, etc.
29
30 The RESTCONF API provides APIs to manage the informations stored in the MD-SAL
31 data store through RESTful calls.
32
33 The Service Function Chain Renderer gets the enabled scheduling algorithm type,
34 and schedules the service functions with scheduling algorithm implementation.
35
36 ==== Key APIs and Interfaces
37 While developing a new Service Function Scheduling Algorithm, a new class
38 should be added and it should extend the base schedule class
39 SfcServiceFunctionSchedulerAPI. And the new class should implement the abstract
40 function:
41
42 +public List<String> scheduleServiceFuntions(ServiceFunctionChain chain, int serviceIndex)+.
43
44 .input
45 * *+ServiceFunctionChain chain+*: the chain which will be rendered
46 * *+int serviceIndex+*: the initial service index for this rendered service path
47
48 .output
49 * *+List<String>+*: a list of service funtion names which scheduled by the
50 Service Function Scheduling Algorithm.
51
52 ==== API Reference Documentation
53 Please refer the API docs generated in the mdsal-apidocs.