[LARTC] Re: HTB question, tokens.
On Thu, 2007-06-21 at 23:22 +0200, Christian Benvenuti wrote: Hi Mark, Hi, What exactly are the tokens? I thought each token allowed the sending of one byte, that tokens are stored in a bucket that can hold a max of burst tokens, and that this bucket is filled with tokens at rate. But theory does not seem to explain the tc -s .. output in the examples below. And I can't figure out why or how... Tokens normally represent the number of bytes the token bucket algorithm has accumulated. However, the numbers you see with tokens/ctokens are not expressed in bytes: they are expressed in units of time whose size is an approximation of 1 microsecond (how close a unit of time is to 1 microsecond depends on the kernel config). For example, the value of tokens that you see soon after configuring the HTB qdisc (and supposing no traffic has gone through the qdisc yet) is the number of pseudo microseconds that are necessary to transmit burst bytes at the rate rate configured on the class. Thanks for the explanation. I understand, the tokens as displayed are based on implementation details rather then pure concept/theory. Guess it also explains why the number of tokens can be negative. If a (c)bursts causes a class to exceed it's configured rate it will take some time (that many pseudo microseconds) for the rate to drop back to the configured rate. Right? It may look more complex that what it actually is. Just think of it as the number of (pseudo) microseconds the class can transmit at rate rate without terminating its tokens. The last sentence above should answer your questions in the second part of the email too. Indeed. Thanks, Mark. Regards /Christian [ http://benve.info ] #tc qdisc del dev eth0 root #tc qdisc add dev eth0 root handle 1: htb default 1 #tc class add dev eth0 parent 1:0 classid 1:1 htb rate 2mbit #tc -s -d class show dev eth0 class htb 1:1 root prio 0 quantum 25000 rate 2000Kbit ceil 2000Kbit burst 2599b/8 mpu 0b overhead 0b cburst 2599b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 10649 ctokens: 10649 #tc qdisc del dev eth0 root #tc qdisc add dev eth0 root handle 1: htb default 1 #tc class add dev eth0 parent 1:0 classid 1:1 htb rate 1mbit #tc -s -d class show dev eth0 class htb 1:1 root prio 0 quantum 12500 rate 1000Kbit ceil 1000Kbit burst 2099b/8 mpu 0b overhead 0b cburst 2099b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 17203 ctokens: 17203 Why do the amount of tokens go UP if the configured rate (and burst) is lower? (The commands where run from a script so these amounts of tokens available right after the creation of the class.) If I set the rate to 9mbit the amount of tokens is always lower then the burst size. Wouldn't that mean that there are always too few tokens available to actually burst the burst amount of data? Regards, Mark. ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: HTB question, tokens.
Hi Mark, Hi, What exactly are the tokens? I thought each token allowed the sending of one byte, that tokens are stored in a bucket that can hold a max of burst tokens, and that this bucket is filled with tokens at rate. But theory does not seem to explain the tc -s .. output in the examples below. And I can't figure out why or how... Tokens normally represent the number of bytes the token bucket algorithm has accumulated. However, the numbers you see with tokens/ctokens are not expressed in bytes: they are expressed in units of time whose size is an approximation of 1 microsecond (how close a unit of time is to 1 microsecond depends on the kernel config). For example, the value of tokens that you see soon after configuring the HTB qdisc (and supposing no traffic has gone through the qdisc yet) is the number of pseudo microseconds that are necessary to transmit burst bytes at the rate rate configured on the class. It may look more complex that what it actually is. Just think of it as the number of (pseudo) microseconds the class can transmit at rate rate without terminating its tokens. The last sentence above should answer your questions in the second part of the email too. Regards /Christian [ http://benve.info ] #tc qdisc del dev eth0 root #tc qdisc add dev eth0 root handle 1: htb default 1 #tc class add dev eth0 parent 1:0 classid 1:1 htb rate 2mbit #tc -s -d class show dev eth0 class htb 1:1 root prio 0 quantum 25000 rate 2000Kbit ceil 2000Kbit burst 2599b/8 mpu 0b overhead 0b cburst 2599b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 10649 ctokens: 10649 #tc qdisc del dev eth0 root #tc qdisc add dev eth0 root handle 1: htb default 1 #tc class add dev eth0 parent 1:0 classid 1:1 htb rate 1mbit #tc -s -d class show dev eth0 class htb 1:1 root prio 0 quantum 12500 rate 1000Kbit ceil 1000Kbit burst 2099b/8 mpu 0b overhead 0b cburst 2099b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 17203 ctokens: 17203 Why do the amount of tokens go UP if the configured rate (and burst) is lower? (The commands where run from a script so these amounts of tokens available right after the creation of the class.) If I set the rate to 9mbit the amount of tokens is always lower then the burst size. Wouldn't that mean that there are always too few tokens available to actually burst the burst amount of data? Regards, Mark. ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: HTB
Hi, What exactly happens if the sum of the children classes rate is bigger than the parent's? I would say that in most cases it would be a misconfiguration, especially if you have more layers of HTB classes. The bw you configure with rate is not going to be reserved properly if you do not respect the rule rate(parent)=Sum of rates(children). Anyway, the parent node does not throttle the children classes. Parents are there mainly to allow borrowing and sharing between sibling/descendant classes. What if the majority of these classes are using less than the minimum rate established (eg. 0kbps)? Why should this be a problem? In this case a class simply uses less than what it has been allocated. Depending on your configuration, other classes would probably be able to borrow more. Regards /Christian [ http://benve.info ] ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] Re: htb traffic shaping problem
gypsy wrote: Bugzilla-Redirect wrote: Yes, the output is below: eth0 Link encap:Ethernet HWaddr 00:11:09:2A:A6:F6 inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4244867 errors:0 dropped:0 overruns:0 frame:0 TX packets:1306632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3898905509 (3.6 GiB) TX bytes:1756030081 (1.6 GiB) Interrupt:19 Try a quantum 1514 then; that is correct for an ethernet device with an MTU of 1500. Perhaps reading the source code will give a clue about MPU and MTU? Frankly, I'd set it to whatever works as long as the rest of the status info looks right and not give a damn that it is huge. Even if ifconfig says 1500 there have been posts that say you don't get it with gig cards that do segmentation offload unless you can turn it off with ethtool. Apologies if this has already been said as I don't have all the thread. Andy. ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] Re: htb traffic shaping problem
I was not aware that segmentation offloading would cause a problem... and I do believe it's on. I think I'll just stuck with the high mtu for the moment then, as I would rather have the CPU savings then more accurate traffic controlling. Thanks. -Ryan Power At 07:48 AM 9/18/2006, Andy Furniss wrote: gypsy wrote: Bugzilla-Redirect wrote: Yes, the output is below: eth0 Link encap:Ethernet HWaddr 00:11:09:2A:A6:F6 inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4244867 errors:0 dropped:0 overruns:0 frame:0 TX packets:1306632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3898905509 (3.6 GiB) TX bytes:1756030081 (1.6 GiB) Interrupt:19 Try a quantum 1514 then; that is correct for an ethernet device with an MTU of 1500. Perhaps reading the source code will give a clue about MPU and MTU? Frankly, I'd set it to whatever works as long as the rest of the status info looks right and not give a damn that it is huge. Even if ifconfig says 1500 there have been posts that say you don't get it with gig cards that do segmentation offload unless you can turn it off with ethtool. Apologies if this has already been said as I don't have all the thread. Andy. ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] Re: htb traffic shaping problem
Bugzilla-Redirect wrote: Yes, the output is below: eth0 Link encap:Ethernet HWaddr 00:11:09:2A:A6:F6 inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4244867 errors:0 dropped:0 overruns:0 frame:0 TX packets:1306632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3898905509 (3.6 GiB) TX bytes:1756030081 (1.6 GiB) Interrupt:19 Try a quantum 1514 then; that is correct for an ethernet device with an MTU of 1500. Perhaps reading the source code will give a clue about MPU and MTU? Frankly, I'd set it to whatever works as long as the rest of the status info looks right and not give a damn that it is huge. -- gypsy ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] Re: htb traffic shaping problem
Yes, the output is below: eth0 Link encap:Ethernet HWaddr 00:11:09:2A:A6:F6 inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4244867 errors:0 dropped:0 overruns:0 frame:0 TX packets:1306632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3898905509 (3.6 GiB) TX bytes:1756030081 (1.6 GiB) Interrupt:19 And from ethtool: Settings for eth0: Supported ports: [ MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: g Wake-on: d Link detected: yes Thanks. -Ryan Power At 04:32 PM 9/14/2006, you wrote: Hi, could you check the mtu set on eth0 with an ifconfig? I tried my own setup and it works fine... Regards, Eric Janz Departamento de Sistemas Grupo Barceló Viajes ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] Re: htb traffic shaping problem
Hi,could you check the mtu set on eth0 with an ifconfig?I tried my own setup and it works fine...Regards,Eric Janz Departamento de SistemasGrupo Barceló ViajesC\ 16 de Julio, 7507009 Polígono Son CastellóPalma de Mallorca - BalearesTel.: +34 971 448030Fax.: +34 971 436986Bugzilla-Redirect [EMAIL PROTECTED]Enviado por: [EMAIL PROTECTED]13/09/2006 07:00Paralartc@mailman.ds9a.nlccAsunto[LARTC] Re: htb traffic shaping problemEric, here's the information you requested with the mtu set at 1500 (see further below):-[EMAIL PROTECTED]:~# tc -s -d qdisc show dev eth0qdisc htb 1: r2q 10 default 99 direct_packets_stat 335 ver 3.17 Sent 10388909 bytes 763 pkt (dropped 0, overlimits 372 requeues 0) rate 0bit 0pps backlog 0b 11p requeues 0qdisc sfq 10: parent 1:10 limit 128p quantum 1514b flows 128/1024 Sent 10328092 bytes 190 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 707234b 11p requeues 0qdisc sfq 99: parent 1:99 limit 128p quantum 1514b flows 128/1024 Sent 19927 bytes 188 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0[EMAIL PROTECTED]:~# tc filter show dev eth0filter parent 1: protocol ip pref 49151 u32filter parent 1: protocol ip pref 49151 u32 fh 801: ht divisor 1filter parent 1: protocol ip pref 49151 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10 match 01bb/ at 20filter parent 1: protocol ip pref 49152 u32filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 match 0050/ at 20[EMAIL PROTECTED]:~#-Gypsy, I've been playing with the mtu settings. I had initially set it to 1500, which is what the card should be at as the switch I have does not support jumbo frames. If I set the mtu to 40,000 for the class the giants go away and everything seems to fall back into place. However, this seems way off what it should be, do you have any idea whats happening? I cannot seem to adjust the mpu setting.-updated classes:tc class add dev eth0 parent 1: classid 1:1 htb rate 1000mbit ceil 1000mbit mtu 4tc class add dev eth0 parent 1:1 classid 1:10 htb rate 512kbit ceil 512kbit quantum 3000 mtu 4tc class add dev eth0 parent 1:1 classid 1:99 htb rate 900mbit ceil 1000mbit quantum 3000 mtu 4[EMAIL PROTECTED]:~# tc -s -d class show dev eth0class htb 1:99 parent 1:1 leaf 99: prio 0 quantum 3000 rate 90Kbit ceil 1000Mbit burst 489825b/256 mpu 0b overhead 0b cburst 539875b/256 mpu 0b overhead 0b level 0 Sent 31203 bytes 282 pkt (dropped 0, overlimits 0 requeues 0) rate 7264bit 8pps backlog 0b 0p requeues 0 lended: 282 borrowed: 0 giants: 0 tokens: 4695 ctokens: 4657class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 539875b/256 mpu 0b overhead 0b cburst 539875b/256 mpu 0b overhead 0b level 7 Sent 1126563 bytes 654 pkt (dropped 0, overlimits 0 requeues 0) rate 254848bit 15pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 4657 ctokens: 4657class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 3000 rate 512000bit ceil 512000bit burst 40255b/256 mpu 0b overhead 0b cburst 40255b/256 mpu 0b overhead 0b level 0 Sent 110 bytes 378 pkt (dropped 0, overlimits 0 requeues 0) rate 250464bit 10pps backlog 0b 6p requeues 0 lended: 372 borrowed: 0 giants: 0 tokens: -694028 ctokens: -694028[EMAIL PROTECTED]:~# tc -s -d qdisc show dev eth0qdisc htb 1: r2q 10 default 99 direct_packets_stat 338 ver 3.17 Sent 1609761 bytes 1180 pkt (dropped 0, overlimits 369 requeues 0) rate 0bit 0pps backlog 0b 3p requeues 0qdisc sfq 10: parent 1:10 limit 128p quantum 1514b flows 128/1024 Sent 1536378 bytes 509 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 29362b 3p requeues 0qdisc sfq 99: parent 1:99 limit 128p quantum 1514b flows 128/1024 Sent 32175 bytes 283 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0[EMAIL PROTECTED]:~# tc filter show dev eth0filter parent 1: protocol ip pref 49151 u32filter parent 1: protocol ip pref 49151 u32 fh 801: ht divisor 1filter parent 1: protocol ip pref 49151 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10 match 01bb/ at 20filter parent 1: protocol ip pref 49152 u32filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 match 0050/ at 20[EMAIL PROTECTED]:~#-Thanks.-Ryan PowerAt 04:00 AM 9/12/2006, you wrote:Message: 4Date: Tue, 12 Sep 2006 10:36:27
Re: [LARTC] Re: htb traffic shaping problem (Charlie Meyer)
Hi again,sorry for my late response. Could you give us also the output of tc -s -d qdisc show dev eth0tc filter show dev eth0It is very strange that the rate and ceil from class 1:10 are set to 512Kbit but the class's rate goes over 3,5Mbits!! ¿Maybe it is a bug?I'm preparing a similar setup (a linux wan router on a 100Mbit lan with 5Mbps upload/dowload to the Internet. We will see if I run into the same issues...Regards,Eric Janz Bugzilla-Redirect [EMAIL PROTECTED]Enviado por: [EMAIL PROTECTED]09/09/2006 21:56Paralartc@mailman.ds9a.nlccAsunto[LARTC] Re: htb traffic shaping problem (Charlie Meyer)Eric,I've attached the output from the command you requested below.I'm using kernel 2.6.17.12 and tc version ss060323. I'm have a nforce4 onboard giggabit controller using the forcedeth driver, if that makes a difference.Charlie,I'll take a look at the Apache model for throttling, thanks. I was going for tc because was going to try to add additional shaping to non-apache traffic once I got it working correctly.Thanks,-Ryan Powertc -s -d class show dev eth0class htb 1:99 parent 1:1 leaf 99: prio 0 quantum 3000 rate 90Kbit ceil 1000Mbit burst 451350b/8 mpu 0b overhead 0b cburst 501375b/8 mpu 0b overhead 0b level 0 Sent 48695 bytes 398 pkt (dropped 0, overlimits 0 requeues 0) rate 2704bit 2pps backlog 0b 0p requeues 0 lended: 398 borrowed: 0 giants: 0 tokens: 4326 ctokens: 4325class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 501375b/8 mpu 0b overhead 0b cburst 501375b/8 mpu 0b overhead 0b level 7 Sent 32821394 bytes 994 pkt (dropped 0, overlimits 0 requeues 0) rate 3556Kbit 10pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 1128 tokens: 4325 ctokens: 4325class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 3000 rate 512000bit ceil 512000bit burst 1755b/8 mpu 0b overhead 0b cburst 1755b/8 mpu 0b overhead 0b level 0 Sent 34256069 bytes 701 pkt (dropped 0, overlimits 0 requeues 0) rate 3554Kbit 8pps backlog 0b 105p requeues 0 lended: 596 borrowed: 0 giants: 1128 tokens: -52724 ctokens: -52724___LARTC mailing listLARTC@mailman.ds9a.nlhttp://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc-- ADVERTENCIA LEGAL El contenido de este correo es confidencial y dirigido unicamente a su destinatario. Para acceder a su clausula de privacidad consulte http://www.barceloviajes.com/privacy LEGAL ADVISORY This message is confidential and intended only for the person or entity to which it is addressed. In order to read its privacy policy consult it at http://www.barceloviajes.com/privacy ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: htb traffic shaping problem
Eric, here's the information you requested with the mtu set at 1500 (see further below): - [EMAIL PROTECTED]:~# tc -s -d qdisc show dev eth0 qdisc htb 1: r2q 10 default 99 direct_packets_stat 335 ver 3.17 Sent 10388909 bytes 763 pkt (dropped 0, overlimits 372 requeues 0) rate 0bit 0pps backlog 0b 11p requeues 0 qdisc sfq 10: parent 1:10 limit 128p quantum 1514b flows 128/1024 Sent 10328092 bytes 190 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 707234b 11p requeues 0 qdisc sfq 99: parent 1:99 limit 128p quantum 1514b flows 128/1024 Sent 19927 bytes 188 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 [EMAIL PROTECTED]:~# tc filter show dev eth0 filter parent 1: protocol ip pref 49151 u32 filter parent 1: protocol ip pref 49151 u32 fh 801: ht divisor 1 filter parent 1: protocol ip pref 49151 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10 match 01bb/ at 20 filter parent 1: protocol ip pref 49152 u32 filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 match 0050/ at 20 [EMAIL PROTECTED]:~# - Gypsy, I've been playing with the mtu settings. I had initially set it to 1500, which is what the card should be at as the switch I have does not support jumbo frames. If I set the mtu to 40,000 for the class the giants go away and everything seems to fall back into place. However, this seems way off what it should be, do you have any idea whats happening? I cannot seem to adjust the mpu setting. - updated classes: tc class add dev eth0 parent 1: classid 1:1 htb rate 1000mbit ceil 1000mbit mtu 4 tc class add dev eth0 parent 1:1 classid 1:10 htb rate 512kbit ceil 512kbit quantum 3000 mtu 4 tc class add dev eth0 parent 1:1 classid 1:99 htb rate 900mbit ceil 1000mbit quantum 3000 mtu 4 [EMAIL PROTECTED]:~# tc -s -d class show dev eth0 class htb 1:99 parent 1:1 leaf 99: prio 0 quantum 3000 rate 90Kbit ceil 1000Mbit burst 489825b/256 mpu 0b overhead 0b cburst 539875b/256 mpu 0b overhead 0b level 0 Sent 31203 bytes 282 pkt (dropped 0, overlimits 0 requeues 0) rate 7264bit 8pps backlog 0b 0p requeues 0 lended: 282 borrowed: 0 giants: 0 tokens: 4695 ctokens: 4657 class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 539875b/256 mpu 0b overhead 0b cburst 539875b/256 mpu 0b overhead 0b level 7 Sent 1126563 bytes 654 pkt (dropped 0, overlimits 0 requeues 0) rate 254848bit 15pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 4657 ctokens: 4657 class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 3000 rate 512000bit ceil 512000bit burst 40255b/256 mpu 0b overhead 0b cburst 40255b/256 mpu 0b overhead 0b level 0 Sent 110 bytes 378 pkt (dropped 0, overlimits 0 requeues 0) rate 250464bit 10pps backlog 0b 6p requeues 0 lended: 372 borrowed: 0 giants: 0 tokens: -694028 ctokens: -694028 [EMAIL PROTECTED]:~# tc -s -d qdisc show dev eth0 qdisc htb 1: r2q 10 default 99 direct_packets_stat 338 ver 3.17 Sent 1609761 bytes 1180 pkt (dropped 0, overlimits 369 requeues 0) rate 0bit 0pps backlog 0b 3p requeues 0 qdisc sfq 10: parent 1:10 limit 128p quantum 1514b flows 128/1024 Sent 1536378 bytes 509 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 29362b 3p requeues 0 qdisc sfq 99: parent 1:99 limit 128p quantum 1514b flows 128/1024 Sent 32175 bytes 283 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 [EMAIL PROTECTED]:~# tc filter show dev eth0 filter parent 1: protocol ip pref 49151 u32 filter parent 1: protocol ip pref 49151 u32 fh 801: ht divisor 1 filter parent 1: protocol ip pref 49151 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10 match 01bb/ at 20 filter parent 1: protocol ip pref 49152 u32 filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 match 0050/ at 20 [EMAIL PROTECTED]:~# - Thanks. -Ryan Power At 04:00 AM 9/12/2006, you wrote: Message: 4 Date: Tue, 12 Sep 2006 10:36:27 +0200 From: [EMAIL PROTECTED] Subject: Re: [LARTC] Re: htb traffic shaping problem (Charlie Meyer) To: lartc@mailman.ds9a.nl Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Hi again, sorry for my late response. Could you give us also the output of tc -s -d qdisc show dev eth0
[LARTC] Re: htb traffic shaping problem (Charlie Meyer)
Eric, I've attached the output from the command you requested below. I'm using kernel 2.6.17.12 and tc version ss060323. I'm have a nforce4 onboard giggabit controller using the forcedeth driver, if that makes a difference. Charlie, I'll take a look at the Apache model for throttling, thanks. I was going for tc because was going to try to add additional shaping to non-apache traffic once I got it working correctly. Thanks, -Ryan Power tc -s -d class show dev eth0 class htb 1:99 parent 1:1 leaf 99: prio 0 quantum 3000 rate 90Kbit ceil 1000Mbit burst 451350b/8 mpu 0b overhead 0b cburst 501375b/8 mpu 0b overhead 0b level 0 Sent 48695 bytes 398 pkt (dropped 0, overlimits 0 requeues 0) rate 2704bit 2pps backlog 0b 0p requeues 0 lended: 398 borrowed: 0 giants: 0 tokens: 4326 ctokens: 4325 class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 501375b/8 mpu 0b overhead 0b cburst 501375b/8 mpu 0b overhead 0b level 7 Sent 32821394 bytes 994 pkt (dropped 0, overlimits 0 requeues 0) rate 3556Kbit 10pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 1128 tokens: 4325 ctokens: 4325 class htb 1:10 parent 1:1 leaf 10: prio 0 quantum 3000 rate 512000bit ceil 512000bit burst 1755b/8 mpu 0b overhead 0b cburst 1755b/8 mpu 0b overhead 0b level 0 Sent 34256069 bytes 701 pkt (dropped 0, overlimits 0 requeues 0) rate 3554Kbit 8pps backlog 0b 105p requeues 0 lended: 596 borrowed: 0 giants: 1128 tokens: -52724 ctokens: -52724 ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: HTB and BOND Interface
Hi! Is it HTB fully compatible with BOND interface? I have this setup (mode= fault tolerance) : BOND0 - ETH0 + ETH1 BOND1 - ETH2 + ETH3 ( http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/bonding.txt ) HTB work very well with Class over BOND0. If I add Class for BOND1 it generate balance errors. Also with HTB.init (http://sourceforge.net/projects/htbinit) I have the some problem bond0 (upload) bond0-10 bond0-10:15 bond0-10:20 bond0-10:20:25 bond1-10 (download) bond1-10:15 bond1-10:20 bond1-10:20:25 ( File bond0* and bond1* are identical ) Thanks for eventual answers! Can I create something about tc qdisc add dev $DEV handle : ingress for use only BOND0 interface ? Here my actual script: /sbin/tc qdisc del dev bond0 root /sbin/tc qdisc add dev bond0 root handle 1 htb default 15 r2q 100 /sbin/tc class add dev bond0 parent 1: classid 1:10 htb rate 7.6Mbit burst 15k /sbin/tc class add dev bond0 parent 1:10 classid 1:15 htb rate 100Kbit ceil 1Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:15 handle 15 sfq perturb 10 /sbin/tc class add dev bond0 parent 1:10 classid 1:20 htb rate 1.5Mbit ceil 6Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:20 handle 20 sfq perturb 10 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.2.0/24 classid 1:20 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.3.0/24 classid 1:20 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.6.0/24 classid 1:20 /sbin/tc class add dev bond0 parent 1:10 classid 1:30 htb rate 1.5Mbit ceil 6Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:30 handle 30 sfq perturb 10 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.4.0/24 classid 1:30 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.5.0/24 classid 1:30 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip dst 192.168.7.0/24 classid 1:30 /sbin/tc class add dev bond0 parent 1:10 classid 1:38 htb rate 2Mbit ceil 3Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:38 handle 38 sfq perturb 10 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.8.0/24 classid 1:38 /sbin/tc class add dev bond0 parent 1:10 classid 1:39 htb rate 1Mbit ceil 4Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:39 handle 39 sfq perturb 10 /sbin/tc class add dev bond0 parent 1:39 classid 1:3956 htb rate 256Kbit ceil 1Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:3956 handle 3956 sfq perturb 10 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.9.15/32 classid 1:3956 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.9.35/32 classid 1:3956 /sbin/tc class add dev bond0 parent 1:39 classid 1:3999 htb rate 768Kbit ceil 4Mbit burst 15k /sbin/tc qdisc add dev bond0 parent 1:3999 handle 3999 sfq perturb 10 /sbin/tc filter add dev bond0 parent 1:0 protocol ip prio 100 u32 match ip src 192.168.9.0/24 classid 1:3999 Thanks! ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: HTB is buggy?
Stephen Hemminger wrote: I believe there are some unresolved memory management issues with HTB. It looks like deleting the qdisc is causing some use after free or memory corruption problems. See: http://bugzilla.kernel.org/show_bug.cgi?id=6681 I don't use HTB so I have no idea if this a new or old problem. Hmm he's doing crash (and oops) in command like tc filter del dev ethX protocol ip parent 1:0 prio 5 handle X:XX:XX u32 is that valid - I've always reccomended to del root qdisc and start again to change something. I don't know if it's documented anywhere - none of the man pages in iproute2 even mention del (OK remove is there) and tc-filters.8 is referenced but not there. It does say in tc.8 - Filters have a three part ID, which is only needed when using a hashed filter hierarchy, for which see tc-filters(8) so maybe it's just tc/kernel failing to give rtnetlink error - which is what I've seen before when trying to delete specific parts of trees. man tc-htb doesn't even mention tc filter anything. Andy. ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: HTB not shaping traffic
I solved my problem by myself, by studying devik's HTB manual: http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm Here are my remarks for those browsing the mailing list archive. The line that made me realize what I was doing wrong is: The rate supplied for a parent should be the sum of the rates of its children. Apparently I was confusing the purpose of 'rate' to that of 'ceil' and HTB was not too happy about it. Tobia ___ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
[LARTC] Re: htb bridge problem, please chceck my config
a machine (winChip 200mhz cpu, 32mb ram, linux 2.4.28) acting like a bridge with 2 interfaces (eth0 - to our ISP, eth1 - to our network) machine does not have any IP there is a 802.1q vlan eth0.2 eth0.2 and eth1 are bridged in br0 i have one 4mbit link which i share with my friend, i have 3mbit and he has 1mbit all our IP addresses are public and we have the following setup /sbin/tc qdisc add dev eth1 root handle 1: htb default 2 /sbin/tc class add dev eth1 parent 1: classid 1:1 htb rate 4mbit ceil 4mbit /sbin/tc class add dev eth1 parent 1:1 classid 1:2 htb rate 3mbit ceil 3mbit /sbin/tc class add dev eth1 parent 1:1 classid 1:3 htb rate 1mbit ceil 1mbit your filters will not work because of the parent /sbin/tc filter add dev eth1 protocol ip parent 1:0 pref 1 u32 match ip src FRIEDNS_IP flowid 1:3 tc filter add dev eth1 prio 7 parent 1: protocol ip u32 match ip dst FRIENDS_IP flowid 1:3 /sbin/tc filter add dev eth1 protocol ip parent 1:0 pref 1 u32 match ip src MY_IP flowid 1:2 tc filter add dev eth1 prio 7 parent 1: protocol ip u32 match ip dst MY_IP flowid 1:2 ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: HTB: quantum of class 10200 is small. Consider r2q change.
Bernard abno wrote: Hello, What does this line mean : HTB: quantum of class 10200 is small. Consider r2q change. And how should I fix it ? I have dsl 1mb connection and 2 cards (realtek-8139C and realtek-8100B/8139D) Could the above line cause this ? : NETDEV WATCHDOG: eth0: transmit timed out eth0: Transmit timeout, status 0c 0005 c07f media 00. eth0: Tx queue start entry 3518 dirty entry 3514. eth0: Tx descriptor 0 is 0008a041. eth0: Tx descriptor 1 is 0008a5be. eth0: Tx descriptor 2 is 0008a0a8. (queue head) eth0: Tx descriptor 3 is 0008a03c. eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB 3.13 please help
Hello Devik! Thanks for your help. And many thanks to everybody from the group who has been thinking on my problem. It seems i resolved my problem - there is no connection loss while reseting htb, but I'll be observing it's stability in a few days. I have no words to write what a STUPID mistake it was. As i suposed it was conected with packet marking. I've been using this command to mark packets: iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.0.2 -j MARK --set-mark $mark BUT when configuring tcng i looked at my marking script what the heck??, Internet is not only tcp! Isn't it? I removed -p tcp and now it works. Yes it was really BAD and took me too much time ggrrr. Good luck folks. ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB 3.13 please help
//Just to not forget eth0 is WAN and eth1 is LAN . The box is NATing my lan. I configured tcng to shape both download and upload and i got connection loss again. Maybe it is my script fault or it is something bad with packets marking . this is how i mark outgoing packets iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.23 -j MARK --set-mark $ip and this part of my script which is intented to shape upload: dev eth0 { egress { class ($default) if 1; htb ( r2q 1 ) { class ( rate 800kbps, ceil 800kbps ) { //192.168.1.0--- $ruter = class ( rate 15kbps, ceil 250kbps ) { sfq( perturb 10secs, quantum 1500Bytes ); } ; fw { class $ruter on (23); //ruter- //- fw }//fw }//main class }//htb }//egress }//eth0(none):/skrytpy# and these are a bit of `tc -s -d class show dev eth0` prints while connection loss after running my tcng script : class htb 2:f parent 2:1 leaf 10: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:1e parent 2:1 leaf 1f: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:2d parent 2:1 leaf 2e: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 that is interesting. let me know then. other test might be to reboot with maxcpus=1 to mitigate smp related bugs. On Sat, 25 Jan 2003 [EMAIL PROTECTED] wrote: Yes I'm using smp kernel. I thought that i make some error that i canot see so i decided to write my classes using tcng this time. Currently i'm shaping only outgoing traffic to my local network(using tcng) and it seems to work (it work one day without errors). Today i'm going to configure upload too. The difference i could see at once is that there is no connection loss when i'm starting htb. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: lartc [EMAIL PROTECTED] Sent: Sunday, July 25, 2004 10:26 AM Subject: Re: [LARTC] Re: HTB 3.13 please help From the stats is seems that no data are queued - as if nobody is sending them. You are using smp kernel, is your box SMP ? I haven't seen many smp+htb boxes thus there might be possibility of a bug... devik On Thu, 23 Jan 2003 [EMAIL PROTECTED] wrote: I've attached outputs for eth0 and eth1. I was trying to get this script running. I've added one class for my NATed BOX, and it helped. Shaping was stable almost one day but then i added prio 0 to eth0 filters and prio 0 for eth1 filters it has braken. So i removed every prio 0 and reboot the box but it didnt helped :(. I've noticed that when the traffic is not much (14 hosts from 50 are up) tc/htb works very well. If you want new version of my script say a word. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 22, 2004 3:48 PM Subject: Re: HTB 3.13 please help I need tc -s -d class show dev xxx output during that non-working period. 3.6 is older than 3.13. --- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Wed, 21 Jul 2004 [EMAIL PROTECTED] wrote: Thanks for your reply. I've recent put my problem on lartc list. I'm using htb 3.13 in 2-4-25smp. I wonder if upgrade to 3.6 will help? Could you be so kind and take a look at it. I'll be grateful. If you have no time for me i'll understand and try to resolve it for myself. Thanks. Hello everybody! Since week i dig lists and www and can't find solution for my problem. I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9. I've got situation like this: LAN--Linux Box(routing only)--- Linux Box (HTB)--Hardware Router(say:HD)--Internet When I start HTB it takes about 5 min. to start working and it works... within this 5min starting i can't ping HD and after about 5min I start pinging. It works like this for cuple of hours, then something strange is happening. Ping stops, www doesn't work but radio (36kbps) (from clients) works. There is no ping at all for about 1min and it starts pinging for about 2-3min and it stops for 1-2min and so on. When I stop HTB
Re: [LARTC] Re: HTB 3.13 please help
as you can see, NO packets are going thru. You have to look to other classes as well as to ifconfig and tc -s qdisc show dev xxx to see wherw packets are lost. On Wed, 28 Jul 2004 [EMAIL PROTECTED] wrote: //Just to not forget eth0 is WAN and eth1 is LAN . The box is NATing my lan. I configured tcng to shape both download and upload and i got connection loss again. Maybe it is my script fault or it is something bad with packets marking . this is how i mark outgoing packets iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.23 -j MARK --set-mark $ip and this part of my script which is intented to shape upload: dev eth0 { egress { class ($default) if 1; htb ( r2q 1 ) { class ( rate 800kbps, ceil 800kbps ) { //192.168.1.0--- $ruter = class ( rate 15kbps, ceil 250kbps ) { sfq( perturb 10secs, quantum 1500Bytes ); } ; fw { class $ruter on (23); //ruter- //- fw }//fw }//main class }//htb }//egress }//eth0(none):/skrytpy# and these are a bit of `tc -s -d class show dev eth0` prints while connection loss after running my tcng script : class htb 2:f parent 2:1 leaf 10: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:1e parent 2:1 leaf 1f: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:2d parent 2:1 leaf 2e: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 that is interesting. let me know then. other test might be to reboot with maxcpus=1 to mitigate smp related bugs. On Sat, 25 Jan 2003 [EMAIL PROTECTED] wrote: Yes I'm using smp kernel. I thought that i make some error that i canot see so i decided to write my classes using tcng this time. Currently i'm shaping only outgoing traffic to my local network(using tcng) and it seems to work (it work one day without errors). Today i'm going to configure upload too. The difference i could see at once is that there is no connection loss when i'm starting htb. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: lartc [EMAIL PROTECTED] Sent: Sunday, July 25, 2004 10:26 AM Subject: Re: [LARTC] Re: HTB 3.13 please help From the stats is seems that no data are queued - as if nobody is sending them. You are using smp kernel, is your box SMP ? I haven't seen many smp+htb boxes thus there might be possibility of a bug... devik On Thu, 23 Jan 2003 [EMAIL PROTECTED] wrote: I've attached outputs for eth0 and eth1. I was trying to get this script running. I've added one class for my NATed BOX, and it helped. Shaping was stable almost one day but then i added prio 0 to eth0 filters and prio 0 for eth1 filters it has braken. So i removed every prio 0 and reboot the box but it didnt helped :(. I've noticed that when the traffic is not much (14 hosts from 50 are up) tc/htb works very well. If you want new version of my script say a word. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 22, 2004 3:48 PM Subject: Re: HTB 3.13 please help I need tc -s -d class show dev xxx output during that non-working period. 3.6 is older than 3.13. --- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Wed, 21 Jul 2004 [EMAIL PROTECTED] wrote: Thanks for your reply. I've recent put my problem on lartc list. I'm using htb 3.13 in 2-4-25smp. I wonder if upgrade to 3.6 will help? Could you be so kind and take a look at it. I'll be grateful. If you have no time for me i'll understand and try to resolve it for myself. Thanks. Hello everybody! Since week i dig lists and www and can't find solution for my problem. I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9. I've got situation like this: LAN--Linux Box(routing only)--- Linux Box (HTB)--Hardware Router(say:HD)--Internet When I start HTB it takes about 5 min. to start working and it works... within this 5min starting i can't ping HD and after about 5min I
Re: [LARTC] Re: HTB 3.13 please help
oops. I took bad classes (these clients where down so there was no traffic ) lately from tc -s -d class show dev eth0. These are classes (part of) while there was no connection from clients. BTW is it good tcng config with fw. I mean if fw { class $classname on (2); } means match packet to $classname if it's mark equals 2 ? Is there any kind of sniffer or smth like that for tc? I mean to look in realtime packet statistics. Smthing like iptraf maybe? class htb 2:1 root rate 800Kbit ceil 800Kbit burst 2623b/8 mpu 0b cburst 2623b/8 mpu 0b level 7 Sent 21958200 bytes 38721 pkts (dropped 0, overlimits 0) rate 47328bps 68pps lended: 22026 borrowed: 0 giants: 0 tokens: 20609 ctokens: 20609 class htb 2:10 parent 2:1 leaf 10: prio 0 quantum 1920 rate 15Kbit ceil 100Kbit burst 1618b/8 mpu 0b cburst 1727b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 690773 ctokens: 110592 class htb 2:23 parent 2:1 leaf 23: prio 0 quantum 1920 rate 15Kbit ceil 100Kbit burst 1618b/8 mpu 0b cburst 1727b/8 mpu 0b level 0 Sent 2490197 bytes 3069 pkts (dropped 0, overlimits 0) rate 5157bps 5pps lended: 1015 borrowed: 2054 giants: 0 tokens: -475203 ctokens: -30720 class htb 2:32 parent 2:1 leaf 32: prio 0 quantum 1920 rate 15Kbit ceil 100Kbit burst 1618b/8 mpu 0b cburst 1727b/8 mpu 0b level 0 Sent 476682 bytes 1633 pkts (dropped 0, overlimits 0) rate 661bps 2pps lended: 745 borrowed: 888 giants: 0 tokens: -235603 ctokens: 107520 class htb 2:54 parent 2:1 leaf 54: prio 0 quantum 1920 rate 15Kbit ceil 20Kbit burst 1618b/8 mpu 0b cburst 1624b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 690773 ctokens: 51 class htb 2:20 parent 2:1 leaf 20: prio 0 quantum 1920 rate 15Kbit ceil 100Kbit burst 1618b/8 mpu 0b cburst 1727b/8 mpu 0b level 0 Sent 108 bytes 2 pkts (dropped 0, overlimits 0) lended: 2 borrowed: 0 giants: 0 tokens: 649813 ctokens: 104448 - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: lartc [EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 3:30 PM Subject: Re: [LARTC] Re: HTB 3.13 please help as you can see, NO packets are going thru. You have to look to other classes as well as to ifconfig and tc -s qdisc show dev xxx to see wherw packets are lost. On Wed, 28 Jul 2004 [EMAIL PROTECTED] wrote: //Just to not forget eth0 is WAN and eth1 is LAN . The box is NATing my lan. I configured tcng to shape both download and upload and i got connection loss again. Maybe it is my script fault or it is something bad with packets marking . this is how i mark outgoing packets iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.23 -j MARK --set-mark $ip and this part of my script which is intented to shape upload: dev eth0 { egress { class ($default) if 1; htb ( r2q 1 ) { class ( rate 800kbps, ceil 800kbps ) { //192.168.1.0--- $ruter = class ( rate 15kbps, ceil 250kbps ) { sfq( perturb 10secs, quantum 1500Bytes ); } ; fw { class $ruter on (23); //ruter- //- fw }//fw }//main class }//htb }//egress }//eth0(none):/skrytpy# and these are a bit of `tc -s -d class show dev eth0` prints while connection loss after running my tcng script : class htb 2:f parent 2:1 leaf 10: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:1e parent 2:1 leaf 1f: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 class htb 2:2d parent 2:1 leaf 2e: prio 0 quantum 1875 rate 1875bps ceil 15000bps burst 1617b/8 mpu 0b cburst 1749b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 706914 ctokens: 95572 that is interesting. let me know then. other test might be to reboot with maxcpus=1 to mitigate smp related bugs. On Sat, 25 Jan 2003 [EMAIL PROTECTED] wrote: Yes I'm using smp kernel. I thought that i make some error that i canot see so i decided to write my classes using tcng this time. Currently i'm shaping only outgoing traffic to my local network(using tcng) and it seems to work (it work one day without errors). Today i'm going to configure upload too. The difference i could see at once is that there is no connection loss when i'm starting htb. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: lartc
Re: [LARTC] Re: HTB 3.13 please help
From the stats is seems that no data are queued - as if nobody is sending them. You are using smp kernel, is your box SMP ? I haven't seen many smp+htb boxes thus there might be possibility of a bug... devik On Thu, 23 Jan 2003 [EMAIL PROTECTED] wrote: I've attached outputs for eth0 and eth1. I was trying to get this script running. I've added one class for my NATed BOX, and it helped. Shaping was stable almost one day but then i added prio 0 to eth0 filters and prio 0 for eth1 filters it has braken. So i removed every prio 0 and reboot the box but it didnt helped :(. I've noticed that when the traffic is not much (14 hosts from 50 are up) tc/htb works very well. If you want new version of my script say a word. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 22, 2004 3:48 PM Subject: Re: HTB 3.13 please help I need tc -s -d class show dev xxx output during that non-working period. 3.6 is older than 3.13. --- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Wed, 21 Jul 2004 [EMAIL PROTECTED] wrote: Thanks for your reply. I've recent put my problem on lartc list. I'm using htb 3.13 in 2-4-25smp. I wonder if upgrade to 3.6 will help? Could you be so kind and take a look at it. I'll be grateful. If you have no time for me i'll understand and try to resolve it for myself. Thanks. Hello everybody! Since week i dig lists and www and can't find solution for my problem. I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9. I've got situation like this: LAN--Linux Box(routing only)--- Linux Box (HTB)--Hardware Router(say:HD)--Internet When I start HTB it takes about 5 min. to start working and it works... within this 5min starting i can't ping HD and after about 5min I start pinging. It works like this for cuple of hours, then something strange is happening. Ping stops, www doesn't work but radio (36kbps) (from clients) works. There is no ping at all for about 1min and it starts pinging for about 2-3min and it stops for 1-2min and so on. When I stop HTB ping starts. It's look like HTB is filled to much(sorry for my english :/) All my children classes rate doesn't exceeds root classes. I have 50 classes on 900kbit-10kbit(for default class) - downstream and 800-10kbit(for default) up. I shape bandwidth matching ip. r2q is set to 1 . no erros during doing shape script. I'm attaching this script in ip1 is file where are written ip's for C classes. I'm including my script. ---cut here --- #!/bin/bash #x=$[100/20] #echo $1 /skrytpy/status rxmax=900 #WAN max transfer -down (physically it is 960kbit/960kbit) kbit=kbit rxmaxluser=250 txmax=800 #WAN max transfer - up txmaxluser=100 #counting users # ip1 file is like this: # 11 #Somebody # 23 #Somebody II #EOF licznik=0 for x in $(awk '{ print $1 }' /skrytpy/ip1); do licznik=$[$licznik+1] done #Server licznik=$[$licznik+1] #plus router licznik=$[$licznik+1] echo number of users to $licznik #counting rate rx1=$[$rxmax-10] tx1=$[$txmax-10] # dla klasy domyslnej rxmin=$[$rx1/$licznik] txmin=$[$tx1/$licznik] echo rx $rxmin tx $txmin #echo $rxmin #root classes #rx tc qdisc del root dev eth1 tc qdisc add dev eth1 root handle 1:0 htb r2q 1 default 2 tc class add dev eth1 parent 1:0 classid 1:1 htb rate $rxmax$kbit ceil $rxmax$kbit #tx tc qdisc del root dev eth0 tc qdisc add dev eth0 root handle 2:0 htb r2q 1 default 4 tc class add dev eth0 parent 2:0 classid 2:1 htb rate $txmax$kbit ceil $txmax$kbit #r=$rxmax$kbit #default classes #rx tc class add dev eth1 parent 1:1 classid 1:2 htb rate 10kbit ceil 10kbit #tx tc class add dev eth0 parent 2:1 classid 2:4 htb rate 10kbit ceil 10kbit #siec 1.0 siec=1 for ip in $(awk '{ print $1 }' /skrytpy/ip1); do echo -n $ip #rx tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil $rxmaxluser$kbit tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.$siec.$ip flowid 1:$ip tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10 #tx #marking packets iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK --set-mark $ip #tc tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil $txmaxluser$kbit #filtering by mark tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw flowid 2:$ip tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10 done echo
Re: [LARTC] Re: HTB 3.13 please help
Yes I'm using smp kernel. I thought that i make some error that i canot see so i decided to write my classes using tcng this time. Currently i'm shaping only outgoing traffic to my local network(using tcng) and it seems to work (it work one day without errors). Today i'm going to configure upload too. The difference i could see at once is that there is no connection loss when i'm starting htb. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: lartc [EMAIL PROTECTED] Sent: Sunday, July 25, 2004 10:26 AM Subject: Re: [LARTC] Re: HTB 3.13 please help From the stats is seems that no data are queued - as if nobody is sending them. You are using smp kernel, is your box SMP ? I haven't seen many smp+htb boxes thus there might be possibility of a bug... devik On Thu, 23 Jan 2003 [EMAIL PROTECTED] wrote: I've attached outputs for eth0 and eth1. I was trying to get this script running. I've added one class for my NATed BOX, and it helped. Shaping was stable almost one day but then i added prio 0 to eth0 filters and prio 0 for eth1 filters it has braken. So i removed every prio 0 and reboot the box but it didnt helped :(. I've noticed that when the traffic is not much (14 hosts from 50 are up) tc/htb works very well. If you want new version of my script say a word. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 22, 2004 3:48 PM Subject: Re: HTB 3.13 please help I need tc -s -d class show dev xxx output during that non-working period. 3.6 is older than 3.13. --- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Wed, 21 Jul 2004 [EMAIL PROTECTED] wrote: Thanks for your reply. I've recent put my problem on lartc list. I'm using htb 3.13 in 2-4-25smp. I wonder if upgrade to 3.6 will help? Could you be so kind and take a look at it. I'll be grateful. If you have no time for me i'll understand and try to resolve it for myself. Thanks. Hello everybody! Since week i dig lists and www and can't find solution for my problem. I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9. I've got situation like this: LAN--Linux Box(routing only)--- Linux Box (HTB)--Hardware Router(say:HD)--Internet When I start HTB it takes about 5 min. to start working and it works... within this 5min starting i can't ping HD and after about 5min I start pinging. It works like this for cuple of hours, then something strange is happening. Ping stops, www doesn't work but radio (36kbps) (from clients) works. There is no ping at all for about 1min and it starts pinging for about 2-3min and it stops for 1-2min and so on. When I stop HTB ping starts. It's look like HTB is filled to much(sorry for my english :/) All my children classes rate doesn't exceeds root classes. I have 50 classes on 900kbit-10kbit(for default class) - downstream and 800-10kbit(for default) up. I shape bandwidth matching ip. r2q is set to 1 . no erros during doing shape script. I'm attaching this script in ip1 is file where are written ip's for C classes. I'm including my script. ---cut here --- #!/bin/bash #x=$[100/20] #echo $1 /skrytpy/status rxmax=900 #WAN max transfer -down (physically it is 960kbit/960kbit) kbit=kbit rxmaxluser=250 txmax=800 #WAN max transfer - up txmaxluser=100 #counting users # ip1 file is like this: # 11 #Somebody # 23 #Somebody II #EOF licznik=0 for x in $(awk '{ print $1 }' /skrytpy/ip1); do licznik=$[$licznik+1] done #Server licznik=$[$licznik+1] #plus router licznik=$[$licznik+1] echo number of users to $licznik #counting rate rx1=$[$rxmax-10] tx1=$[$txmax-10] # dla klasy domyslnej rxmin=$[$rx1/$licznik] txmin=$[$tx1/$licznik] echo rx $rxmin tx $txmin #echo $rxmin #root classes #rx tc qdisc del root dev eth1 tc qdisc add dev eth1 root handle 1:0 htb r2q 1 default 2 tc class add dev eth1 parent 1:0 classid 1:1 htb rate $rxmax$kbit ceil $rxmax$kbit #tx tc qdisc del root dev eth0 tc qdisc add dev eth0 root handle 2:0 htb r2q 1 default 4 tc class add dev eth0 parent 2:0 classid 2:1 htb rate $txmax$kbit ceil $txmax$kbit #r=$rxmax$kbit #default classes #rx tc class add dev eth1 parent 1:1 classid 1:2 htb rate 10kbit ceil 10kbit #tx tc class add dev eth0 parent 2:1 classid 2:4 htb rate 10kbit ceil 10kbit #siec 1.0 siec=1 for ip in $(awk '{ print $1 }' /skrytpy/ip1); do echo -n $ip #rx tc class add dev
[LARTC] Re: HTB 3.13 please help
I've attached outputs for eth0 and eth1. I was trying to get this script running. I've added one class for my NATed BOX, and it helped. Shaping was stable almost one day but then i added prio 0 to eth0 filters and prio 0 for eth1 filters it has braken. So i removed every prio 0 and reboot the box but it didnt helped :(. I've noticed that when the traffic is not much (14 hosts from 50 are up) tc/htb works very well. If you want new version of my script say a word. - Original Message - From: devik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 22, 2004 3:48 PM Subject: Re: HTB 3.13 please help I need tc -s -d class show dev xxx output during that non-working period. 3.6 is older than 3.13. --- Martin Devera aka devik Linux kernel QoS/HTB maintainer http://luxik.cdi.cz/~devik/ On Wed, 21 Jul 2004 [EMAIL PROTECTED] wrote: Thanks for your reply. I've recent put my problem on lartc list. I'm using htb 3.13 in 2-4-25smp. I wonder if upgrade to 3.6 will help? Could you be so kind and take a look at it. I'll be grateful. If you have no time for me i'll understand and try to resolve it for myself. Thanks. Hello everybody! Since week i dig lists and www and can't find solution for my problem. I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9. I've got situation like this: LAN--Linux Box(routing only)--- Linux Box (HTB)--Hardware Router(say:HD)--Internet When I start HTB it takes about 5 min. to start working and it works... within this 5min starting i can't ping HD and after about 5min I start pinging. It works like this for cuple of hours, then something strange is happening. Ping stops, www doesn't work but radio (36kbps) (from clients) works. There is no ping at all for about 1min and it starts pinging for about 2-3min and it stops for 1-2min and so on. When I stop HTB ping starts. It's look like HTB is filled to much(sorry for my english :/) All my children classes rate doesn't exceeds root classes. I have 50 classes on 900kbit-10kbit(for default class) - downstream and 800-10kbit(for default) up. I shape bandwidth matching ip. r2q is set to 1 . no erros during doing shape script. I'm attaching this script in ip1 is file where are written ip's for C classes. I'm including my script. ---cut here --- #!/bin/bash #x=$[100/20] #echo $1 /skrytpy/status rxmax=900 #WAN max transfer -down (physically it is 960kbit/960kbit) kbit=kbit rxmaxluser=250 txmax=800 #WAN max transfer - up txmaxluser=100 #counting users # ip1 file is like this: # 11 #Somebody # 23 #Somebody II #EOF licznik=0 for x in $(awk '{ print $1 }' /skrytpy/ip1); do licznik=$[$licznik+1] done #Server licznik=$[$licznik+1] #plus router licznik=$[$licznik+1] echo number of users to $licznik #counting rate rx1=$[$rxmax-10] tx1=$[$txmax-10] # dla klasy domyslnej rxmin=$[$rx1/$licznik] txmin=$[$tx1/$licznik] echo rx $rxmin tx $txmin #echo $rxmin #root classes #rx tc qdisc del root dev eth1 tc qdisc add dev eth1 root handle 1:0 htb r2q 1 default 2 tc class add dev eth1 parent 1:0 classid 1:1 htb rate $rxmax$kbit ceil $rxmax$kbit #tx tc qdisc del root dev eth0 tc qdisc add dev eth0 root handle 2:0 htb r2q 1 default 4 tc class add dev eth0 parent 2:0 classid 2:1 htb rate $txmax$kbit ceil $txmax$kbit #r=$rxmax$kbit #default classes #rx tc class add dev eth1 parent 1:1 classid 1:2 htb rate 10kbit ceil 10kbit #tx tc class add dev eth0 parent 2:1 classid 2:4 htb rate 10kbit ceil 10kbit #siec 1.0 siec=1 for ip in $(awk '{ print $1 }' /skrytpy/ip1); do echo -n $ip #rx tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil $rxmaxluser$kbit tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.$siec.$ip flowid 1:$ip tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10 #tx #marking packets iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK --set-mark $ip #tc tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil $txmaxluser$kbit #filtering by mark tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw flowid 2:$ip tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10 done echo cut here -- #this is tc class -s -d show dev eth1 class htb 1:11 parent 1:1 leaf 11: prio 0 quantum 2176 rate 17Kbit ceil 250Kbit burst 1620b/8 mpu 0b cburst 1919b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 610258 ctokens: 49152 class htb 1:22
Re: [LARTC] Re: htb filter
On Thursday 24 June 2004 06:37, [EMAIL PROTECTED] wrote: Jason Boxman writes: On Wednesday 23 June 2004 01:57, Svetozar Mihailov wrote: Shouldn't this: tc class add dev eth0 parent 2:0 classid 2:200 htb rate 100Mbit prio 10 be parent 2:? Ed W That change nothing. I have running system with 800 PC , 4 classes for each. There is no difference for me in using parent 2: vs parent 2:0. Both give same result. Exactly. 2: is simply a short hand for 2:0, for example. And is someone have idea how to list current configuration? I want to wrote similar to 'iptables-save' but for tc. In my running config there are about 3200 classes and 4000 filters. The script I generate is 1.2Mbytes and need 45 seconds to apply. I want to speedup this process with some kind of tc-save and tc-restore. I wrote some scripts to save the running configuration, but it is integrated in other, buggy, bloated script. The major problem is recognizing the different options and qdiscs/classes. Stef -- [EMAIL PROTECTED] Using Linux as bandwidth manager http://www.docum.org/ ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: htb filter
Jason Boxman writes: On Wednesday 23 June 2004 01:57, Svetozar Mihailov wrote: Shouldn't this: tc class add dev eth0 parent 2:0 classid 2:200 htb rate 100Mbit prio 10 be parent 2:? Ed W That change nothing. I have running system with 800 PC , 4 classes for each. There is no difference for me in using parent 2: vs parent 2:0. Both give same result. Exactly. 2: is simply a short hand for 2:0, for example. And is someone have idea how to list current configuration? I want to wrote similar to 'iptables-save' but for tc. In my running config there are about 3200 classes and 4000 filters. The script I generate is 1.2Mbytes and need 45 seconds to apply. I want to speedup this process with some kind of tc-save and tc-restore. Regards, Svetozar. ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: HTB
I have a fiber connection to MAN1, an ethernet connection to MAN2 (another city), and an ethernet connection to the WAN. My question was (well actually my new question is...) if i can shape all of the traffic using a computer with 4 nics (2xMAN,1 WAN,1 LAN) and what delays will this introduce (if it works)? Can a nic be part of multiple bridges If yes how will this affect my marking of the packets??? Sorry for the new questions (after some google i found the answer for my previous question) ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB and metro+int. limits
I'm sorry, but I'm still confused about assigning separate limits for metro and international traffic. After I mark metro traffic with --set-mark 6 and int. traffic with --set-mark 5 what's the next step? Can someone give me an example? It seems that my approach is somehow wrong after marking of the packets. Thanks again. Alex - Original Message - From: Stef Coene [EMAIL PROTECTED] To: Alex [EMAIL PROTECTED]; Lartc [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 12:59 PM Subject: Re: [LARTC] Re: HTB and metro+int. limits On Tuesday 30 September 2003 21:27, Alex wrote: Thanks for your replay, it really helps, but to take the question further, from what you have seen in my sample script, how should I classify packets with tc ? I don't know how to put them in separate classes,. What I have in my script will only shape metro traffic, but for international how would the tc command be? Something like: /sbin/tc class add dev eth2 parent 1:2 classid 2:11 htb rate 50kbit ceil 100kbit prio 5 /sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst 192.168.254.10 flowid 1:11 Would this be the correct commands? No. You create a class with a wrong number. If the parent class is 1:x, the class name has to be 1:y. Thanks again. Alex ---begin my script sbin/tc qdisc add dev eth2 root handle 1: htb default 10 /sbin/tc class add dev eth2 parent 1: classid 1:1 htb rate 10M #metro /sbin/tc class add dev eth2 parent 1:1 classid 1:10 htb rate 10M /sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 6 flowid 1:10 This filter will not do much (typo?). You attach it to class 1:10 (the parent parameter). This should be 1: so all packets leaving eth2 will be checked against this filter. And is 10M working? Normally 10mbit is used. Stef -- [EMAIL PROTECTED] Using Linux as bandwidth manager http://www.docum.org/ #lartc @ irc.openprojects.net ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB and metro+int. limits part2
I forgot to say that I have put my script on http://retea.hostingcenter.ro/htb.txt Maybe someone could lead to to the correct sintax if there's something wrong. Alex - Original Message - From: Stef Coene [EMAIL PROTECTED] To: Alex [EMAIL PROTECTED]; Lartc [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 12:59 PM Subject: Re: [LARTC] Re: HTB and metro+int. limits On Tuesday 30 September 2003 21:27, Alex wrote: Thanks for your replay, it really helps, but to take the question further, from what you have seen in my sample script, how should I classify packets with tc ? I don't know how to put them in separate classes,. What I have in my script will only shape metro traffic, but for international how would the tc command be? Something like: /sbin/tc class add dev eth2 parent 1:2 classid 2:11 htb rate 50kbit ceil 100kbit prio 5 /sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst 192.168.254.10 flowid 1:11 Would this be the correct commands? No. You create a class with a wrong number. If the parent class is 1:x, the class name has to be 1:y. Thanks again. Alex ---begin my script sbin/tc qdisc add dev eth2 root handle 1: htb default 10 /sbin/tc class add dev eth2 parent 1: classid 1:1 htb rate 10M #metro /sbin/tc class add dev eth2 parent 1:1 classid 1:10 htb rate 10M /sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 6 flowid 1:10 This filter will not do much (typo?). You attach it to class 1:10 (the parent parameter). This should be 1: so all packets leaving eth2 will be checked against this filter. And is 10M working? Normally 10mbit is used. Stef -- [EMAIL PROTECTED] Using Linux as bandwidth manager http://www.docum.org/ #lartc @ irc.openprojects.net ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: HTB and metro+int. limits
Thanks for your replay, it really helps, but to take the question further, from what you have seen in my sample script, how should I classify packets with tc ? I don't know how to put them in separate classes,. What I have in my script will only shape metro traffic, but for international how would the tc command be? Something like: /sbin/tc class add dev eth2 parent 1:2 classid 2:11 htb rate 50kbit ceil 100kbit prio 5 /sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst 192.168.254.10 flowid 1:11 Would this be the correct commands? Thanks again. Alex ---begin my script sbin/tc qdisc add dev eth2 root handle 1: htb default 10 /sbin/tc class add dev eth2 parent 1: classid 1:1 htb rate 10M #metro /sbin/tc class add dev eth2 parent 1:1 classid 1:10 htb rate 10M /sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 6 flowid 1:10 #international /sbin/tc class add dev eth2 parent 1:1 classid 1:2 htb rate 10M /sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 5 flowid 1:2 /sbin/tc class add dev eth2 parent 1:1 classid 1:11 htb rate 50kbit ceil 100kbit prio 5 /sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst 192.168.254.10 flowid 1:11 /sbin/tc class add dev eth2 parent 1:1 classid 1:12 htb rate 50kbit ceil 100kbit prio 5 /sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst 192.168.254.11 flowid 1:12 etc --end-- - Original Message - From: [EMAIL PROTECTED] To: Alex [EMAIL PROTECTED] Sent: Tuesday, September 30, 2003 9:07 PM Subject: Re: HTB and metro+int. limits Alex Alex writes: Hello, I need to setup HTB to limit the bandwidth, but I need to have 2 types of limits, because my ISP gives me more bandwith for sites located in my country, than others located outside. I have setup the following script in which I mark packets with mark 6 for the ip clasess for the sites in my country. What I don't know is how to continue the script with assigning lower limits to everything else not going from ip's in --set-mark 6. Maybe some of can enlighten me about this. Thanks, Alex snip .. /sbin/iptables -t mangle -A PREROUTING -i eth2 -d 193.231.15.0/24 -j MARK --set-mark 6 #end metro # #2. Anything else /sbin/iptables -t mangle -A PREROUTING -i eth2 -d 0/0 -j MARK --set-mark 5 /snip This will not differentiate your traffic. Everything -i eth2 will end up marked '5' because iptables will evaluate against every rule in order, eventually marking them '5' whether they have previously been marked '6' or not. You need to create a new table with two commands for each address range. ie: /sbin/iptables -t mangle -N MYMARKER /sbin/iptables -t mangle -A PREROUTING -i eth2 -j MYMARKER # and ... /sbin/iptables -t mangle -A MYMARKER -d 193.231.15.0/24 -j MARK --set-mark 6 /sbin/iptables -t mangle -A MYMARKER -d 193.231.15.0/24 -j RETURN # for each metro range, and finally /sbin/iptables -t mangle -A MYMARKER -j MARK --set-mark 5 /sbin/iptables -t mangle -A MYMARKER -j RETURN The separate table and the 'RETURN' statements give you the short-circuit evaluation you require. BTW: You might be able to consolidate your metro class-C's into fewer (larger) CIDR ranges to speed evaluation. ( Your upstream provider has likely been allocated them in this manner ) mulc ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB and filters on many levels - Workaround found
Daniel Brahneborg wrote: I found a little workaround, but I'm not really happy with it. SNIP I then use iptables -j MARK to set a '1' if the traffic comes from eth1. If not, it should end up in 1:2, and 1:1 and 1:2 should be able to borrow from each other. What I do now is to use ipfilter to set marks on the packets for all six classes, and then set all filters on 1:0. A bit more work for iptables, but it seems to work. Is it a bug that a fiter can't be added to a class? It's by design AFAIK. Packets are enqueued at qdiscs and, thus, it is only meaningful to be able to attach filters to qdiscs. I may be wrong though... Also, the HTB docs instructs the user to attach filters to the root. -- Mvh. / Best regards, Steen Suder http://www.suder.dk/ ICQ UIN 4133803 ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Re: HTB and filters on many levels - Workaround found
On Tuesday 16 September 2003 19:59, Steen Suder, privat wrote: Daniel Brahneborg wrote: I found a little workaround, but I'm not really happy with it. SNIP I then use iptables -j MARK to set a '1' if the traffic comes from eth1. If not, it should end up in 1:2, and 1:1 and 1:2 should be able to borrow from each other. What I do now is to use ipfilter to set marks on the packets for all six classes, and then set all filters on 1:0. A bit more work for iptables, but it seems to work. Is it a bug that a fiter can't be added to a class? It's by design AFAIK. Packets are enqueued at qdiscs and, thus, it is only meaningful to be able to attach filters to qdiscs. I may be wrong though... Also, the HTB docs instructs the user to attach filters to the root. You don't have to. You can add the filters to classes and stack them. If a packet is enqueued in the htb qdisc, all filters attached to the root qdisc are checked. If a packet is redirected to a leaf class, it's dequeued in the qdisc attached to the class. If a packet is redirected to a class, the filters attached to that class are examined. In previously htb versions, htb hangs if you redirect a packet to a non-leaf class. That's solved in later versions. Stef -- [EMAIL PROTECTED] Using Linux as bandwidth manager http://www.docum.org/ #lartc @ irc.openprojects.net ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: HTB code :-)
As I understand, in HTB you are able to map traffic to a queue named direct_queue. This queue is initialized in function htb_init(), and is a qdisc not a class, is this right?? it is class with implicitly attached queue Another question of interest is how can I use it. Is this queue associated to the queue with highest prio? And how is this done?? this queue is used when you explicitly direct data to X:0 class (by filter) or when used in default 0. devik ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: HTB source code - kernel and tc
Ehh it is the same for 2 years. luxik.cdi.cz/~devik/qos/htb/ .. On Tue, 3 Sep 2002, Jingsong Fu wrote: Hi Devik, Where can I find the HTB source code for kernel and tc? Thanks, Jingsong ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] Re: htb
Ok here is solution. 1) the filter is not swallowed. For inner filters you have to use tc filter show dev lo parent 1:1. If you miss parent keyword nothing will be shown. 2) the code you attached can't work. You wanted to use default keyword to direct packets into 1:1 and then use filter attached to 1:1. It can't be done. default is resolved as last instance and MUST point to a LEAF. No other resolution is done then. To solve your prob use catchall u32 filter (src 0.0.0.0 0 f.e.). on 1: and flowid 1:1. devik On Mon, 1 Jul 2002, Oswald Buddenhagen wrote: On Mon, Jul 01, 2002 at 04:46:12PM +0200, Martin Devera wrote: probably I can. but you have to create test case as simple as possible. it can't get simpler than the attached, i guess ... :) as opposed to my previous observations, filters attached to classes of of the root qdisc are swallowed as well (that means, they don't even show up in tc filter show dev eth0). I can't dig thru long codes .. no time. you know .. yeah, i know this pain. greetings -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ LARTC mailing list / [EMAIL PROTECTED] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/