User Tools

Site Tools


unix:traffic-shaping

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
unix:traffic-shaping [2009/07/12 16:16]
robm created
unix:traffic-shaping [2009/07/12 20:53]
robm
Line 1: Line 1:
 ====== Traffic Shaping ====== ====== Traffic Shaping ======
  
-Installed the wrong package (''fragroute'' instead of ''fragrouter'')+  * Limit a single app with the ''trickle'' package
  
-<code> +<code bash> 
-wget https://launchpad.net/ubuntu/intrepid/+source/fragroute/1.2-7.1build1/+files/fragroute_1.2-7.1build1.tar.gz +# Install fragrouter 
-tar zxvf fragroute_1.2-7.1build1.tar.gz +wget https://launchpad.net/ubuntu/hoary/+source/fragrouter/1.6-2.2/+files/fragrouter_1.6.orig.tar.gz 
-cd fragroute-1.2/ +wget https://launchpad.net/ubuntu/hoary/+source/fragrouter/1.6-2.2/+files/fragrouter_1.6-2.2.diff.gz 
-sudo apt-get install debhelper libdumbnet-dev libevent-dev libpcap-dev +tar zxvf fragrouter_1.6.orig.tar.gz 
-dpkg-buildpackage -uc -b +cd fragrouter-1.6/ 
-cd .. +zcat ../fragrouter_1.6-2.2.diff.gz | patch 
-sudo dpkg -i fragroute_1.2-7.1build1_amd64.deb+</code> 
 + 
 +<code bash> 
 +sudo apt-get install dsniff # Install arpspoof / tcpdump et al 
 +echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward # Enable IP forwarding 
 +route -n # Find gateway IP 
 +   Kernel IP routing table 
 +   Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 
 +   192.168.1.0     0.0.0.0         255.255.255.0            0        0 eth0 
 +   169.254.0.0     0.0.0.0         255.255.0.0         1000          0 eth0 
 +   0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0 
 +sudo arpsoof 192.168.1.254 # Poison network to think we're the gateway 
 +# Open a new terminal 
 +sudo apt-get install wondershaper 
 +sudo wondershaper eth0 $((8273*8*1024)) $((1209*8*1024)) # Configure eth0 with 8MBit upload and 1MBit download (converting kB to kbit, and using numbers from my ADSL router web-interface) 
 +wondershaper eth0 
 +    qdisc cbq 1: root rate 10000Kbit (bounded,isolated) prio no-transmit 
 +     Sent 789925764 bytes 2324442 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0 
 +    qdisc sfq 10: parent 1:10 limit 127p quantum 1514b perturb 10sec 
 +     Sent 72932324 bytes 1002607 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +    qdisc sfq 20: parent 1:20 limit 127p quantum 1514b perturb 10sec 
 +     Sent 716598100 bytes 1312423 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +    qdisc sfq 30: parent 1:30 limit 127p quantum 1514b perturb 10sec 
 +     Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +    qdisc ingress ffff: parent ffff:fff1 ---------------- 
 +     Sent 742688346 bytes 2210761 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +    class cbq 1: root rate 10000Kbit (bounded,isolated) prio no-transmit 
 +     Sent 395340 bytes 9412 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0 
 +    class cbq 1:1 parent 1: rate 9904Mbit (bounded,isolated) prio 5 
 +     Sent 789530142 bytes 2315028 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0 
 +    class cbq 1:10 parent 1:1 leaf 10: rate 9904Mbit prio 1 
 +     Sent 72932270 bytes 1002606 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0 
 +    class cbq 1:20 parent 1:1 leaf 20: rate 8914Mbit prio 2 
 +     Sent 716597872 bytes 1312422 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0 
 +    class cbq 1:30 parent 1:1 leaf 30: rate 7923Mbit prio 2 
 +     Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 +     rate 0bit 0pps backlog 0b 0p requeues 0 
 +      borrowed 0 overactions 0 avgidle 781 undertime 0
 </code> </code>
  
unix/traffic-shaping.txt · Last modified: 2013/10/13 12:43 by robm