From LedHed's Wiki
Revision as of 18:42, 2 July 2008 by Ledhed (Talk | contribs)

Jump to: navigation, search

Smoothwall Express (Ver. 2 & 3) support squids download throttling AKA delay_pools.
This feature allows you to cap download speeds based upon different criteria, for example on URL or Mime Type.
To utilize this feature you must edit the file /var/smoothwall/proxy/acl
(Do not edit squid.conf directly because Smoothwall rebuilds it everytime squid is restarted!)
The Advanced Proxy mod for Smoothwall has a primitive WebUI for employing delay pools.


ACLs

ACLs or Access Control Lists can be thought of categories or groups. These groups are then used to match against access rules.
Group A = Access
Group B = Deny
You can also invert the groups with a "!"
Group !A = Deny (Groups other than A Deny)

There are many types of ACLs such as Source IP, Destination IP, Port, Protocol, Time, and URL just to name a few.

NOTE: ACLs have many options and many uses which are far beyond the scope of this article. For more info on ACLs see the ACL link in the References section.


ACL Example

# LunchTime ACL
acl lunchtime time 11:30-1:30

# Video Files ACL
acl video req_mime_type -i .avi .mpeg .mpe .mpg .qt .ram .rm .mov .fla .swf

# Audio Files ACL
acl audio req_mime_type -i .mp3 .wav .ogg .wma

# Youtube ACL
acl youtube url_regex -i www.youtube.com


Delay Pools

Delay Pools create buckets much like a HTB Quality of Service. This bucket is filled and then refilled at a given interval.
Think of it as a glass of beer and when ever the glass is half empty a bartender tops it off, but he pours slowly.
Initially the beer is filled up quickly, but after the beer is half gone the flow of beer is controlled.


Example Delay Pool

# Number of Delay Pools
delay_pools 1

#First delay class (1) of type (3)
delay_class 1 3

# Speed Control
# Class 1
# Network limit -1/-1 (Unlimited)
# Individual limit 48000Kbps / 96000Kbps  (Rate / Bucket Size)
delay_parameters 1 -1/-1 48000/96000

# Apply throttling
delay_access 1 lunchtime deny    # Deny Throttling at lunch time
delay_access 1 !lunchtime allow  # Allow Throttling any time other than lunch time
delay_access 1 allow youtube     # Allow Throttling to www.youtube.com
delay_access 1 allow video       # Allow Throttling of video files
delay_access 1 allow audio       # Allow Throttling of audio files