TL-System/ns.py

[FR]

pancypeng opened this issue · 0 comments

Problem: Implementation of supporting class-based fair scheduling.

Class-based fair scheduling is very common in real networks. I think it will be awesome if ns.py can support this. In ns.py==0.2.4, it can somehow provide the classed-based serving, but I am afraid it is different from the way that the real mechanism works.

Take Class Based Weighted Fair Queuing (CBWFQ) as an example, it provides congestion-management support for user-defined traffic classes. The mapping between flows to traffic classes are user-defined. A FIFO queue is reserved for each class, and a flow belonging to a class is directed to the queue for that class. The weight of each class is also user-defined.

The mechanism of CB-DRR or CB-SP is similar to the above.

Describe the solution you'd like
To implement a dictionary "flows_to_classes" that acts as a mapping between flow IDs and class IDs at a CBWFQ.
For example, in a fattree network, the dictionary will match a tri-tuple (flow ID, node ID, port ID) to a class ID at a WFQ.
The number of the classes, and the weights of each class are user-defined, independent of the actual flows passing through the port.

Additional context
This is a bug in how ns.py==0.2.4 works in terms of CBWFQ.
For example, in examples/fattree.py, a weight is assigned to each flow (Line 45). I think we should assign the weights to classes instead of queues, and use a flows_to_classes mapping.