cbq+ppp0

From: Damir Galič (damirg_at_email.si)
Date: 08/27/05

  • Next message: darktiger: "Bandwidth monitor and grapher"
    Date: Sat, 27 Aug 2005 04:56:55 +0200
    
    

    I have some questions about cbq. Why are transfers so radical when limiting
    "korenje upload" to 512kbit. when watching with dumeter, the transfers are
    sometimes 600kbit/s, sometimes 300kbit/s but average still around
    480kbit/s... when I set limits to 256kbit the transfers are steady, I see
    smooth line on du-meter.
    second problem is, why limiting internet traffic sent to local linux won't
    work? I can see packets being marked so it should work, but it doesn't.

      $IPTABLES -t mangle -A INPUT -i $EXTINT -d $EXTIP -j MARK --set-mark 7
      $IPTABLES -t mangle -A OUTPUT -o $EXTINT -s $EXTIP -j MARK --set-mark 8

      $IPTABLES -t mangle -A FORWARD -d ${IPPC1} -j
    MARK --set-mark 4 # pc1 download
      $IPTABLES -t mangle -A FORWARD -p TCP -d ${IPPC1} --sport 80 -j
    MARK --set-mark 11
      $IPTABLES -t mangle -A FORWARD -p ICMP -d ${IPPC1} -j
    MARK --set-mark 11
      $IPTABLES -t mangle -A FORWARD -d ${IPPC1} -j RETURN
      $IPTABLES -t mangle -A FORWARD -s ${IPPC1} -j
    MARK --set-mark 3 # pc1 upload
      $IPTABLES -t mangle -A FORWARD -p TCP -s ${IPPC1} --dport 80 -j
    MARK --set-mark 10
      $IPTABLES -t mangle -A FORWARD -p ICMP -s ${IPPC1} -j
    MARK --set-mark 10
      $IPTABLES -t mangle -A FORWARD -s ${IPPC1} -j RETURN
      $IPTABLES -t mangle -A FORWARD -d ${IPPC2} -j
    MARK --set-mark 1 # pc2 download
      $IPTABLES -t mangle -A FORWARD -s ${IPPC2} -j
    MARK --set-mark 2 # pc2 upload
      $IPTABLES -t mangle -A FORWARD -d ${IPPC2} -j RETURN

    /sbin/tc qdisc add dev eth1 root handle 1:0 cbq avpkt 1000 bandwidth
    $INTSPEED
    /sbin/tc class add dev eth1 parent 1:0 classid 1:10 cbq rate $INTSPEED
    bandwidth $INTSPEED prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev eth1 parent 1:0 classid 1:20 cbq rate 3300kbit
    bandwidth $INTSPEED prio 1 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev eth1 parent 1:20 classid 1:210 cbq rate 2500kbit
    bandwidth 3300kbit prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev eth1 parent 1:20 classid 1:220 cbq rate 2500kbit
    bandwidth 3300kbit prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 7 handle 4 fw
    flowid 1:10 # 4 korenje download
    /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 6 handle 11 fw
    flowid 1:10 # 11 korenje download (port 80, icmp)
    /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 1 fw
    flowid 1:210 # bitje download
    /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 5 handle 6 fw
    flowid 1:220 # ostali download

    /sbin/tc qdisc add dev ppp0 root handle 1:0 cbq avpkt 1000 bandwidth
    $INTSPEED
    /sbin/tc class add dev ppp0 parent 1:0 classid 1:10 cbq rate $INTSPEED
    bandwidth $INTSPEED prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:0 classid 1:20 cbq rate 350kbit
    bandwidth $INTSPEED prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:20 classid 1:210 cbq rate 256kbit
    bandwidth 350kbit prio 3 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:20 classid 1:220 cbq rate 256kbit
    bandwidth 350kbit prio 4 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:0 classid 1:30 cbq rate 300kbit
    bandwidth $INTSPEED prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:30 classid 1:310 cbq rate 100kbit
    bandwidth 300kbit prio 5 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc class add dev ppp0 parent 1:30 classid 1:320 cbq rate 100kbit
    bandwidth 300kbit prio 6 allot 1492 cell 8 maxburst 200 avpkt 1000 bounded
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 6 handle 3 fw
    flowid 1:10 # 3 korenje upload
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 0 handle 10 fw
    flowid 1:10 # 10 korenje upload (port 80, icmp)
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 2 fw
    flowid 1:210 # bitje upload
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 5 fw
    flowid 1:220 # ostali upload
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 handle 8 fw
    flowid 1:310 # lin upload
    /sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 7 fw
    flowid 1:320 # lin download


  • Next message: darktiger: "Bandwidth monitor and grapher"

    Relevant Pages

    • Re: FTP Upload replacement
      ... It doesn't properly preserve timestamps. ... During an upload you have an inconsistent website, ... FTP, ... transfers is the best solution for my situation. ...
      (comp.lang.java.programmer)
    • Re: FTP Troubles
      ... But anytime I have a file that is over around ... or 10 megs the file doesnt complete the upload when using a program ... Essentially the upload gets ... which is idle during data transfers. ...
      (microsoft.public.inetserver.iis.ftp)
    • Re: fetch alternative - ftp uploads
      ... routinely upload and download 300-400-500 MB files, always with Fetch, ... I've been using www.yousendit.com for my transfers. ... They have an application called yousendit express available for windows and mac that is a little standalone client that not only resumes interrupted uploads but it is not affected by your browser use so there is no danger of accidentally closing your browser window or having another application request for your browser somehow end your transfer. ...
      (rec.arts.movies.production.sound)
    • Re: fetch alternative - ftp uploads
      ... routinely upload and download 300-400-500 MB files, always with Fetch, ... I've been usingwww.yousendit.comfor my transfers. ... affected by your browser use so there is no danger of accidentally closing ... your browser window or having another application request for your browser ...
      (rec.arts.movies.production.sound)