1: Connect to SDN Controller

2: Get current network topology from SDN Controller

3: Set All_Slices = Calculate all possible sequence of paths from input

switch to output switch in the current network topology.

4: Set All_IP_Addresses = List of IP addresses for new network slices

5: While new request from QoS Classifier arrives Do

6: If request == create slice Then

7: Spawn a thread to run the function Create_Slice()

8: Else If request == execute scalability Then

9: Spawn a thread to run the function Execute_Scalability()

10: Else If request == delete slice Then

11: Spawn a thread to run the function Delete_Slice()

12: End If

13: End While

14: Function Create_Slice (arguments: QoS values from QoS Classifier)

15: Retrieve next unused slice in All_Slices & next unused IP

address in All_IP_Addresses

16: Foreach path in the retrieved slice Do

17: Generate insert RESTCONF command

18: Send RESTCONF to SDN Controller

19: Set OpenFlow rules into the corresponding switch

20: End For

21: Set QoS using Linux tc qdisc

22: Instantiate a oneM2M server virtual machine and assign IP

23: Return the retrieved IP address

24: End Function

25: Function Execute_Scalability (arguments: new QoS values from QoS Classifier, slice IP)

26: Retrieve slice using slice IP

27: Set QoS using Linux tc qdisc

28: Return success

29: End Function

30: Function Delete_Slice (arguments: slice IP)

31: Retrieve slice using slice IP

32: Foreach path in the retrieved slice Do

33: Generate delete RESTCONF command

34: Send RESTCONF to SDN Controller

35: Delete OpenFlow rules from the corresponding switch

36: End For

37: Reset QoS using Linux tc qdisc

38: Set retrieved slice as unused in All_Slices & set IP as unused in All-IP-Addresses

39: Delete corresponding oneM2M server virtual machine

40: Return success

41: End Function