# howto limit / block upload traffic of an application

## musv

Hi, 

I'm using Qsopcast for my wife to watch Brazilian TV. It's the only possibility for her to get something of GloboTV. 

Now my special problem: 

Sopcast works as a p2p-app. It means, I can download the TV in the same way I have to upload the streams. My internet connection is provided by the university where I live in a dormitory. I have a 100 MBit flat here but with a limit of 10 GB each day. If I use more then they will cut my connection for some weeks. The day before yesterday my wife watched Sopcast for several hours and forgot to shutdown it afterwards. In result: I had 2 GB download and 20 GB upload that day. 

Most of the p2p-apps I know have an option to limit the download and upload rate (Azureus, aMule). Sopcast doesn't have. 

1. How can I identify the upload port of Sopcast?

2. How can I limit or block the upload stream of Sopcast in a simple way?

----------

## frostschutz

In general there is l7-filter for identifying protocols, but sopcast doesn't seem to be listed there. Maybe it is using another, better known protocol that is supported? Otherwise you'd have to add an iptables logging facility to find out what kind of traffic this software generates, and devise some means to filter it based on that. Then you could create some QoS shaping rules that will limit your applications upstream.

If sopcast is running on your own local machine, and not on a machine in the network, an easier method may be available, it may be possible to assign traffic based to local running processes, and thus limit the process itself no matter which kind of traffic it generates. I think this was possible using some iptables extension, but I forget the exact name...

EDIT:

Ah, iptables owner match support may be it. Mark all packets that are owned by the process you want to limit, and put those packets into a low bandwidth QoS class.

----------

