LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-26-2007, 08:26 AM   #1
danfou
Member
 
Registered: Nov 2006
Posts: 46

Rep: Reputation: 15
tc htb question


I'm using tc htb to shaper my traffic:

The total traffic is 400Mbit
Since I shape it 100Mbit, I can see 140Mbit of my traffic.
When I shape it to 200Mbit, I can see 270Mbit of my traffic.

Does anyone know why this is happening? How can I make it exactly certain rate?

tc qdisc add dev eth2 handle 1:0 root htb default 1
tc class add dev eth2 parent 1:0 classid 1:1 htb rate 100Mbit ceil 100Mbit
tc filter add dev eth2 parent 1:0 protocol ip u32 match ip protocol 47 0xff classid 1:1

Thanks
 
Old 12-26-2007, 08:10 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I am not completely sure (I studied a hundred examples and copied eventually one of them) but I thought you had to define a class first with speed settings, and below that class a qdisc. So to see, your qdisc has no parent class at all.

This is an excerpt from my own shaper:

Code:
$TC qdisc add dev $nic_ext root handle 1:0 htb default 90
        $TC class add dev $nic_ext parent 1:0 classid 1:1 htb rate 20mbit burst 15k

        #: Highest priority, full bw, higest CIR, 704/1024
        $TC class add dev $nic_ext parent 1:1 classid 1:10 htb rate 704kbit ceil 1700kbit
        $TC qdisc add dev $nic_ext parent 1:10 handle 10 sfq perturb 10
        $TC filter add dev $nic_ext parent 1:0 protocol ip prio 10 handle 10 fw classid 1:10
The first class I define (1:1) is for the entire network interface.

Then comes a first class (1:10 -> 704/1024) below this one, and below this class there is a qdisc.

The filter is obvious.

jlinkels
 
Old 12-26-2007, 09:10 PM   #3
danfou
Member
 
Registered: Nov 2006
Posts: 46

Original Poster
Rep: Reputation: 15
I tried the following commands, it still doesn't work. I mean it shape some traffic but the traffic is still far above 100Mbit

tc qdisc add dev eth4 handle 1:0 root htb default 1
tc class add dev eth4 parent 1:0 classid 1:1 htb rate 110Mbit ceil 110Mbit
tc class add dev eth4 parent 1:1 classid 1:10 htb rate 100Mbit ceil 100Mbit
tc qdisc add dev eth4 parent 1:10 handle 10 sfq perturb 10
tc filter add dev eth4 parent 1:0 protocol ip prio 1 u32 match ip protocol 47 0xff classid 1:10

In fact, I only have one class of traffic in eth4, So I also tried only the first two line, it is still far above 100Mbit

tc qdisc add dev eth4 handle 1:0 root htb default 1
tc class add dev eth4 parent 1:0 classid 1:1 htb rate 110Mbit ceil 110Mbit
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTB question jayakrishnan Linux - Networking 5 06-19-2008 08:13 AM
htb in FC 5 eggoz Linux - Networking 0 04-12-2006 05:39 AM
Some hard question about classful traffic using HTB shaper byteclock Linux - Networking 1 10-05-2005 06:41 AM
HTB as a child of another HTB - doesn't work ddaas Linux - Networking 5 07-25-2005 03:21 AM
How To HTB linuxcolor Fedora 1 02-15-2005 07:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration