Skip to content
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

Scheduling algorithms #4

Open
patrickkasper opened this issue May 28, 2022 · 2 comments
Open

Scheduling algorithms #4

patrickkasper opened this issue May 28, 2022 · 2 comments

Comments

@patrickkasper
Copy link

i have a question i saw when i put printf for simulator time in scheduling algorithms:
there is a for loop on
GetNQueueDiscClasses
that is dequeueing items but i see sometimes when i print
Simulator::Now()
the time is the same for different items dequeued. when i think it looks the dequeue operation should advance the time once item is successfully dequeued but i dont see this in code.

also, who calls
GenQueueDisc::DoDequeue() ? i couldn't find its caller.

thank you!

@vamsiDT
Copy link
Member

vamsiDT commented May 28, 2022

Hi

  1. If you would like to print the time when a packet is dequeued, please make sure that the print statement is inside the if condition within the above mentioned for loop. This if is true when a packet is dequeued from the internal queue. The for loop runs overs over all the internal queues (at most one round) until a packet is available to dequeue. Sim time does not advance within the for loop. But it advances if a packet is found and when we break from the for loop.
  2. GenQueueDisc is per port. So if you place a print statement in GenQueueDisc, print will be triggered due to events on all the ports. This could be a possible reason for packets dequeued at the same time.
  3. Point to point net device triggers the Dequeue function. I think here is where advancing the time appears in the TransmitStart function if I am not wrong.

Hope it clears your question.

@patrickkasper
Copy link
Author

thank you. i put the print statements in the if:
if ((item = GetQueueDiscClass (dequeueIndex)->GetQueueDisc ()->Dequeue ()) != 0)
the problem is even when i define an array per priority in GenQueueDisc class, and saving current time in it, it still has duplicate values (different GetQueueDisc will have their own array and it does not matter if there are duplicates across them). this way time mark should be unique for priority in that port and i did not expect to see duplicate vals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants