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

calc-cbs-params.py uses kbit/s and bytes inconsistently #25

Open
nmuh opened this issue May 3, 2021 · 1 comment
Open

calc-cbs-params.py uses kbit/s and bytes inconsistently #25

nmuh opened this issue May 3, 2021 · 1 comment

Comments

@nmuh
Copy link

nmuh commented May 3, 2021

Hello,
I'm currently researching on CBS and my computations on the CBS parameters differed from the script provided in this project.
I had a look into it and found a potential bug in lines 28-29:

hicredit = math.ceil(idleslope_a * frame_non_sr / link_speed)
locredit = math.ceil(sendslope_a * max_frame_size_a / link_speed)

The variables idleslope_a, sendslope_a and linkspeed are measured in kbit/s

idleslope += int(stream['rate']) * frame_size * 8 / 1000

parser.add_argument('-S', dest='link_speed', default=1000000, type=int,
help='Link speed in kbps')

sendslope_a = idleslope_a - args.link_speed

while max_frame_size_a and frame_non_sr are in Byte (if I did not miss anything).
The usage of kbit/s and byte in one equation sounds wrong to me. Also Annex L section L.2 a) shows an example, where all computations are done in bit and bit/s.

If I missed a point somewhere in the code or the specification, I'd be thankful for pointing it out.

Thanks!

@edersondisouza
Copy link
Collaborator

Hi @nmuh,

You didn't missing anything on the code or specification. Note that calc-cbs-params.py returns results to be used to set the CBS qdisc (man 8 tc-cbs), which expects hicredit and locredit to be in bytes.

So it's more of a convenience to just copy its output as input for setting up CBS qdisc - without having to convert to bytes.

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