LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 02-13-2013, 01:52 PM   #1
fandar
Member
 
Registered: Oct 2006
Posts: 60

Rep: Reputation: 15
P2P traffic shaping on kernel 3.6.4


Hello, what can be used for P2P traffic shaping on kernel 3.6.4? Something like IPP2P? My aim is to to give high priority to ICMP, SSH, VOIP, etc. then to HTTP and the lowest priority to P2P networks and torrents. Thank you
 
Old 02-13-2013, 09:44 PM   #2
jnihil
Member
 
Registered: Dec 2012
Distribution: Debian, Xubuntu, Gentoo, CentOS, Bhodi
Posts: 47

Rep: Reputation: 2
You could use tc (traffic control):

http://www.tldp.org/HOWTO/html_singl...Control-HOWTO/

I've only used tc with the Vyatta software router (based on Linux) to simulate WANs with high-latency and packet losses for UDP packets, but tc will allow you to shape/police the traffic level based on the policy you define for different classifications of network traffic. The learning curve was a little steep, but it's certainly an option.
 
Old 02-14-2013, 04:05 AM   #3
fandar
Member
 
Registered: Oct 2006
Posts: 60

Original Poster
Rep: Reputation: 15
Yes, I know but the question is what to use to determine torrents and other P2P networks because It seems that ipp2p or layer-7 doesnt work with kernel 3.6
 
Old 02-14-2013, 08:58 AM   #4
jnihil
Member
 
Registered: Dec 2012
Distribution: Debian, Xubuntu, Gentoo, CentOS, Bhodi
Posts: 47

Rep: Reputation: 2
Yeah, it's hard when people switch port numbers and encrypt their torrent payoads.
One way to go about it is prioritize the non-torrent traffic, then put the torrent and 'other' trivial traffic in a low queue.
 
Old 02-15-2013, 03:57 AM   #5
fandar
Member
 
Registered: Oct 2006
Posts: 60

Original Poster
Rep: Reputation: 15
OK, one more question. I am trying to do the traffic shaping on a router with wwan (3G modem) and wlan as local network. Can you refer me to some good example howto do it? Because the connection speed on the wwan network is variable (from few KB/s to MB/s) so howto write that rules? I have been searching on google and tried several examples but nothing seems to be working good here. I need to setup priority for ICMP packets so the ping to 8.8.8.8 remain still the same when pinging from the router. (I am using ping to check internet connection and set services on the router accordingly). But each time when the network signal is low and I am downloading some file via http/ftp the ping is going from 200ms to 4000ms. The next step will be to set to all of the P2P and unknown services (ports) the lowest priority. Any idea howto correctly shape the wlan traffic in order to keep the ping response time at least under 500ms? The internet connection speed is different every time. Thank You in advance.
 
Old 02-15-2013, 12:07 PM   #6
jnihil
Member
 
Registered: Dec 2012
Distribution: Debian, Xubuntu, Gentoo, CentOS, Bhodi
Posts: 47

Rep: Reputation: 2
And what router do you use?
Does it have configurable queues?
 
Old 02-16-2013, 05:04 AM   #7
fandar
Member
 
Registered: Oct 2006
Posts: 60

Original Poster
Rep: Reputation: 15
Hello, its a box with debian Linux
 
Old 02-16-2013, 09:32 PM   #8
jnihil
Member
 
Registered: Dec 2012
Distribution: Debian, Xubuntu, Gentoo, CentOS, Bhodi
Posts: 47

Rep: Reputation: 2
I'm going to point you to the Linux Advanced Routing & Traffic Control HOWTO http://lartc.org/lartc.html#LARTC.QDISC because everything about tc/iptables in explained there.
I also found what looks like a great webUI frontend for tc/iptables called mastershaper: http://www.mastershaper.org/index.php/Main_Page
If you want to get dirty with the cli, The Wonder Shaper http://lartc.org/wondershaper/ has a great script and README detailing what can be done.

I suppose your problem with classification of bittorrent remains, but in my bt client setup (deluged) I have my source/destination layer-4 port ranges defined, so explicit packet classification is possible in the egress direction. Not sure if you can do that with your bt client, but otherwise you can define a high priority class based queue for traffic which you can classify, and a low priority queue for everything else.
 
Old 02-18-2013, 02:33 AM   #9
fandar
Member
 
Registered: Oct 2006
Posts: 60

Original Poster
Rep: Reputation: 15
Hello, I have read the Linux Advanced Routing & Traffic Control HOWTO and also checked the wonder traffic shaping script but in both I need to know the connection speed (upload and download) as I wrote its a 3g modem and the connection speed is very variable. Is there some way howto measure the connection speed in realtime with a small amount of data send/receive? Or a better way howto do this? Thank You
 
Old 02-18-2013, 03:13 AM   #10
jnihil
Member
 
Registered: Dec 2012
Distribution: Debian, Xubuntu, Gentoo, CentOS, Bhodi
Posts: 47

Rep: Reputation: 2
It'll be hard measuring the fluctuating bandwidth of a WWAN connection in realtime.
How about using tc's prio qdisc which doesn't use the underlying bandwidth for its dequeuing algorithm but uses traffic priority only?
 
  


Reply


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
Traffic Shaping VoiP using TC (Traffic Control) is this working? Nemus Linux - Networking 0 05-16-2011 01:45 PM
Problem with Traffic Shaping and HTTP Traffic. redvivi Linux - Networking 1 11-29-2008 12:23 PM
Traffic shaping (limiting outgoing bandwidth of all TCP-traffic except FTP/HTTP) ffkodd Linux - Networking 3 10-25-2008 12:09 AM
kernel configuration and tc commands for traffic shaping ncrfgs Linux - Networking 0 11-25-2004 11:46 AM


All times are GMT -5. The time now is 07:11 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration