ns-3 Calendar Queue implementation - could/should it be reused for other purposes?

50 views
Skip to first unread message

Łukasz Dobrogowski

unread,
May 11, 2019, 10:02:50 AM5/11/19
to ns-3-users
Hello,

I'm trying to implement Carousel scheduler algorithm for traffic shaping in ns-3 as described in the paper: https://ai.google/research/pubs/pub46460

A crucial component of the algorithm is a calendar queue (timing wheel) which is used for planning the transmission of outgoing packets to rate limit and pace the traffic.

I was about to start implementing a TimingWheel class myself for this purpose, but did a cursory search across the codebase and found an existing implementation in src/core/model/calendar-scheduler.h. At first I thought that it'd be a generic (templated) implentation of the data structure so I could reuse it, but that's not the case - it is specifically hardcoded to use the ns3::Event class inside. So I'd pretty much have to either copy and paste the class and make sweeping changes to accomodate my use case (which will be probably scheduling packets or more specifically QDiscItems) or find a way to make the class generic enough to be able to serve both use cases.

I'll probably end up doing the first approach, although I don't really like doing code duplication - however it would be nice if somebody commented on whether what I wrote above is correct.

Kind regards,
Łukasz Dobrogowski

pdbarnes

unread,
May 19, 2019, 3:10:25 PM5/19/19
to ns-3-users
Yes the Scheduler implementations are coded pretty directly, which doesn’t facilitate reuse. It does ensure stable behavior, however, which is a good property in a simulator.

So you’ll have to implement your own, or borrow from the half dozen published implementations.

Peter

Łukasz Dobrogowski

unread,
May 31, 2019, 4:56:10 AM5/31/19
to ns-3-users
Thank you for confirming my assumptions, I did end up implementing my own.
Reply all
Reply to author
Forward
0 new messages