[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpW14Vd=XAQHr537WD4p3VwYAjfMVW7TbZ6xhRq_xRzFJg@mail.gmail.com>
Date: Tue, 3 Jul 2018 21:54:40 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: tflynn@...avis.edu
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: QDisc Implementation: Setting bit rate and getting RTT
On Tue, Jul 3, 2018 at 4:14 PM Taran Lynn <tflynn@...avis.edu> wrote:
>
> Hello,
> I'm new to linux development and am working on creating a qdisc module,
> similar to those under net/sched/sch_*.c. Currently I'm stuck on two
> things.
>
> 1. What's the best way to set the maximum bit rate?
> 2. How do I determine the RTT for packets?
>
> For (1) I'm currently tracking the number of bits sent, and only sending
> packets if they stay within the appropriate rate bound. Is there a better
> way to do this? I've looked at net/sched/sch_netem.c, and as far as I can
> tell it determines the delay between packets for a given rate and sends
> them after that delay has passed. However, when I tried to do this I got
> inconsistent rates, so I think I may be missing something.
It depends on what you want to do for bandwidth control.
If you simply want traffic policing, take a look at gen estimator
in net/core/gen_estimator.c. net/sched/act_police.c is an example
of how it is used.
If you want traffic shaping, it is harder, the simplest one in kernel
is probably net/sched/sch_tbf.c.
>
> As for (2) I'm not sure where to start.
Why do you care about RTT in Qdisc layer? RTT is kinda TCP
thing, while Qdisc is at L2...
Powered by blists - more mailing lists