deadlydisaster007
Posts: 9
Joined: Sat Jan 12, 2013 6:13 pm

Script for pausing torrents during LAN traffic

Sat Feb 23, 2013 7:06 pm

i have no idea if its possible or not so pls help me out
This script should monitor the LAN for any internet traffic and allow torrents to download while other nodes on the network are not using bandwidth. As soon as another node is requesting stuff from the internet, the script will pause all the torrents and prioritize the other nodes to get their packets. Only when no other nodes are using the internet will the script allow torrents to resume.

pls be clear ( treat me as noob ) i am new to Linux and raspberry.

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Script for pausing torrents during LAN traffic

Sun Feb 24, 2013 7:40 am

Sounds do-able doesn't it but these load balancing ideas usually prove to be impossible at a simple script level.

All network packets will be clearly marked with their destination so in principal you can do these sort of things. Problem arises because the monitor needs to be in a place where it can see all network traffic. For a home network this is the router provided by your ISP and not your Pi, which will only be picking up its own traffic. Naturally access to the router internals are usually restricted to put it mildly.

Of course the network configuration could be modified, so a single system (the Pi in this case), takes all network traffic, and then forwards it on it your local network. There are tools to analyse network (TCP/UDP/...) packets, search out Wireshark if you are encouraged to go further. You will be able to put the tool into a promiscuous mode to pick up all traffic, and very verbose you will find it too. So the Pi will have to be doing a lot of grunt to sort things out. All this requires a deep level of understanding to ensure a good level of even-handedness to the sharing of resources; there are always unseen side-effects.

Another approach would be to install multiple NICs on the Pi and design your network into several sub-nets. So one NIC could be using IPs on the 192.168.1, a second on 192.168.2 and so on. This could simplify the issue since you are now limiting yourself to monitoring just these points in the network.

Apologies if this is all a bit general, not specific enough and unhelpful.

Maybe someone will be able to contribute something more concrete for you.

Good luck.

deadlydisaster007
Posts: 9
Joined: Sat Jan 12, 2013 6:13 pm

Re: Script for pausing torrents during LAN traffic

Sun Mar 03, 2013 7:19 am

is this possible if i just ping the other computers to check if is on or not ?

and if its of then its not downloading so start download ?


its not absolute solution (but thats what i am able to think of for now )


also thanks for your reply

i have dlink 2750u router i have access to the router but main problem the os is closed source in the router and dont accept any other frimware

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Script for pausing torrents during LAN traffic

Sun Mar 03, 2013 7:59 am

Ping will just show that there is a connection, and not anything to do with the amount of traffic the node might be generating. Presumably you're thinking if its up then it must be loading the system?

I guess you could have a master system remotely bringing satellites into service when it sees fit. It fits the general model that one system is all-knowing. With the systems all running ssh , keys exchanged to avoid the use of manual password entry, then one could hack a system together that might do a job for you.

Interestingly (or not) in the last week I've brought a second router into service to in increase wireless coverage over in the west wing (aka the spare bedroom). This is a Netgear WRT614, and its management software includes a table of nodes, their usage and so on. So in principal it has some useful data, but whether its retrievable in an automated fashion remains to be seen. Some hubs have telnet access, so you can write scripts to access and control them. Other don't! Not tried with this particular box of tricks.

Return to “Beginners”