Hello, My link has an average bandwidth of 1.2Mbit/s. I want to shape the bulk traffic on several ports in my network. I used the mangle list to mark some traffic types and reroute them to class 1:1. After failure with my previous configuration I tried the following configuration to shape the in and outcoming traffic of a single host for all ip traffic: # tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 1.2Mbit avpkt 1000 cell 8 # tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Kbit rate 100Kbit weight 10Kbit prio 8 allot 1514 maxburst 20 avpkt 1000 isolated bounded # tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x flowid 1:1 # tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x flowid 1:1 I checked the class 1:1 with both parameter settings 100Kbit and 1.2Mbit, but nothing works. With this configuration it was for the host possible to send or receive data with more than 500Kbit/s. I work with Mandrake 8.2 and kernel 2.4.18. Did I configure something wrong? Sincerely, Thomas Bilke _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 31 October 2002 20:52, thomas bilke wrote:> Hello, > > My link has an average bandwidth of 1.2Mbit/s. I want to shape the bulk > traffic on several ports in my network. I used the mangle list to mark > some traffic types and reroute them to class 1:1. After failure with my > previous configuration I tried the following configuration to shape the > in and outcoming traffic of a single host for all ip traffic: > > # tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 1.2Mbit avpkt 1000 > cell 8 > > # tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Kbit > rate 100Kbit weight 10Kbit prio 8 allot 1514 maxburst 20 avpkt 1000 > isolated bounded > > # tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src > x.x.x.x flowid 1:1 > > # tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst > x.x.x.x flowid 1:1 > > I checked the class 1:1 with both parameter settings 100Kbit and > 1.2Mbit, but nothing works. With this configuration it was for the host > possible to send or receive data with more than 500Kbit/s. > I work with Mandrake 8.2 and kernel 2.4.18. Did I configure something > wrong?You can not shape incoming and outgoing traffic at the same time. You add the cbq qdisc to dev eth0 so you can only shaping traffic that leaves eth0. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Stef Coene schrieb:> You can not shape incoming and outgoing traffic at the same time. You add the > cbq qdisc to dev eth0 so you can only shaping traffic that leaves eth0.Sorry, I think there is a tiff. I use a server which the shaped host is connected to. So the device eth0 is on the server to ISP. The other device eth1 on the server is directed to the local Network. Thomas _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 31 October 2002 21:32, thomas bilke wrote:> Stef Coene schrieb: > > You can not shape incoming and outgoing traffic at the same time. You > > add the cbq qdisc to dev eth0 so you can only shaping traffic that leaves > > eth0. > > Sorry, I think there is a tiff.?? What do you mean ??> I use a server which the shaped host is > connected to. So the device eth0 is on the server to ISP. The other device > eth1 on the server is directed to the local Network.Again, you can only shape outgoing traffic. If eth0 is connected to your isp and you add the qdisc to eth0, then you can only shaping traffic going to your isp. Is the x.x.x.x host on your LAN ?? Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, Oct 31, 2002 at 10:35:27PM +0100, Stef Coene wrote:> and you add the qdisc to eth0, then you can only shaping traffic going to > your isp. > Is the x.x.x.x host on your LAN ?? > > > Stef$ tc qdisc show dev ppp0 qdisc ingress ffff: qdisc sfq 30: limit 128p quantum 1492b perturb 10sec qdisc sfq 20: limit 128p quantum 1492b perturb 10sec qdisc sfq 10: limit 128p quantum 1492b perturb 10sec qdisc cbq 1: rate 10Mbit (bounded,isolated) prio no-transmit that is not ingress AND cbq on one device? -- Robert Felber _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 31 October 2002 22:52, Robert Felber wrote:> On Thu, Oct 31, 2002 at 10:35:27PM +0100, Stef Coene wrote: > > and you add the qdisc to eth0, then you can only shaping traffic going to > > your isp. > > Is the x.x.x.x host on your LAN ?? > > > > > > Stef > > $ tc qdisc show dev ppp0 > qdisc ingress ffff: > qdisc sfq 30: limit 128p quantum 1492b perturb 10sec > qdisc sfq 20: limit 128p quantum 1492b perturb 10sec > qdisc sfq 10: limit 128p quantum 1492b perturb 10sec > qdisc cbq 1: rate 10Mbit (bounded,isolated) prio no-transmit > > that is not ingress AND cbq on one device?All right, you can use ingress and cbq (or what ever qdisc you want) on the same device, but that''s not the issue, you can even use imq so you can shape in and out at the same time. Before we are going to overwhelm Thoms with things like ingress, imq, and other fancy shaping stuff, he has to understand some basic shaping rules. And one of them is that with cbq attached to a real device, you can only shape outgoing traffic From my previous post: You add the cbq qdisc to dev eth0 so you can only shaping traffic that leaves eth0. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Stef Coene schrieb:> Again, you can only shape outgoing traffic. If eth0 is connected to your isp > and you add the qdisc to eth0, then you can only shaping traffic going to > your isp. > Is the x.x.x.x host on your LAN ??Yes, the host is in my LAN. But I want to shape the incoming and outgoing traffic corresponding to this host, or later to the whole LAN. Doesn''t exist any facility to shape the incoming traffic? Thomas _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, Oct 31, 2002 at 11:50:28PM +0100, thomas bilke wrote:> Yes, the host is in my LAN. But I want to shape the incoming and outgoing > traffic corresponding to this host, or later to the whole LAN. Doesn''t > exist any facility to shape the incoming traffic? > > ThomasYes, the qdisc ingress is exactly developed for one purpose: shape incomming traffic. You can both, the CBQ and ingress qdisc, use at the same time for a device (yes, also real eth devices). -- Robert Felber _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Friday 01 November 2002 00:07, Robert Felber wrote:> On Thu, Oct 31, 2002 at 11:50:28PM +0100, thomas bilke wrote: > > Yes, the host is in my LAN. But I want to shape the incoming and outgoing > > traffic corresponding to this host, or later to the whole LAN. Doesn''t > > exist any facility to shape the incoming traffic? > > > > Thomas > > Yes, the qdisc ingress is exactly developed for one purpose: shape > incomming traffic.Ingress will not shape the incoming traffic, but if you use filters+policers you can drop packets that exceed a certain rate. That''s not the same as you can do with cbq for the outgoin packets.> You can both, the CBQ and ingress qdisc, use at the same time for > a device (yes, also real eth devices).You have something like this : LAN --- eth1 --- linux box --- eth0 --- ISP If you add a cbq qdisc on eth0, this will shape the packets going to your ISP. So in the filter statement you need the src address of the host in the LAN. But be aware that if you are natting on that box, you don''t know the src address anymore (the src address is natted to the address of the linux-box). You can solve this issue with iptables + fw filter : mark the packets when they enter the box at eth1 and use that to filter mark on eth0. For the incoming bandwidth, you can use the ingress qdisc and filters with policer. If you add a ingress qdisc, you can add filters with policers. Each policer is a sort of tbf with a certain rate. Packets that exceed that rate are dropped. So you can control the incoming packets. An other trick is using a imq device or shaping on eth1 if the linux box is only a router so all packets entering eth0 are leaving eth1. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/