Don't do it with Squid : you need control for everything, not just for HTTP on port 80.
The answer requires iptables with the '--quota' option, which implements network quotas by decrementing a byte counter with each packet. The argument of "--quota" is a value in bytes.
There shall be one chain for each user. First rule of the chain counts down a 13 GB quota for packets from 192.168.0.2
and accepts the packet if it is below quota:
iptables -A INPUT -p tcp -s 192.168.0.2 -m quota --quota 13958643712 -j ACCEPT
Second rule of the chain classify over-quota packets in a tc class of your choice :
iptables -A INPUT -p tcp -j CLASSIFY --set-class 1:12
Then it's all classic traffic shaping : http://tldp.org/HOWTO/Traffic-Control-HOWTO/
Of course, you need to use static IP allocation or make sure that DHCP allocates addresses fixed by device's MAC address - and you need to block all addresses but the identified ones of the devices belonging to one of the three users.
By the way, you mention that "when 2 people browse the internet they should get 1 Mbps each, and when 3 people access, they should get 2Mbps divided by 3" but you can do better than that when you set up your traffic classes hierarchy: your requirement should rather be "when two people browse the internet they should not get less that 1 Mbps each, and when three people access, they should get not get less that 2 Mbps divided by 3" so that each can get more if the other people use less than their guaranteed throughput... And tc lets you do that !
Since your router is supported by openwrt and dd-wrt, you have all the tools you need !
On Linux, you could use trickle
, which works for any application.
For example, running
$ trickle -d 50 -u 10 firefox
in the terminal will start Firefox and limit it to 50 kB/s download and 10 kB/s upload. For Firefox, make sure no other instance is running.
On Windows, you might give give a shot on Google. My first hit was NetLimiter, non-free, unfortunately.
For a more reliable and network-wide and cross-platform solution I recommend looking at configuring QoS on your router.
Best Answer
If your router doesn't support traffic shaping, you can install this on each computer: