A scheduler and scheduling method implement peak service distance using a next
peak service time violated (NPTV) indication. A flow scheduled on a best effort
or weighted fair queue (WFQ) is identified for servicing and a frame is dispatching
from the identified flow. A next PSD time (NPT) being violated is checked for the
flow. Responsive to identifying the next PSD time (NPT) being violated for the
identified flow, a NPTV indicator is set. Alternatively, responsive to identifying
the next PSD time (NPT) not being violated for the identified flow, the NPTV indicator
is reset. A next PSD time (NPT) value is calculated for the flow. Checking for
more frames to be dispatched from the flow is performed. Responsive to identifying
no more frames to be dispatched from the flow, the NPTV indicator is utilized to
identify a calendar for attaching the flow upon a new frame arrival for the flow.
If the NPTV indicator is not set when the flow goes empty, upon a new frame arrival
for the flow, the flow is attached to a weighted fair queue (WFQ) ring using a
queue distance calculation. If the NPTV indicator is set when the flow goes empty,
upon a new frame arrival for the flow, then it is determined if the next PSD time
(NPT) value for the flow has been passed. If the next PSD time (NPT) value has
been passed, then the flow is attached to the weighted fair queue (WFQ) ring using
the queue distance calculation. If the next PSD time (NPT) value has not been passed,
then the flow is attached to a peak bandwidth service (PBS) calendar using the
next PSD time (NPT) value.