diff --git a/LDP/howto/docbook/ADSL-Bandwidth-Management-HOWTO.sgml b/LDP/howto/docbook/ADSL-Bandwidth-Management-HOWTO.sgml index bdd3cfda..a913390c 100644 --- a/LDP/howto/docbook/ADSL-Bandwidth-Management-HOWTO.sgml +++ b/LDP/howto/docbook/ADSL-Bandwidth-Management-HOWTO.sgml @@ -15,10 +15,30 @@ - 1.0 - 2002-08-21 - ds - Better control over bandwidth, more theory, updated for 2.4 kernels + 1.2 + 2002-09-26 + ds + + Added link to new Email Discussion List. + Added small teaser to caveat section regarding new and improved + QoS for Linux designed specifically for ADSL to be released soon. + + + + 1.1 + 2002-08-26 + ds + + A few corrections (Thanks to the many that pointed + them out!). Added informational caveat to implementation + section. + + + + 1.0 + 2002-08-21 + ds + Better control over bandwidth, more theory, updated for 2.4 kernels 0.1 @@ -51,10 +71,20 @@ New Versions of This Document You can always view the latest version of this document on the World Wide Web at the - URL http://www.linuxdoc.org. + URL: http://www.tldp.org. New versions of this document will also be uploaded to various Linux WWW and FTP sites, including the LDP home page at - http://www.linuxdoc.org. + http://www.tldp.org. + + + Email Discussion List + + For questions and update information regarding ADSL Bandwidth Management + please subscribe to the ADSL Bandwidth Management email list at + http://jared.sonicspike.net/mailman/listinfo/adsl-qos. + Disclaimer @@ -64,13 +94,14 @@ Copyright and License - This document is copyright 2001 by Dan Singletary, and is + This document is copyright 2002 by Dan Singletary, and is released under the terms of the GNU Free Documentation License, which is hereby incorporated by reference. Feedback and corrections - If you have questions or comments about this document, please feel free + If you have questions or comments about this document, please feel free to + contact the author at dvsing@sonicspike.net. @@ -91,6 +122,10 @@ HTB queue - http://luxik.cdi.cz/~devik/qos/htb/ + + + Note: it has been reported that kernels since version 2.4.18-3 shipped with Mandrake (8.1, 8.2) + have already been patched for HTB. @@ -334,6 +369,45 @@ Implementation Now with all of the explanation out of the way it's time to implement bandwidth management with Linux. + + Caveats + + Limiting the actual rate of data sent to the DSL modem is not as simple as it may seem. Most DSL modems + are really just ethernet bridges that bridge data back and forth between your linux box and the gateway + at your ISP. Most DSL modems use ATM as a link layer to send data. ATM sends data in cells that are always + 53 bytes long. 5 of these + bytes are header information, leaving 48 bytes available for data. Even if you are sending 1 byte of data, + an entire 53 bytes of bandwidth are consumed sent since ATM cells are always 53 bytes long. This means that + if you are + sending a typical TCP ACK packet which consists of 0 bytes data + 20 bytes TCP header + 20 bytes IP header + + 18 bytes Ethernet header. In actuality, even though the ethernet packet you are sending has only 40 bytes of + payload (TCP and IP header), the minimum payload for an Ethernet packet is 46 bytes of data, so the remaining + 6 bytes are padded with nulls. This means that the actual length of the Ethernet packet plus header is + 18 + 46 = 64 bytes. In order to send 64 bytes over ATM, you have to send two ATM cells which consume 106 + bytes of bandwidth. This means for every TCP ACK packet, you're wasting 42 bytes of bandwidth. + This would be okay if Linux accounted for the + encapsulation that the DSL modem uses, but instead, Linux only accounts the TCP header, IP header, and 14 bytes + of the MAC address (Linux doesn't count the 4 bytes CRC since this is handled at the hardware level). Linux + doesn't count the minimum Ethernet packet size of 46 bytes, nor does it take into account the fixed ATM cell + size. + + + What all of this means is that you'll have to limit your outbound bandwidth to somewhat less than your + true capacity (until we can figure out a packet scheduler that can account for the various types of + encapsulation being used). You may find that you've figured out a good number to limit your bandwidth to, but + then you download a big file and the latency starts to shoot up over 3 seconds. This is most likely + because the bandwidth those small ACK packets consume is being miscalculated by Linux. + + + I have been working on a solution to this problem for a few months and have almost settled on a solution + that I will soon release to the public for further testing. The solution involves using a user-space + queue instead of linux's QoS to rate-limit packets. I've basically implemented a simple HTB queue + using linux user-space queues. This solution (so far) has been able to regulate outbound traffic SO WELL + that even during a massive bulk download (several streams) and bulk upload (gnutella, several streams) + the latency PEAKS at 400ms over my nominal no-traffic latency of about 15ms. For more information on + this QoS method, subscribe to the email list for updates or check back on updates to this HOWTO. + + Script: myshaper The following is a listing of the script which I use to control bandwidth on my Linux router. It uses @@ -518,7 +592,7 @@ tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 26 fw flowid 1:26 # add MYSHAPER-OUT chain to the mangle table in iptables - this sets up the table we'll use # to filter and mark packets. iptables -t mangle -N MYSHAPER-OUT -iptables -t mangle -I POSTROUTING -o eth0 -j MYSHAPER-OUT +iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT # add fwmark entries to classify different types of traffic - Set fwmark from 20-26 according to # desired class. 20 is highest prio. @@ -585,7 +659,7 @@ tc filter add dev imq0 parent 1:0 prio 0 protocol ip handle 21 fw flowid 1:21 # add MYSHAPER-IN chain to the mangle table in iptables - this sets up the table we'll use # to filter and mark packets. iptables -t mangle -N MYSHAPER-IN -iptables -t mangle -I PREROUTING -i eth0 -j MYSHAPER-IN +iptables -t mangle -I PREROUTING -i $DEV -j MYSHAPER-IN # add fwmark entries to classify different types of traffic - Set fwmark from 20-26 according to # desired class. 20 is highest prio. diff --git a/LDP/howto/docbook/HOWTO-INDEX/howtoChap.sgml b/LDP/howto/docbook/HOWTO-INDEX/howtoChap.sgml index f912797e..b85fcf9b 100644 --- a/LDP/howto/docbook/HOWTO-INDEX/howtoChap.sgml +++ b/LDP/howto/docbook/HOWTO-INDEX/howtoChap.sgml @@ -68,7 +68,7 @@ various issues related to this. ADSL-Bandwidth-Management-HOWTO, ADSL Bandwidth Management HOWTO -Updated: August 2002. +Updated: September 2002. Describes how to configure a linux router to more effectively manage outbound traffic on an ADSL modem. @@ -515,7 +515,7 @@ partition images to and from a TFTP server. Cluster-HOWTO, Linux Cluster HOWTO -Updated: May 2002. +Updated: September 2002. How to set up high-performance Linux computing clusters. diff --git a/LDP/howto/docbook/HOWTO-INDEX/hwSect.sgml b/LDP/howto/docbook/HOWTO-INDEX/hwSect.sgml index aa828c1c..7ba319f1 100644 --- a/LDP/howto/docbook/HOWTO-INDEX/hwSect.sgml +++ b/LDP/howto/docbook/HOWTO-INDEX/hwSect.sgml @@ -100,7 +100,7 @@ various issues related to this. Cluster-HOWTO, Linux Cluster HOWTO -Updated: May 2002. +Updated: September 2002. How to set up high-performance Linux computing clusters. @@ -191,6 +191,29 @@ Provides a guide for setting up a WWW-based kiosk using Linux, X11R6, FVWM2, Netscape Navigator 4.X, and a customized trackball. + + + +KDE-Kiosk-Mode, +KDE-Kiosk-Mode HOWTO + + + + + + + [ Archived ] + + + +Updated: September 2002. +Describes how to invoke the kiosk mode of KDE. + +Further information can be found at: + +http://www.brigadoon.de/peter/kde/. + + diff --git a/LDP/howto/docbook/HOWTO-INDEX/miniChap.sgml b/LDP/howto/docbook/HOWTO-INDEX/miniChap.sgml index 854d27cd..7345c549 100644 --- a/LDP/howto/docbook/HOWTO-INDEX/miniChap.sgml +++ b/LDP/howto/docbook/HOWTO-INDEX/miniChap.sgml @@ -694,6 +694,29 @@ get a permanent IP (if available), get a domain name, and have a bona fide system running in a little over thirty minutes. + + + +KDE-Kiosk-Mode, +KDE-Kiosk-Mode HOWTO + + + + + + + [ Archived ] + + + +Updated: September 2002. +Describes how to invoke the kiosk mode of KDE. + +Further information can be found at: + +http://www.brigadoon.de/peter/kde/. + + diff --git a/LDP/howto/docbook/HOWTO-INDEX/networkingSect.sgml b/LDP/howto/docbook/HOWTO-INDEX/networkingSect.sgml index f7f0f1b3..79fe412c 100644 --- a/LDP/howto/docbook/HOWTO-INDEX/networkingSect.sgml +++ b/LDP/howto/docbook/HOWTO-INDEX/networkingSect.sgml @@ -54,7 +54,7 @@ the Linux Networking Kernel or more specifically kernel releases ADSL-Bandwidth-Management-HOWTO, ADSL Bandwidth Management HOWTO -Updated: August 2002. +Updated: September 2002. Describes how to configure a linux router to more effectively manage outbound traffic on an ADSL modem.