Page 9 of 9 FirstFirst ... 789
Results 121 to 128 of 128

Thread: Wondershaper QoS discussion

  1. #121
    Sorry, sorry.

    Now, I think I understand it.
    Thank you very much.

    So if I want to mask ports 27000 to 28031 Then I can use rules something like this:
    27000 0xfff8
    port: 0110 1001 0111 1000
    mask: 1111 1111 1111 1000

    (27000-27007)

    27008 0xff80
    port: 0110 1001 1000 0000
    mask: 1111 1111 1000 0000

    (27008-27135)

    27136 0xfe00
    port: 0110 1010 0000 0000
    mask: 1111 1110 0000 0000

    (27136-27647)

    27648 0xff00
    port: 0110 1100 0000 0000
    mask: 1111 1111 0000 0000

    (27648-27903)

    27904 0xff80
    port: 0110 1101 0000 0000
    mask: 1111 1111 1000 0000

    (27904-28031)

    Yes, I have read http://lartc.org/howto/, but I didn't find another method to define port ranges.


    Thank you very, very much again.
    Quote Originally Posted by akbor View Post

    I said, if the mask bit is zero, the port bit is "don't care"

    1024 0xfc00 will prioritize a range of 1024... 2047, so:

    port 0000 0100 0000 0000
    mask 1111 1100 0000 0000

    ===> 0000 01xx xxxx xxxx

    so the min. range is
    0000 0100 0000 0000 = 0x400 = 1024

    the max. range is
    0000 0111 1111 1111 = 0x7ff = 2047

  2. #122
    I've been battling issues with bandwidth shaping on the wl-700ge with a custom firmware installed using wondershaper (the GUI bandwidth doesn't work). The objective is "simple". I am trying to limit outbound FTP traffic so that I can use my network without having FTP transfers (from the server) choke my network and also allow my network activities (email, web, torrent) to take priority over FTP when needed (while allowing FTP a minimum amount). I don't want to touch my download speeds.

    My bandwidth is 5000kbps down and 650kbps up (pretty constant on multiple checks)

    The goal for the FTP is a minimum of 120kbps with a max of 480kbps and a lower priority so that if I'm doing other uploading then FTP is forced towards its minimum rate.

    Now when I start wondershaper, I get the end result of BOTH my up speed and down speeds capping to 600kbps (checking using speedtest.net). If I increase the uplink parameter to some crazy level (like 7000kbps) and increase the ceil (on classid 1:20) up to any number higher than 600kbps my downloads are restored (to a max of whatever number was entered eg 700 > 700kbps, 6000 > 5000kbps [my actual max])... but the uploads are no longer capped (they go to uncapped max of 650kbps).

    I'm guessing that something in the script is not right and I'm hoping someone might be able to help.

    I've tried many edits and also just turned off the ingress filter altogether (trying to reduce variables).

    Here are my launch command, script, launch response and status results.

    launch command
    Code:
    wshaper start eth0 4800 600 "" "" "20 21" ""
    wshaper script (had to hard code the rates that involved math as I got syntax errors for some reason).
    PHP Code:
    #!/bin/sh
    # Wonder Shaper, last modified by Robert Koch (aka akbor)
    #
    # Set the following values to somewhat less than your actual download
    # and uplink speed. In kilobits. Also set the device that is to be shaped.

    DOWNLINK=$3
    UPLINK
    =$4
    DEV
    =$2

    # low priority OUTGOING traffic - you can leave this blank if you want
    # low priority source netmasks
    NOPRIOHOSTSRC="$5"

    # low priority destination netmasks
    NOPRIOHOSTDST="$6"

    # low priority source ports
    NOPRIOPORTSRC="$7"

    # low priority destination ports
    NOPRIOPORTDST="$8"

    if [ "$1" "status" ]
    then
            tc 
    -s qdisc ls dev $DEV
            tc 
    -class ls dev $DEV
            
    exit
    fi

    # clean existing down- and uplink qdiscs, hide errors
    tc qdisc del dev $DEV root    2> /dev/null > /dev/null
    tc qdisc del dev $DEV ingress 2
    > /dev/null > /dev/null

    if [ "$1" "stop" 
    then 
            
    exit
    fi

    ########## uplink ##########

    # install root HTB, point default traffic to 1:20:
    tc qdisc add dev $DEV root handle 1htb default 20

    # shape everything at $UPLINK speed - this prevents huge queues in your
    # DSL modem which destroy latency:
    tc class add dev $DEV parent 1classid 1:1 htb rate ${UPLINK}kbit \
      
    ceil ${UPLINK}kbit burst 6k

    # high prio class 1:10 - gets 40 to 100% traffic and highest priority:
    # tc class add dev $DEV parent 1:1 classid 1:10 htb rate $((4*$UPLINK/10))kbit \
    #   ceil ${UPLINK}kbit burst 6k prio 1

    tc class add dev $DEV parent 1:1 classid 1:10 htb rate 240kbit \
      
    ceil 600kbit burst 6K prio 1
     
    # bulk & default class 1:20 - gets 40 to 100% traffic and lower priority: 
    # tc class add dev $DEV parent 1:1 classid 1:20 htb rate $((4*$UPLINK/10))kbit \
    #   ceil ${UPLINK}kbit burst 6k prio 2

    tc class add dev $DEV parent 1:1 classid 1:20 htb rate 240kbit \
      
    ceil 600kbit burst 6k prio 2

    # lowest priority class 1:30 - gets 20 to 80% traffic and lowest priority:
    # tc class add dev $DEV parent 1:1 classid 1:30 htb rate $((2*$UPLINK/10))kbit \
    #   ceil $((8*$UPLINK/10))kbit burst 6k prio 3

    tc class add dev $DEV parent 1:1 classid 1:30 htb rate 120kbit \
      
    ceil 480kbit burst 6k prio 3

    # all get Stochastic Fairness:
    tc qdisc add dev $DEV parent 1:10 handle 10sfq perturb 10
    tc qdisc add dev $DEV parent 1
    :20 handle 20sfq perturb 10
    tc qdisc add dev $DEV parent 1
    :30 handle 30sfq perturb 10

    # high priority for VoIP traffic (by TOS)
    # tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 \
    #   match ip tos 0x68 0xff \
    #   match ip protocol 0x11 0xff \
    #   flowid 1:10
    # tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 \
    #   match ip tos 0xb8 0xff \
    #   match ip protocol 0x11 0xff \
    #   flowid 1:10

    # high priority for VoIP traffic (by source port)
    # tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 \
    #   match ip sport 5004 0xffff \
    #   match ip protocol 0x11 0xff \
    #   flowid 1:10
    # tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 \
    #   match ip sport 5060 0xffff \
    #   match ip protocol 0x11 0xff \
    #   flowid 1:10
       
    # TOS Minimum Delay (ssh, NOT scp) in 1:10:
    tc filter add dev $DEV parent 1:0 protocol ip prio 3 u32 \
      
    match ip tos 0x10 0xff \
      
    flowid 1:10
        
    # ICMP (ip protocol 1) in the interactive class 1:10 so we 
    # can do measurements & impress our friends:
    tc filter add dev $DEV parent 1:0 protocol ip prio 1 u32 \
      
    match ip protocol 1 0xff \
      
    flowid 1:10

    # To speed up downloads while an upload is going on, put ACK packets in
    # the interactive class:
    tc filter add dev $DEV parent 1protocol ip prio 2 u32 \
      
    match ip protocol 6 0xff \
      
    match u8 0x05 0x0f at 0 \
      
    match u16 0x0000 0xffc0 at 2 \
      
    match u8 0x10 0xff at 33 \
      
    flowid 1:10

    # some traffic however suffers a worse fate
    for a in $NOPRIOPORTDST
    do
            
    tc filter add dev $DEV parent 1protocol ip prio 14 u32 \
              
    match ip dport $a 0xffff flowid 1:30
    done

    for a in $NOPRIOPORTSRC
    do
            
    tc filter add dev $DEV parent 1protocol ip prio 15 u32 \
              
    match ip sport $a 0xffff flowid 1:30
    done

    for a in $NOPRIOHOSTSRC
    do
            
    tc filter add dev $DEV parent 1protocol ip prio 16 u32 \
              
    match ip src $a flowid 1:30
    done

    for a in $NOPRIOHOSTDST
    do
            
    tc filter add dev $DEV parent 1protocol ip prio 17 u32 \
              
    match ip dst $a flowid 1:30
    done

    # rest is 'non-interactive' ie 'bulk' and ends up in 1:20
    # tc filter add dev $DEV parent 1: protocol ip prio 1 u32 \
    #  match ip dst 0.0.0.0/0 flowid 1:20

    ########## downlink ##########

    # slow downloads down to somewhat less than the real speed  to prevent 
    # queuing at our ISP. Tune to see how high you can set it.
    # ISPs tend to have *huge* queues to make sure big downloads are fast
    #
    # attach ingress policer:
    # tc qdisc add dev $DEV handle ffff: ingress

    # filter *everything* to it (0.0.0.0/0), drop everything that's
    # coming in too fast:
    # tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
    #  0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 
    launch results (the errors are I think in the sfq commands)
    PHP Code:
    req.n.nlmsg_len:36
    req
    .n.nlmsg_flags:1537
    req
    .n.nlmsg_type:36
    argv
    [7]: 20
    argv
    [6]: default
    argv[5]: htb
    argv
    [4]: 1:
    argv[3]: handle
    argv
    [2]: root
    argv
    [1]: eth0
    argv
    [0]: dev
    LOOP
    argc8argvdev
    LOOP
    argc6argvroot
    LOOP
    argc5argvhandle
    LOOP
    argc3argvhtb
    _________________________
    argv
    [1]: 20
    argv
    [0]: default
    test4-1
    req
    .n.nlmsg_len:36
    req
    .n.nlmsg_flags:1537
    req
    .n.nlmsg_type:36
    argv
    [8]: 10
    argv
    [7]: perturb
    argv
    [6]: sfq
    argv
    [5]: 10:
    argv[4]: handle
    argv
    [3]: 1:10
    argv
    [2]: parent
    argv
    [1]: eth0
    argv
    [0]: dev
    LOOP
    argc9argvdev
    LOOP
    argc7argvparent
    LOOP
    argc5argvhandle
    LOOP
    argc3argvsfq
    _________________________
    argv
    [1]: 10
    argv
    [0]: perturb
    test4
    -1
    RTNETLINK answers
    Invalid argument
    test3
    -1
    req
    .n.nlmsg_len:36
    req
    .n.nlmsg_flags:1537
    req
    .n.nlmsg_type:36
    argv
    [8]: 10
    argv
    [7]: perturb
    argv
    [6]: sfq
    argv
    [5]: 20:
    argv[4]: handle
    argv
    [3]: 1:20
    argv
    [2]: parent
    argv
    [1]: eth0
    argv
    [0]: dev
    LOOP
    argc9argvdev
    LOOP
    argc7argvparent
    LOOP
    argc5argvhandle
    LOOP
    argc3argvsfq
    _________________________
    argv
    [1]: 10
    argv
    [0]: perturb
    test4
    -1
    RTNETLINK answers
    Invalid argument
    test3
    -1
    req
    .n.nlmsg_len:36
    req
    .n.nlmsg_flags:1537
    req
    .n.nlmsg_type:36
    argv
    [8]: 10
    argv
    [7]: perturb
    argv
    [6]: sfq
    argv
    [5]: 30:
    argv[4]: handle
    argv
    [3]: 1:30
    argv
    [2]: parent
    argv
    [1]: eth0
    argv
    [0]: dev
    LOOP
    argc9argvdev
    LOOP
    argc7argvparent
    LOOP
    argc5argvhandle
    LOOP
    argc3argvsfq
    _________________________
    argv
    [1]: 10
    argv
    [0]: perturb
    test4
    -1
    RTNETLINK answers
    Invalid argument
    test3
    -
    Status results
    PHP Code:
    qdisc htb 1r2q 10 default 20 direct_packets_stat 0
    statistics truncated
     
    class htb 1:1 root rate 600Kbit ceil 600Kbit burst 6Kb cburst 2367b 
     Sent 12224 bytes 148 pkts 
    (dropped 0overlimits 0
     
    rate 204bps 2pps 
     lended
    0 borrowed0 giants0
     tokens
    62638 ctokens22360

    class htb 1:10 parent 1:1 prio 1 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b 
     Sent 1196 bytes 18 pkts 
    (dropped 0overlimits 0
     
    rate 2bps 
     lended
    18 borrowed0 giants0
     tokens
    162134 ctokens24576

    class htb 1:20 parent 1:1 prio 2 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b 
     Sent 9348 bytes 112 pkts 
    (dropped 0overlimits 0
     
    rate 202bps 2pps 
     lended
    112 borrowed0 giants0
     tokens
    156589 ctokens22360

    class htb 1:30 parent 1:1 prio 3 rate 120Kbit ceil 480Kbit burst 6Kb cburst 2213b 
     Sent 1680 bytes 18 pkts 
    (dropped 0overlimits 0
     
    rate 2bps 
     lended
    18 borrowed0 giants0
     tokens
    322560 ctokens28240 
    Any help would be greatly appreciated.

    Thanx in advance.

  3. #123
    Join Date
    May 2004
    Location
    France...
    Posts
    159

    VoIP

    Hi all,

    thanks to this huge thread i mnaged to modify the wshaper script in order to prioritize VoIP trafic, but i'm confused by some things.

    First of all here is my setup :
    1 Bewan ADSL2+ Modem on a 512/128 DSL connection
    1 Wl500g, connecting to the internet with PPPoE
    2 computers, both are connected through wireless. One of them is running P2P software (eMule)
    1 Linksys ATA adapter connected through cable to the WL500

    I'm note sur which interface i should set up for bandwidth management. I tried to use eth1, but it seems that this not sort of a solution since wshaper is shaping the connection underlying the PPPoE connection i.e. the data being shaped is the data moving through the modem and the router....
    So i made some tests using ppp0 and br0, trafic shaping seems to occur but when i make a VoIP call communication is not of a good quality.
    I can see that P2P trafic is being slowed down, but not enough and not fast enough i.e.: the longer the voIP call is, the better the quality will be. I have to wait about 2 minutes tio get acceptable quality.
    What should i do to have all other trafic drop immediatly when i make a VoIP call ?

    here is what i added to the script

    Code:
    # VOIP SIP
    tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
          match ip tos 0x68 0xff \
          flowid 1:10
    
    # VOIP RTSP
    tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
          match ip tos 0xb8 0xff \
          flowid 1:10
    i also commented all the upload stuff at the end of the script...

    Any advices ?

    thank you...
    The Struggle Continues...
    Asus WL500g #1 with fw 1.9.2.7-7f running as main home gateway, with Philipps PWC730k
    Asus WL500g #2 with fw 1.9.2.7-7f running as Wireless Client, running palantir 2.6 with SPCA5xx camera on 128MB generic USB key

  4. #124

    Thumbs up How-To now on wiki-page

    Thanks to this thread and the script written by Akbor (wow) I have now implemented WonderShaper in the WL-500g to take care of my VOIP. The quality of the conversations is now good also when surfing, down- or uploading or looking at my webcam from outside the LAN.

    Although I was a real newbie without a single experience in Linux, I was able to implement this script in the WL500g with some extra efforts. To help others I have put a simple How-To for newbies on the wiki-page:

    Please have a look to see if I forgot something or correct errors.

    Thank you all!

    Alexander
    Last edited by alfebre; 15-10-2007 at 12:15.

  5. #125
    Finally I was able to make it work for VOIP! The problem was that the copy-paste did not work for me well, I had many empty spaces in the code...

    here is the log:

    qdisc sfq 30: quantum 1518b perturb 10sec
    statistics truncated
    qdisc sfq 20: quantum 1518b perturb 10sec
    statistics truncated
    qdisc sfq 10: quantum 1518b perturb 10sec
    statistics truncated
    qdisc htb 1: r2q 10 default 20 direct_packets_stat 6
    statistics truncated
    class htb 1:1 root rate 900Kbit ceil 900Kbit burst 6Kb cburst 2751b
    Sent 14134137 bytes 19607 pkts (dropped 0, overlimits 0)
    rate 38502bps 96pps
    lended: 5989 borrowed: 0 giants: 0
    tokens: 34076 ctokens: 9955

    class htb 1:10 parent 1:1 leaf 10: prio 1 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b
    Sent 353026 bytes 6064 pkts (dropped 0, overlimits 0)
    rate 3404bps 62pps
    lended: 6064 borrowed: 0 giants: 0
    tokens: 162134 ctokens: 24576

    class htb 1:20 parent 1:1 leaf 20: prio 2 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b
    Sent 13801556 bytes 13555 pkts (dropped 0, overlimits 0)
    rate 35767bps 34pps backlog 17p
    lended: 7548 borrowed: 5989 giants: 0
    tokens: -34449 ctokens: -9546

    class htb 1:30 parent 1:1 leaf 30: prio 3 rate 120Kbit ceil 480Kbit burst 6Kb cburst 2213b
    Sent 722 bytes 6 pkts (dropped 0, overlimits 0)
    lended: 6 borrowed: 0 giants: 0
    tokens: 324268 ctokens: 28667

    I would be interested to know if these lines are correct for the Bitlord to place it under bulk priority?

    tc filter add dev $DEV parent 1: protocol ip prio 10 u32
    match ip sport 65534 0xffff
    flowid 1:30

    Can anyone post his working config again?

    Thanks.
    Last edited by piezomotor; 20-01-2008 at 03:10.

  6. #126
    (Перевел то что снизу!)

    Наконец заработал QoS- wshaper! VOIP качество поднялось нет вообще проподаний слов!

    Я обнаружил проблему- скопировались лишние пробелы в код при copy-paste, поэтому были ошибки при запуске пришлось "чистить" скрипт...

    Вопрос-прописал для Bitlord строчки но не знаю правильно или нет-

    tc filter add dev $DEV parent 1: protocol ip prio 10 u32
    match ip sport 65534 0xffff
    flowid 1:30

    а смог бы кто скинуть конфиг у кого работает?

    Спасибо!

  7. #127
    I have set it up as it was shown below and do not have any traffic going over my low priority class-

    class htb 1:30 root leaf 30: prio 3 rate 120Kbit ceil 480Kbit burst 6Kb cburst 2213b
    Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
    lended: 0 borrowed: 0 giants: 0
    tokens: 327680 ctokens: 29519

    Any idea why?

    at the same time-

    class htb 1:10 root leaf 10: prio 1 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b
    Sent 16868735 bytes 78519 pkts (dropped 0, overlimits 0)
    rate 2984bps 17pps
    lended: 78519 borrowed: 0 giants: 0
    tokens: 162561 ctokens: 24746

    class htb 1:20 root leaf 20: prio 2 rate 240Kbit ceil 600Kbit burst 6Kb cburst 2367b
    Sent 187917149 bytes 194261 pkts (dropped 32273, overlimits 0)
    rate 30835bps 34pps backlog 108p
    lended: 194153 borrowed: 0 giants: 0
    tokens: -31678 ctokens: 10837

  8. #128
    Hi,

    does anyone use wondershaper in combination with a download channel > 4 Mbit? Does it work?

    After a long time with a working (ok, not fully working, but good enough for my purposes ) Wondershaper I upgraded my bandwidth from 3Mbit to Mkbit. Now, the problem is, with active Wondershaper I'm not able to run downloads with >3.5Mbit. Further increase of the speed setting ($3) for down channel doesn't have any impact, I've just tried to configure Wondershaper for 20M downstream. I can get the full speed of my down-channel only if I turn off the Wondershaper.

    Anybody some idea?

    Regards

    Robert
    Last edited by akbor; 26-08-2009 at 17:22. Reason: typo corrected (kbit -> Mbit)
    ISP: TV Cable 50/5 Mbit
    Modem: Arris Touchstone TM822S
    "NAS": 1000 GB 2.5" HDD, EXT4, (USB @ RT-AC87U)
    Router: Asus RT-AC87U 380.68 (Merlin build), vsftpd, Samba3, NFS, Transmission, PyLoad...)
    Clients: mittlerweile unzдhlige...

Page 9 of 9 FirstFirst ... 789

Similar Threads

  1. WonderShaper/tc IP filtering
    By kolaf in forum WL-500g Q&A
    Replies: 1
    Last Post: 02-08-2005, 15:34
  2. wondershaper howto?
    By rexster in forum WL-500g Q&A
    Replies: 8
    Last Post: 01-05-2005, 14:06
  3. Wondershaper in Post-Firewall
    By britnet in forum WL-500g Q&A
    Replies: 3
    Last Post: 05-03-2005, 12:46
  4. Slow performance of WL-HDD - Discussion
    By Oleg in forum WL-HDD Q&A
    Replies: 20
    Last Post: 21-11-2004, 21:07
  5. Would it be possible to implement wondershaper?
    By Snigel in forum WL-500g Custom Development
    Replies: 25
    Last Post: 26-06-2004, 20:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •