Hi, I appologise for the bad ettiquite of this, but I have tried looking for some HTB examples that would help me, and am having trouble understanding how the tc filters should work, but I can''t figure out why this isn''t working. I''ve written this script, based upon the ultimate traffic shaper at LARTC, to try and shape for me and my 3 housemates. The idea being to give each user approx 1 quarter of the bandwidth, and then subdivide that into 3 priorities. None of the traffic seems to get clasiffied though. Can anyone help me out? -- Chris Jensen chris@drspirograph.com Public Key: http://drspirograph.com/public_key/ Wait: Did you know that there''s a direct correlation between the decline of Spirograph and the rise in gang activity? Think about it. - Dr Spirograph (The Simpsons)
Chris Jensen wrote:> Hi, > I appologise for the bad ettiquite of this, but I have tried looking for some > HTB examples that would help me, and am having trouble understanding how the > tc filters should work, but I can''t figure out why this isn''t working. > I''ve written this script, based upon the ultimate traffic shaper at LARTC, to > try and shape for me and my 3 housemates. > The idea being to give each user approx 1 quarter of the bandwidth, and then > subdivide that into 3 priorities. > > None of the traffic seems to get clasiffied though.You can''t use u32 to filter egress on src if you are NATing - you need to mark in POSTROUTING mangle and filter on fw. Have a look at the kptd on www.docum.org . Andy. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> You can''t use u32 to filter egress on src if you are NATing - you need > to mark in POSTROUTING mangle and filter on fw. > > Have a look at the kptd on www.docum.org .Whoops, I was aware of this. I must''ve sent an old version of the script to the list, cause I had fixed that, and that''s not the issue anymore. Basically I guess what I really need is a good example of filtering and buckets with two or more tiers (all the examples seem to be only one) eg root (100kbps) flatmate1(22kbps) hi prio default lo prio flatmate2-4 (22 kbps each) default (12kbps) One of the troubles I''m having is setting up defaults. ie. Once a packet is filtered into one of the flatmates, how can I send it to the default bucket if it doesn''t fall into the other two categories. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Wednesday 19 May 2004 14:26 schrieb Chris Jensen:> Whoops, I was aware of this. I must''ve sent an old version of the script > to the list, cause I had fixed that, and that''s not the issue anymore.If you make an up-to-date version available somewhere, I''ll have a look at it. Don''t want to waste my time with some kind of old version. :-)> root (100kbps) > flatmate1(22kbps) > hi prio > default > lo prio > flatmate2-4 (22 kbps each) > default (12kbps)My Fair NAT script [1] uses a very similar structure - however, I did high/default/low prio stuff you desire not with HTB classes, but with a PRIO qdisc attached to the flatmate HTB class. Maybe it''s worth a look?> One of the troubles I''m having is setting up defaults. ie. Once a packet > is filtered into one of the flatmates, how can I send it to the default > bucket if it doesn''t fall into the other two categories.Is it possible to attach filter rules to HTB classes? All my filters belong to some qdisc, so I don''t know. HTH Andreas [1] Fair NAT: http://www.metamorpher.de/fairnat/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello,> Is it possible to attach filter rules to HTB classes? > All my filters belong to some qdisc, so I don''t know.Quote from LATRC: Also, with HTB, you should attach all filters to the root! Dmitry On Wednesday 19 May 2004 17:17, Andreas Klauer <Andreas.Klauer@metamorpher.de> wrote:> Am Wednesday 19 May 2004 14:26 schrieb Chris Jensen: > > Whoops, I was aware of this. I must''ve sent an old version of the script > > to the list, cause I had fixed that, and that''s not the issue anymore. > > If you make an up-to-date version available somewhere, > I''ll have a look at it. Don''t want to waste my time with > some kind of old version. :-) > > > root (100kbps) > > flatmate1(22kbps) > > hi prio > > default > > lo prio > > flatmate2-4 (22 kbps each) > > default (12kbps) > > My Fair NAT script [1] uses a very similar structure - however, I did > high/default/low prio stuff you desire not with HTB classes, but with > a PRIO qdisc attached to the flatmate HTB class. Maybe it''s worth a look? > > > One of the troubles I''m having is setting up defaults. ie. Once a packet > > is filtered into one of the flatmates, how can I send it to the default > > bucket if it doesn''t fall into the other two categories. > > Is it possible to attach filter rules to HTB classes? > All my filters belong to some qdisc, so I don''t know. > > HTH > Andreas > > [1] Fair NAT: http://www.metamorpher.de/fairnat/ > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Dmitry Golubev wrote:> Quote from LATRC: Also, with HTB, you should attach all filters to the root!Then LARTC is wrong. HTB first tries to classify by priority, if that fails it follows the filter chain from the root until it hits a leaf-class, if that fails it tries if the default class is a leaf-class, if even that fails it uses the direct queue. BTW, HFSC does it the same way, but there is no direct queue, so unclassified packets are just dropped. Regards Patrick> > Dmitry_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello, What do you mean by direct queue? If I do not have any filter rules for a packet, I thought it would not be limited at all... Best regards, Dmitry Golubev On Sunday 23 May 2004 19:37, Patrick McHardy <kaber@trash.net> wrote:> Dmitry Golubev wrote: > > Quote from LATRC: Also, with HTB, you should attach all filters to the > > root! > > Then LARTC is wrong. HTB first tries to classify by priority, > if that fails it follows the filter chain from the root until > it hits a leaf-class, if that fails it tries if the default > class is a leaf-class, if even that fails it uses the direct > queue. BTW, HFSC does it the same way, but there is no direct > queue, so unclassified packets are just dropped. > > Regards > Patrick > > > Dmitry > > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Sunday 23 May 2004 22:08, Dmitry Golubev wrote:> Hello, > > > Is it possible to attach filter rules to HTB classes? > > All my filters belong to some qdisc, so I don''t know. > > Quote from LATRC: Also, with HTB, you should attach all filters to the > root!Sorry, my bad, I''m still coming to terms with all the terminology, so probably describe that badly. But going back to my tree:> > > root (100kbps) > > > flatmate1(22kbps) > > > hi prio > > > default > > > lo prio > > > flatmate2-4 (22 kbps each) > > > default (12kbps)Can I set it up (wherever I attach filters) so that unclasified packets will default to flatemate1, and then packets that aren''t classified within flatmate fall into the default? (Each flatmate would have their own default)> > My Fair NAT script [1] uses a very similar structure - however, I did > > high/default/low prio stuff you desire not with HTB classes, but with > > a PRIO qdisc attached to the flatmate HTB class. Maybe it''s worth a look?Yes, I''d like to see it if I could. Again, trying to get familiar witht things so I''m not sure weather it would be better to try and nest a PRIO or a HTB in the parent HTB. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Sunday 23 May 2004 18:37, Patrick McHardy wrote:> Dmitry Golubev wrote: > > Quote from LATRC: Also, with HTB, you should attach all filters to the > > root! > > Then LARTC is wrong.LARC is not up-to-date. It was so in pre-htb3 versions. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Monday 24 May 2004 18:23 schrieb Chris Jensen:> > Andreas Klauer: > > > My Fair NAT script [1] uses a very similar structure - however, I > > > did high/default/low prio stuff you desire not with HTB classes, but > > > with a PRIO qdisc attached to the flatmate HTB class. Maybe it''s > > > worth a look? > > Yes, I''d like to see it if I could.Well, feel free to download it - I posted the link already at the bottom of the very same mail you quoted above: http://www.metamorpher.de/fairnat/> Again, trying to get familiar witht things so I''m not sure weather it > would be better to try and nest a PRIO or a HTB in the parent HTB.It''s quite easy to replace the class structure my script creates with something else. I don''t know if it''s better to use more than one HTB class per user - I didn''t do it because the (guaranteed) HTB rates for leaf classes would get even lower if I had to divide them. And PRIO works well enough for me, so... Andreas _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Friday 16 July 2004 17:19 schrieb Alessandro Ren:> I am using HTB and if someone on the LAN uses a p2p program, I > started to noticed in the voip, with cuts, jitter and lag.Have you tried filtering P2P traffic (using IPP2P or l7-filter)? With HTB, I''d suggest to put it into a class with low prio and low rate, so P2P has to borrow nearly everything. But on the other hand you should make sure Voip can''t max out the line either. It''s not easy to find a balance there. At home, I have a different approach. There''s just fair sharing between custumers (err, flatmates). Each person gets his HTB class, all HTB classes have the same priorities and rates, so everyone gets the same amount of bandwidth no matter what it''s used for (p2p, www, voip, gaming). Prioritizing interactive over http over p2p traffic is then also done on a per-user basis. This way it doesn''t matter to a single user what kind of traffic other users generates... the only guarantee there is that each user can get the same amount of bandwidth. If this setup causes cuts, jitter and lag in voip, it''s either because the same user is generating other traffic with same or higher priority than voip; or because there just isn''t enough bandwidth available altogether to serve all the people. However, that kind of setup requires a lot of classes in HTB (one per [active] client); so if there are too many clients, the rates per class get too low, which might impact HTB performance. Andreas _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Friday 16 July 2004 11:53, Andreas Klauer wrote: <snip>> At home, I have a different approach. There''s just fair sharing between > custumers (err, flatmates). Each person gets his HTB class, all HTB > classes have the same priorities and rates, so everyone gets the same > amount of bandwidth no matter what it''s used for (p2p, www, voip, gaming). > Prioritizing interactive over http over p2p traffic is then also done on a > per-user basis. This way it doesn''t matter to a single user what kind of > traffic other users generates... the only guarantee there is that each > user can get the same amount of bandwidth.But how well does that scale? # Default: Put stuff in class 2. $BIN_TC filter add dev $UC_DEV parent 1:$UC_MARK prio 100 \ protocol ip handle $UC_MARK fw flowid 1:$(($UC_MARK+2)) Would you want to do per user classifications to give SSH for each user a higher priority if you had, say, 230 users, for example? Or would each user merely need to find for himself with his slice? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi, the hint from Martin A Brown which I am experimenting without regret yet is that you shoul decrease the queue lenght to say 30 from the default 100 and also reduce the MTU(MAX. TRANSFER UNIT) to the size of typical voice traffic say 256 using ip link set dev eth0 qlen 30 ip link set dev eth0 mtu 1000 Hope it helps. Ibrahim T. --- Alessandro Ren <alessandro.ren@opservices.com.br> wrote:> > I''ve been using a altered version of the > wshaper script to > priorize voip traffic for my customers. > I''d like to know if someone in the list has any > tips on QoS for > voip, if someone has done some experimentation. > I am using HTB and if someone on the LAN uses a > p2p program, I > started to noticed in the voip, with cuts, jitter > and lag. If a reserve > a fixed amount of bandwitdh not letting anyonbe > borrow, it works fine, > but then if noone is using voip, I have bandwidth > going to waste. > I think I need some fine tunning oin the HTB > parameters, but I am > not sure sure about that. > Any indeas? > > >__________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Friday 16 July 2004 18:54 schrieb Jason Boxman:> But how well does that scale?> Would you want to do per user classifications to give SSH for each user > a higher priority if you had, say, 230 users, for example? Or would > each user merely need to find for himself with his slice?I wrote something about having to many users in my mail too. :-) And I made clear that this setup is what I do at home and I do not have (thank god) 230 flatmates. So hopefully there were no misunderstandings. :-) The interesting question is... are the 230 users all active at the same time. You only need classes for active users. And for that many active users, you need a lot of bandwidth if each of them wants to be doing VoIP and P2P so I don''t see *that* many problems there. Of course, I don''t have any practical experience there. From the point of view of a big ISP, I''d probably make my own life easier by just providing constant (ceiled) rates, no borrowing. Global prioritization (where theoretically each user can use the whole available bandwidth) has the risk that if a user finds out a special type of traffic is being prioritized, he abuses this. For example, he could use a prioritized protocol to tunnel other stuff through it... think of P2P over VoIP. If VoIP is allowed to use all the bandwith, such a user could steal way too many bandwidth from others. The only way to prevent this sort of thing would then be to make no global prioritizations, but give each user his own sandbox (which is more or less the idea behind my home setup). Depending on the bandwidth your clients get, you don''t have to do things like prioritizing SSH and VoIP for them... my ISP doesn''t do that for me either, at least not on such a close level. And I doubt I would like my ISP to decide for me which traffic to prioritize for me. I just do this kind of stuff on my own home machine. I hope it makes sense in a way :-0 It was a rather hasty rant, sorry Andreas _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/