Thread: [bwm-tools-tech] Re: about bwm
Brought to you by:
nkukard
From: Nigel K. <nk...@lb...> - 2003-06-18 15:17:10
|
On Wed, Jun 18, 2003 at 09:49:31AM +0300, Andriy T. Yanko wrote: > I am working on specific program that control access traffic flow. > I am also using QUEUE kernel module. > Everything was fine & working but now I got order to add shaping methods= and ... yea... that gets a little hard ... heh > I have now problem beause I don't know how to implement one of famous Qo= S ( TBF, HTB ... ) or other. we basically use first-in-first-out (fifo), anything can basically be added. > I also wrote wrapper for tc (utilite from iproute2) . I also started out on TC a very long while ago, had more drawbacks for our use than usefullness, so we scrapped it... tried out some of our own=20 in-kernel code, scrapped that aswell... now it looks like we going to stay with bwm-tools. As you can see from the source we started work on it close to a year ago. ;) > But kernel QoS using on ethernet devices and most as egress mode. yea > So in this case I must build classes with queuening disciplines and use t= c filter to match packets that I want shape, > This approach is not very comfortable: seting some rate or some rate tra= ffic flow is not very hard but getting > cuurant rate or some othe statistics this tc is a problem ( I also tried = to use libnetlink library but its's very hard ). >=20 I agree, this is the drawback I mention above, bwm-tools also supports "classes" in the sense that it is used in TC as a parent->child->child scenario we support the exact same thing, with unlimited children allowed all with their own configurable traffic rates and queues. > Method of control traffic flow in bwmd looks more better (I don't know h= ow good it is for system performance). > In this case program may easy get current flow speed and etc... Well, a 433MMX Celeron can maintain an average of 5,500 packets per second with a 84byte total packet size and can maintain about 2,800 packets per second with a 1500 packet size. I"m not sure exactly how good these results are, but I guess its not bad at all. >=20 > Can you explain me how bwmd working? I saw the code & basic principle i = understand. There is a thread which accepts traffic from ip_queue, deciding if it needs to be dropped (if the queues are all full). (NF_DROP) There is then another thread which processes the flows, sending the packet from a child, to its parent, to its parent and so on, this is responsible for accepting the traffic to flow through bwmd. (NF_ACCEPT) The other threads are STAT & REPORT, stat keeps up the averages used for bursting and rates used in bwm_monitor (which really is cool, I decided to write bwm_monitor because I would like to see EXACTLY what speed my traffic flows are using). Report is used to write counters to the log files. I would like to use bwm_monitor in future to actually live configure bwmd, and also create graphs with a nice cursor interface... but that is for much later when I have volunteers to help me. > I am VERY interesting to part code of enqueuenig/dequeuning packets with= ip_queue kernel module. Cool, maybe you can help us out... we just accept from ip_queue... so what you could do is actually hadd different queueing diciplines to bwmd (ie. teach it how to queue properly) > What QoS You are using as shaping or it is Your own approach? FIFO, I know its stupid... but was all I could put together in a short period. What I would like to do is add priorities to bwmd, so there is a standard order in which packets are accepted, then depending on the different queueing diciplines you can then determine the priority of the packet. This is the proper approach because if you have a parent flow and a child flow, you will need a "standard" way in which packets are classified so as to beable to have different diciplines used for both the child and the parent whilst at the same time accepting packets to pass through in the order which they supposed to. > maybe you khow some urls about such probles. I think QOS diciplines are defined in RFC's, I've read a few documents on the net which I got from a google search. Most of these explain how the diciplines work... it would be a large job to implement them but would be worth your while!=20 > Any suggestion is welcomed. Join our team of developers? hehehe, I would be prepared in any way I can to help with any queries you have. I must admit that the current flow processing functions are a little messy and needs cleaning up. Basically priority of packets must be added. Then when a packet is received with the netlink (ip_queue) read, they can be classified based on the queuing dicipline used by the particular flow. The packet can then either be re-classified by its' parent, or the priority it has can be used. >=20 >=20 > THANKS IN ADVANCE. No problem. -Nigel |
From: Andriy T. Y. <wir...@wi...> - 2003-06-18 16:13:21
|
Hallo. I can't complete understand all options for traffic flows. Assume I what shape incomming and outgoing traffic for web (tcp port 80). I dont start bwm_firewall just do it by hand: iptables -t mangle -F iptables -t mangle -A INPUT -i eth0 -p tcp --sport 80 -j MARK --set-mark 1001 iptables -t mangle -A OUTPUT -o eth0 -p tcp --dport 80 -j MARK --set-mark 1002 iptables -t filter -F iptables -t filter -A INPUT -i eth0 -m mark --mark 1001 -j QUEUE iptables -t filter -A OUTPUT -o eth0 -m mark --mark 1002 -j QUEUE Look at part of firewall.xml that use bwmd: <traffic> <flow name="mainline" stats-len="10" queue-size="262144" queue-len="300" max-rate="65536" burst-rate="131072" counter-timeout="60"> <flow name="1_client_in" max-rate="8192" flow-id="1001"> c_traffic_in; </flow> <flow name="1_client_out" max-rate="8192" flow-id="1002"> c_traffic_out; </flow> </flow> </traffic> For example I what shape incomming traffic ( name="1_client_in" ) to 10240 bytes per sec (10KB/sec) and outgoing traffic ( name="1_client_out" ) to 1024 bytes per sec (1KB/sec). Which values for parameters stats-len queue-size queue-len max-rate burst-rate counter-timeout in this case? I tried to set some parameters but when downloading big file (~20 Mb) I got NOT fluent flow and not stable speed (with jumps). ( When I shape trafic with kernel QoS download flow approximally equal to rate that I set to qdisc and flow was fluent. ) What are relationships between parameters? And more : What is CONCEPTION of shaping? -- Andriy T. Yanko wir...@wi... * Avoid The Gates of Hell use Linux ** Wenn ich sterbe, legt mir eine Birne in mein Grab ... |
From: Nigel K. <nk...@lb...> - 2003-06-18 17:34:11
|
> Assume I what shape incomming and outgoing traffic for web (tcp port 80). > I dont start bwm_firewall just do it by hand: >=20 > iptables -t mangle -F > iptables -t mangle -A INPUT -i eth0 -p tcp --sport 80 -j MARK --set-mar= k 1001 > iptables -t mangle -A OUTPUT -o eth0 -p tcp --dport 80 -j MARK --set-mar= k 1002 >=20 > iptables -t filter -F > iptables -t filter -A INPUT -i eth0 -m mark --mark 1001 -j QUEUE > iptables -t filter -A OUTPUT -o eth0 -m mark --mark 1002 -j QUEUE >=20 this looks fine :) >=20 > Look at part of firewall.xml that use bwmd: >=20 > <traffic> > <flow name=3D"mainline" stats-len=3D"10" queue-size=3D"262144" queue-len= =3D"300" max-rate=3D"65536" burst-rate=3D"131072" counter-timeout=3D"60"> > <flow name=3D"1_client_in" max-rate=3D"8192" flow-id=3D"1001"> > c_traffic_in; > </flow> > <flow name=3D"1_client_out" max-rate=3D"8192" flow-id=3D"1002"> > c_traffic_out; > </flow> > </flow> > </traffic> >=20 yep, you can define blank classes to be in the flows if you want to write your own firewall scripts :) > For example I what shape incomming traffic ( name=3D"1_client_in" ) to 1= 0240 bytes per sec (10KB/sec) > and outgoing traffic ( name=3D"1_client_out" ) to 1024 bytes per sec (1= KB/sec). >=20 correct, as above > Which values for parameters=20 >=20 > stats-len > queue-size > queue-len > max-rate > burst-rate > counter-timeout >=20 > in this case? >=20 if you don't want bursting all you need define is the following... stats-len =3D 0 queue-len =3D 5 (allows 5 packets in the queue, you can also use 10) max-rate =3D 1024 >=20 > I tried to set some parameters but when downloading big file (~20 Mb) I g= ot NOT fluent flow and not stable speed (with jumps). this could be the dropping of packets instead of queueing, add a nice queue-len so you don't drop packets. > ( When I shape trafic with kernel QoS download flow approximally equal t= o rate that I set to qdisc and flow was fluent. ) >=20 try adding a queue-len... else the packets are dropped > What are relationships between parameters? >=20 check the configuration documentation in the doc directory :) > And more : What is CONCEPTION of shaping? >=20 conception means the realization of it, maybe when it was first conceived... when someone first realized it was needed... *shrug* > --=20 > Andriy T. Yanko > wir...@wi... >=20 > * Avoid The Gates of Hell use Linux > ** Wenn ich sterbe, legt mir eine Birne in mein Grab ... --=20 Nigel Kukard (Chief Executive Officer) Lando Technologies Africa (Pty) Ltd ni...@la... www.lando.co.za Tel: 083 399 5822 Fax: 086 1100036 Hoheisen Park Bellville, Cape Town National Internet Service Provider The best language to use is the language that was designed for what you want to use it for - 1997 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Disclaimer ---------- The contents of this message and any attachments are intended=20 solely for the addressee's use and may be legally privileged and/or=20 confidential information. This message may not be retained,=20 distributed, copied or used if you are not he addressee of this=20 message. If this message was sent to you in error, please notify=20 the sender immediately by reply e-mail and then destroy the message=20 and any copies thereof. Opinions, conclusions and other information in this message may be=20 personal to the sender and is not that of Lando Technologies Africa=20 or any of it's subsideries, associated companies or principals and=20 is therefore not endorsed by any of the Lando groups of companies.=20 Due to e-maill communication being insecure, Lando groups of=20 companies do not guarantee confidentiality, security, accuracy or =20 performance of the e-mail. Any liability for viruses is excluded=20 to the fullest extent. |
From: Andriy T. Y. <wir...@wi...> - 2003-06-19 06:19:28
|
On Wed, 18 Jun 2003 19:33:48 +0200 Nigel Kukard <nk...@lb...> wrote: > > Assume I what shape incomming and outgoing traffic for web (tcp port 80). > > I dont start bwm_firewall just do it by hand: > > > > iptables -t mangle -F > > iptables -t mangle -A INPUT -i eth0 -p tcp --sport 80 -j MARK --set-mark 1001 > > iptables -t mangle -A OUTPUT -o eth0 -p tcp --dport 80 -j MARK --set-mark 1002 > > > > iptables -t filter -F > > iptables -t filter -A INPUT -i eth0 -m mark --mark 1001 -j QUEUE > > iptables -t filter -A OUTPUT -o eth0 -m mark --mark 1002 -j QUEUE > > > > this looks fine :) > > > > > Look at part of firewall.xml that use bwmd: > > > > <traffic> > > <flow name="mainline" stats-len="10" queue-size="262144" queue-len="300" max-rate="65536" burst-rate="131072" counter-timeout="60"> > > <flow name="1_client_in" max-rate="8192" flow-id="1001"> > > c_traffic_in; > > </flow> > > <flow name="1_client_out" max-rate="8192" flow-id="1002"> > > c_traffic_out; > > </flow> > > </flow> > > </traffic> > > > > yep, you can define blank classes to be in the flows if you want to > write your own firewall scripts :) > > > > For example I what shape incomming traffic ( name="1_client_in" ) to 10240 bytes per sec (10KB/sec) > > and outgoing traffic ( name="1_client_out" ) to 1024 bytes per sec (1KB/sec). > > > > correct, as above > > > Which values for parameters > > > > stats-len > > queue-size > > queue-len > > max-rate > > burst-rate > > counter-timeout > > > > in this case? > > > > if you don't want bursting all you need define is the following... > stats-len = 0 > queue-len = 5 (allows 5 packets in the queue, you can also use 10) > max-rate = 1024 ok. I tried but not this not working - no download speed! :(( Can you give me correct working config file for my example? I what control 2 different flows incoming(10KB/s) & outgoing(1KB/s). I think that in this case I don't need parent (mainline) flow. Just 2 separate flows. -- Andriy T. Yanko wir...@wi... * Avoid The Gates of Hell use Linux ** Wenn ich sterbe, legt mir eine Birne in mein Grab ... |
From: Nigel K. <nk...@lb...> - 2003-06-19 07:09:03
|
Hang on.... the normal packet size is 1500, you setting a limit to 1024 which is less than the packet size... i think this might be a bug. But this means that you want 75% of a packet to pass through your box every second, is this right? Regards -Nigel |
From: Nigel K. <nk...@lb...> - 2003-06-20 05:29:16
|
> >Hang on.... the normal packet size is 1500, you setting a limit to 1024 > >which is less than the packet size... i think this might be a bug. But > >this means that you want 75% of a packet to pass through your box every > >second, is this right? >=20 > from Your documentation: > max-rate=3D"" > - Maximum rate in bytes/s before packets are queu= ed, > packets are not queued if they can be bursted. = If > 0 is specified only logging of traffic will occ= ur >=20 > this parameter control paket size? xm.... >=20 > I whated set speed 1024kbytes per second (1 Mbyte per sec) not packet siz= e. 1Mbyte =3D 1024 x 1024 =3D> max-rate=3D1048576 max-rate is in BYTES, not KBytes :) >=20 > And now I completly don't understand your parameters. :( >=20 >=20 |