Traffic shaping is not black magic of any sorts, and when you get your head around it then it's easy.<br><br>However, you'll make rules to start off with, then find that applications on<br>your network are not well behaved , and do all sorts of weirds things, like<br>swapping ports, changing tos headers bits, and doing other packet mangling<br>that you would't expect.<br><br>Things to know.<br><br>You can only rate limit what you send, not what people send to you,<br>you can however drop traffic coming into you, but because we have<br>piss poor broadband here, you'll never be getting more that what you <br>internal fast ethernet switch can handle (100mb probably!). Also<br>our broadband asymertic, so you'll always exceed you upload cap<br>(small) to your download capacity (large)<br><br>the main aim is to stop any traffic from being interactive traffic buffered or dropped and bulk traffic (file downloads etc) from effecting interactive or other users<br>traffic.<br><br>if
 you say have a 512kb upload speed, and send 100 512byte packets in 1 second, then this 'burst' or spike, will be buffered inside the cable modem,<br>adsl router, as the queue grows, it will finally discard packets , and that's<br>bad, you then have packet loss.<br><br>Traffic shaping removes these spikes, and prioritizes&nbsp; traffic that you specify<br><br>This avoids any queuing in the modem. if your packets are being queued or drop<br>with your isp or internets, then you can't really do much to stop that, apart<br>from change isp ;-) hahahaa. Many ISP configure equipment to have<br>very large deep queue's as this can aide download speed tests, and as most<br>isp are rated from raw d/l speed, not other metrics like latency and gitter,<br>then they win (even thought the interactivity and latency of their networks sucks).<br><br>Queue Jumping.<br><br>Traffic the can skip ahead of the queue<br><br>TCP ack packets <br><br>loosing acks are bad, if you received data, you need
 to tell the other end you've<br>got it, else the other end will send it again. I always priortise ack&nbsp; packets.<br><br>Large Packets<br><br>Packets with sizes &gt;512 bytes are usually always bulk UPLOADS packets like<br>bitorrent or ftp or http uploads.<br><br>Mark certian ports as high priority.<br><br>22, 80, or any other port that need interactive response. for games your<br>going to have to work out what ports are need etc etc.<br><br>your modem can only transmit one packet at a time, while it's being pumped<br>down the pipe, so 1500 bytes packets take much long to send down the<br>line than a 64byte packet.&nbsp; So, it's some times a good idea for smaller packets<br>(which are probably acks) to be place ahead of large packets. rember you<br>can probably send 10 64byte packets in the time it takes to send 150 byte packet. You can even tune the MTU of&nbsp; your link to a smaller value, say<br>512 to stop this blocking. only do this if you are uber elite packet
 hound,<br>and understand what mtu's are!! hahahahaha.<br><br>watch out for invisible isp traffic shaping, some isp's, when you exceed a <br>certain daily download limit will throttle your connection, this is hard<br>to detect, and will cause your d/l speed to goto hell. Some isp even<br>throttle upload speed. advice...get a new isp, and pay a bit extra for<br>better service.<br><br>you can always spilt upload bandwidth between users<br><br>if you 512kb/ upload say, you could allocate 128kb between four users.<br><br>this works well, as if your other users are out, then you get the full upload<br>capacity.<br><br>play around with it.........<br><br>traffic shaping can dramatically&nbsp; increase the effectiveness of networks,<br>I've seen over a 500 users sharing a 512kb up 2mb downline, with no<br>problems what so ever.<br><br>It's interesting to note that internet2 (10GBS links to all routers), only has<br>two queue's. Users mark their traffic as, guaranteed delivery or
 scavenger class. Apparently it works better then all of these crazy<br>complex&nbsp; qos scheme's. So as bandwidth increases , qos rules decrease ;-).<br>ahahhah... internet2 solves most problems , I think we'll probably&nbsp; see that<br>in public infrastructure in 2098. oh dear.<br><br>http://www.oreillynet.com/pub/a/network/2002/06/11/platform.html<br><br>http://www.llanito.net/Images/queue3.jpg<br><br>http://www.lightedge.com/images/qos.jpg<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>&nbsp;<br><br><br><br><br><br><br><b><i>Kris Davidson &lt;davidson.kris@gmail.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hopefully I'll be more help than last time<br><br>I've run Qos/Traffic Shaping stuff for about 4/5 years in various<br>places, had no problems with a variety of users and connection<br>settings.<br><br>I'm guess you've probablu done most of this already but just to
 be sure<br><br>Pulling the cable on each machine and not just the torrent user?<br>Tried connecting a client directly?<br>Checked to make sure theres no connection overflow stuff?,<br>particularly half-open connections<br>Confirmed it is a client issue and not an ISP or router issue (whether<br>PC or dedicated)<br><br>For quick and dirty tracking, I use the following (you might use this already)<br><br>iptables -N traffic_in<br>iptables -N traffic_out<br>iptables -I FORWARD 1 -j traffic_in<br>iptables -I FORWARD 2 -j traffic_out<br>iptables -A traffic_in -d x.x.x.x (New entry for each IP)<br>iptables -A traffic_out -s x.x.x.x (New entry for each IP)<br><br>iptables -L traffic_in -vn<br>iptables -L traffic_out -vn<br><br>Its gives me a count in size and packets, I usually do a reset then check.<br><br>Make sure your not prioritizing ACK or ICMP packets. and beyond that,<br>how are you classifying packets? IPP2P, L7 or port ranges. I've had<br>the most success with port
 ranges.<br><br>I think I remember your setup from last time but maybe you could<br>elaborate for the list again.<br><br>Kris<br><br>_______________________________________________<br>dundee GNU/Linux Users Group mailing list<br>dundee@lists.lug.org.uk  http://dundee.lug.org.uk<br>https://mailman.lug.org.uk/mailman/listinfo/dundee<br>Chat on IRC, #tlug on dundee.lug.org.uk<br></blockquote><br><p>&#32;
      ___________________________________________________________
<hr size=1> 
Yahoo! Answers - Get better answers from someone who knows. <a
href="http://uk.answers.yahoo.com/;_ylc=X3oDMTEydmViNG02BF9TAzIxMTQ3MTcxOTAEc2VjA21haWwEc2xrA3RhZ2xpbmU">Try
it now</a>.