Implementing a simple Round Robin Fair Queue scheduling algorithm for data packets considering 3 data streams

조회 수: 21 (최근 30일)
Hello Team,
We are trying to implement the Round Robin Fair queue scheduling algorithm using simulink and further have to generate C++ code from this model. Here we are using
Here in this algorithm data packets are sorted based on the priority of each packet and then further added into the respective queues (FIFO), for simplicity we have considered 3 queues (data streams). Then data outgoing from these queues have to scheduled in fair round robin fashion. To define fairness here we are considering that for non empty queue with high priority 3 packets are serviced first, then 2 packets from Mid priority queue and 1 packet from low priority queue.
If any of the queue is empty then next queue has to be considered for scheduling.
My current approach:
Sorted the data into different priority queues, for the queue I am using queue block from messages & events however I am finding it difficult to track number packets in the queue and number of packets departed.
I am sharing the file here, kindly request you to help me in this regard.
Many thanks in advance.
Best Regards,
Srikar

답변 (1개)

Githin George
Githin George 2023년 11월 3일
Hello,
I understand you are trying to implement a Round Robin Fair Queue Scheduling algorithm for data streams of 3 different priorities and you are facing difficulty in tracking the number of packets in the queue and number of packets departed.
I would suggest modelling a control logic to identify which queue to select data from after every scheduling event. I’ve attached a Simulink model here that does the exact same.
The subsystem basically takes in as input the ‘current state’ of the scheduler and ‘queue state’ values and outputs the ‘next state’ of the scheduler based on the following logic. The states of the scheduler are as follows. State 0 – entry state. State 1 – High priority queue, 1 packet sent. State 2 – High priority queue, 2 packets sent. Similarly, till state 6. The logic models how the state change occurs, and based on the output state of the subsystem, the correct message can be retrieved from the queue.
I hope this helps.
  댓글 수: 1
Srikar
Srikar 2023년 11월 7일
Hello George,
Thanks to answer, but I wasn't able to open this model as it is saved in using 2023a. I am currently using R2022b.
Would be nice if you may share me with back versioned slx file. I am eager to check the model changes.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by