LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-13-2015, 01:46 AM   #1
tomschuring
LQ Newbie
 
Registered: Nov 2010
Posts: 13

Rep: Reputation: 0
traffic to and from port 8080 with highest priority


I am trying to make sure that traffic to port 8080 (and the return Ack's) on an external server always have right of way over any other traffic

i have tried to add a traffic rule (on the client machine):

Code:
sudo /sbin/tc qdisc del dev eth0 root
sudo /sbin/tc qdisc add dev eth0 root handle 1: prio 
sudo /sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport 8080 0xffff flowid 1:1
sudo /sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 8080 0xffff flowid 1:1
but when i do a wget of something from port 80, the ack's from port 8080 are delayed so much they time out.

how can i make sure that traffic to and from port 8080 have the highest priority ?

Last edited by tomschuring; 08-13-2015 at 01:47 AM. Reason: clarification
 
Old 08-13-2015, 11:14 PM   #2
tomschuring
LQ Newbie
 
Registered: Nov 2010
Posts: 13

Original Poster
Rep: Reputation: 0
this seems to work

butchering what was described here: http://www.linuxquestions.org/questi...2/#post5239420 but keeping the ssh rules i ended up with this and it seems to work:

Code:
IFACE=ppp0

#delete old rules
tc qdisc del dev $IFACE root

#------ setup classes ------------------------------------------------------------------
# This line sets a HTB qdisc on the root of eth0, and it specifies that the class 1:50 is 
# used by default. It sets the name of the root as 1:, for future references.
tc qdisc add dev $IFACE root handle 1: htb default 50

# This creates a class called 1:1, which is direct descendant of root (the parent is 1:), 
# this class gets assigned also an HTB qdisc, and then it sets a max rate of 30kbit, with a burst of 10k
tc class add dev $IFACE parent 1: classid 1:1 htb rate 30Kbit burst 10k

# avl traffic child class (limited to 30Kbit)
tc class add dev $IFACE parent 1:1 classid 1:20 htb rate 30kbit ceil 30kbit burst 10k prio 1

# ssh/interactive traffic (limited to 20kbit)
tc class add dev $IFACE parent 1:1 classid 1:40 htb rate 20kbit ceil 20kbit burst 5k prio 2

# default traffic (everything else; limited to 10kbit)
tc class add dev $IFACE parent 1:1 classid 1:50 htb rate 10kbit prio ceil 10kbit burst 2k prio 3

# Martin Devera, author of HTB, then recommends SFQ for beneath these classes:
tc qdisc add dev $IFACE parent 1:20 handle 20: sfq perturb 10 
tc qdisc add dev $IFACE parent 1:40 handle 40: sfq perturb 10 
tc qdisc add dev $IFACE parent 1:50 handle 50: sfq perturb 10 

#------ Filter Section ------------------------------------------------------------------
#
# These commands adds a filter to the qdisc 1: of dev eth0, set the
# priority of the filters to 1 (all get the same priority), matches packages
# by source port, and set the class to the corresponding classid.
#
# The 0xffff designates this is for all protocols

# avl traffic
tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip dport 8080 0xffff flowid 1:20
tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip sport 8080 0xffff flowid 1:20

# ssh/interactive traffic
tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip sport 22 0xffff flowid 1:40

Last edited by tomschuring; 08-14-2015 at 01:07 AM. Reason: fixed the comments in the code to match the code
 
  


Reply

Tags
tc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to adjust highest priority for the wifi traffic? wesley_q Linux - Wireless Networking 2 09-17-2014 05:34 AM
which value is for highest priority for real-time processes icoming Linux - Software 3 12-19-2009 10:30 PM
Redirecting local traffic from port 80 to 8080 Last Attacker Linux - Networking 11 02-03-2009 12:52 PM
access 8080 web server port through squid running on 8080 sunethj Linux - Networking 11 05-18-2007 02:38 AM
Assigning highest priority to process. gangaraju Fedora 3 02-07-2006 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration