1: Spawn a thread to aggregate and send application id and throughput

to QoS Classifier for QoS estimation and QoS monitoring (every second).

2: While Receiving a oneM2M request from Traffic Generator Do

3: Extract URI from the request.

4: Extract Reliability from URI.

5: If URI does not exist in application-slice mapping table Then

6: Insert URI with extracted Reliability as new application type

with slice state NOT READY in the application-slice mapping table.

7: End If

8: If not yet executed, spawn a thread to execute the function

Handle_QoS_Classifier_Messages().

9: If slice state for URI is READY Then

10: If buffer for URI application type is not empty Then

11: Spawn a thread to clear buffer by forwarding all requests in it

to the corresponding slice.

12: End If

13: Spawn a thread to forward oneM2M request to the URI corresponding slice.

14: Else

15: Store request in a buffer.

16: End If

17: End While

18: Function Handle_QoS_Classifier_Messages()

19: While received notification from QoS Classifier Do

20: If notification == GOT_NEW_SLICE Then

21: Change the URI corresponding slice state from NOT READY

to READY in application-slice mapping table.

22: Else If notification == EXECUTING_SCALABILITY Then

23: Change the URI corresponding slice state from READY

to NOT READY in application-slice mapping table.

24: Suspend sending message transmission statistics of the

application under scale-up/down.

25: Else If notification == FINISHED_SCALABILITY Then

26: Change the URI corresponding slice state from NOT READY

to READY in application-slice mapping table.

27: Resume sending message transmission statistics of the

corresponding application.

28: End If

29: End While

30: End Function