Traffic priority how ?

Posted on 2006-04-07
Last Modified: 2008-02-01
Hi to everybody
I just want to make only traffic priority by port ot type of service not shape traffic just to be shure that for example
even there is havy downloading ssh or icmp will be go first after pop3 and all other traffic will be last like P2P .
I'm  i can't find how to do it i try with PRIO but without sucsess.

Any advices ?
Question by:snedelchev
    LVL 27

    Expert Comment

    start from here:
    then go here:
    then man tc

    CBQ for you is reasonable as it seems for me. Don't forget to limit outbound rate.
    Also note, that you cannot control incoming traffic very well.
    LVL 27

    Expert Comment

    This chapter of that link is most useful :-)
    LVL 3

    Author Comment

    I'm familiar with this technologies . I need some example of using PRIO qdisk with TBF if it's needed to make priorities of the traffic.
    LVL 27

    Accepted Solution

    I compiled kernel with support of all possible IP features.
    It works fine for me.

    1) Remember you may prioritize only outgoing packets

    2) you have 3 classes in PRIO queue:
    1 - icmp or ssh
    2 - pop3
    3 - all other

    3) You are attaching to the interface itself, not to another queue discipline, so your parent will be 'root', read

    tc qdisc add dev eth0 parent root prio bands 3

    4) To see what is your class id:
    'tc -s qdisc'
    For me it was 8001:

    5)  Now you should create filter to sort your traffic between classes, read , chapter 9.6.1 is what you want.

    # ssh traffic goes to queue 1 (8001:1) most priority
    tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip dport 22 0xffff flowid 8001:1
    tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip sport 22 0xffff flowid 8001:1
    # icmp is an ip proto number 1
    tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip protocol 1 0xff flowid 8001:1
    # http goes to queue number 2 (8001:2) normal proprity
    tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip dport 80 0xffff flowid 8001:2
    tc filter add dev eth0 protocol ip parent 8001: prio 1 u32 match ip sport 80 0xffff flowid 8001:2
    # all other traffic is default (method from larc site doesnt' work, you may also try to mark all traffic in iptable then to specify here)

    6) Check that filters are in-place:
    tc show filter dev eth0

    Other useful link (for common knowledge of traffic control):

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now