From: Karachi , Pakistan
Here is the intoduction of a bandwidth manager for windows environment , it has done the job for
It is not a plugin for ISA Server , however too smart to do the required.
****** Band Speed Balancer ******
BSB is a program for the limiting of transfer speed of HTTP-data downloaded to IP-address
The purpose of creation and existence of the program: To make the work easier for networks administrators in regulating the access to the Internet from the LAN.
The author of the program: Aleksandr Mantrov.
The program BSB(1.6.4) carries out the following functions:
1. Automatically limits speed of the data downloading to IP-address up to the specified value.
2. Limits size per week of data which are downloaded to IP-address.
3. Limits the number of simultaneous connections from the browsers and other HTTP-using programs that users use for surfing in the Internet
4. Logs the all HTTP-requests in the file in the Apache-like format
5. With the help of a special client-side program "BSB Client Informer" the users can receive the information about their size of data downloaded for current week, current restriction of speed and etc.
All these operations are necessary for regulation of process of visiting of the Internet simultaneously from several (or several tens and, maybe, hundreds) computers of the local computer network through the channel with bandwidth of 32 kBits per second or even 64 kBits per seconds, or maybe more. Therefore as, if from one of computers the user begins to download, for example, 5 large files simultaneously, such channel becomes loaded up to 100 per cents, doing practically impossible using of the Internet to other users.
The program is intended to work between a caching proxy-server and computers of the LAN, effectively regulating a degree of congestion of the channel of connection with the global network over the HTTP-protocol.
Adjustment of the program BSB--------------------------------------------------------------------------------
All adjustments of operation of BSB are set in the configuration file bsb.cfg. The file contains 2 sections: common adjustments - section [Config] and list of IP-addresses with individual adjustments - section [IP].
The configuration should be correct before start of the program BSB from command prompt or as service. If the configuration file contains errors, BSB will not work, and information about errors will be written in the log-file bsb.log.
Common adjustments. Section [Config].
For normal operation of the program BSB it is necessary to set correctly the following parameters in section Config (the possible or recommended values are showed):
Number of a TCP port through which BSB will work as a proxy-server limiting speed, weekly downloaded traffic and number of simultaneous connections. Attention! If BSB and caching next-level proxy-server together work on the same computer then the numbers of their working ports should differ.
Number of a TCP port, through which BSB will accept connections from BSB Client Informer of the users about statistics. This port should not be occupied in other programs on the computer, where BSB works. Connections established on this port are not limited by BSB, and these connections do not influence conditions of application of limitations on speed.
These are IP-address or name and port of the next-level proxy-server the incoming traffic from which BSB will limit. The value ParentPort must not be equal ListenPort, if BSB and your proxy-server together work on the same computer. Since the program BSB cannot communicate directly with Web- and FTP-servers yet, the next-level proxy-server is necessary for normal operation of BSB and also it may fulfill the useful function of caching.
The particular variant of usage of BSB is possible also, if the parameters are set to the address of your Web-server and its port 80 (usually), then BSB can fulfill a role of the limiter of traffic outgoing from this Web-server.
Value in bytes per second of the bandwidth of your channel to the internet. BSB will limit speed of incoming traffic up to this value. If you have a dedicated link with bandwidth of 256 kbits per second, then parameter may be equal to 32000, if you have only 32 kbits per second dedicated link, then - 4000, the same value can be used in case of modem connections of 33600 bits per second.
DefaultSpeedLimit=value more or equal to 100 or just 0
The value in this parameter determines the maximum limit of speed in bytes per second of incoming traffic to IP-address by default, when the limitation of the speed is working (see description of several parameters further). In section IP it is possible to specify individual limitations for each IP-address. The value 0 cancels by default limitation of speed of incoming traffic. The minimum limitation of speed is coded in the program BSB equal to 100. Therefore smaller values will work simply, as value 100.
Limitation of weekly traffic in megabytes for all IP-addresses by default. In section IP it is possible to specify individual limitations for each IP-address. If from IP-address the greater size, than indicated in this parameter, of the data has been downloaded then all connections from this IP-address is closing, and for all new connections the content of the file indicated in the parameter SizeLimitFile will be sent. The value 0 turns off the limitation of weekly traffic. The one week ends, and the next week begins on Sunday at 0:00:00.
Value in the seconds of the time from the moment of connection installation by the client on expiration of which the limitation of speed starts to work. The values from 10 to 60 seconds are recommended so all small files have enough time to be downloaded to the client without limitations of speed, but the speed of downloading of the large files is limited by BSB.
The restriction of speed begins to work if the number of simultaneous active connections more than or equal to this value. If at current moment of time the number of connections established with BSB is less than specified in this parameter then restriction of speed is not performing. If the number of simultaneous connections is more or equal to the parameter, but all of them established from the one IP-address then the speed of data downloading for each connection is limited to the value determined for given IP-address or by default. But if the number of connections established with BSB from various IP-addresses is exceeding or equal to the parameter value then for all these connections the limiting of the speed is performed as defined for each IP-address or by default, but the restriction also depends from parameter IPSpeedLimitType.
This parameter is restriction by default on the maximum number of connections from one computer. 0 - there is no any restrictions for the number of connections. In section IP it is possible to specify the individual restriction for every IP-address. For example, one process of IE versions 5.x establishes, apparently, no more than 4 connections for data downloading, irrespective of number of open windows. When the user's http-client tries to establish connections, and their amount more than maximum then such connections from this IP-address will be closed and the contents of the file specified in parameter NoConnFile will be sent to client.
The number of seconds during which BSB expects the receipt of any data from the server. If this time passes without receipt of the data then connection is closed because of a time-out, and the contents of the file specified in parameter ConnTimeoutFile is sent to client.
The list of intervals of time in which program BSB limits the speed, outside of the specified intervals any data downloading is not speed-limited. Several intervals of time are delimited with a comma. Hours may have value from 0 up to 24, minutes - from 0 up to 59.
In these parameters the files with HTML-message for users are specified. The content of these files is sent to user's http-client when one of situations arose, accordingly:
- The user achieved weekly traffic limit
- It is impossible to connect to the next-level proxy-server
- No data were received from the server for a long time (Time-out)
- From the user's computer the possible number of simultaneous connections is already established.
In a file which is specified in parameter ParentNoConnFile, the first 2 entries of a substring %s are replaced with the address and port of the proxy-server from parameter ParentProxy.
By default, it is supposed, that the specified files have HTML format, but it is possible to specify not only textual HTML-files, but also files of any format which browsers understand. Thus the exact description of its format is necessary to specify, it will be transferred in field Content-Type of HTTP-header, for example:
By default, content of the specified files is transfered out to the client with a HTTP-code of error "503 Service Unavailable". However it is possible to change this code to other standard HTTP-code 4xx or 5xx with any textual description, for example:
NoConnFile=myerrors\info.gif, image/gif, 503 Service Unavailable - Connections
ParentNoConnFile=errors\pnc.html,, 503 Service Unavailable - Next Proxy
This parameter is a filename of text file where the sizes of the downloaded data to each IP-address for last week and for current week are written each 60 seconds. Format of this file is comma-separated-values.
The parameter allows connections. If it is equal to 1 the client may establish connection with BSB from any address and if its address is not listed in section [IP] the restriction of speed and the traffic for connections from this address will be values by default but if the address is in section IP then there is an opportunity to set individual values of restrictions for it. If the parameter is equal to 2 the client may establish connection with BSB from any address without any restrictions. It is recommended to set value of this parameter equal to 0 then only the clients from the IP-addresses listed in section IP may establish connections with BSB.
The parameter defines type of limit of data downloading speed. When the value is equal to 0 the speed is limited for each connection from IP-address separately. I.e. if restriction of speed is equal to 2000 bytes per second and from IP-address is established 5 connections then for each connection the speed of downloading is limited to 2000 bytes per second. When the value is equal to 1 the limit of speed is distributed on all connections from IP-address. I.e. each connection is limited to 400 bytes per second for data downloading in the example above.
Individual adjustments. Section [IP]
In this section there is a list of IP-addresses from which TCP-connections to BSB are allowed. For each IP-address it is possible to set limits of data download speed, the weekly traffic and number of the connections, distinct from the default values defined in section [Config], and to associate a name with IP-address which will be registered in log-files. Only when parameter AllIPMode is equal to 0 or 1 then the program BSB does not ignore the IP-addresses listed in this section . Below is an example of the list of IP-addresses with various adjustments:
192.168.0.1=L0 W0 C0 Nbsbcomp
Here is set individual adjustment meaning that the program BSB will not limit the data download speed (parameter L0), the weekly traffic ( W0) and the number of simultaneous connections (C0), and also the connections from this IP-address will be registered in log-files with the name bsbcomp (Nbsbcomp). In general, it is not recommended to create adjustments with zeros, since in this case the program BSB does not play its limiting role.
192.168.0.2=L2000 W40 C4 Nhuge_downloader
In this case the restriction of speed is set 2000 bytes per second ( L2000), which is probably different from default value. The limit of weekly traffic is set to 40 megabytes (W40). Also the restriction is set for a maximum of 4 simultaneous connections (C4). This is a minimal recommended value for users using the browser IE 5.x. The name huge_downloader is associated with this IP-address also.
192.168.101.2=B W50 C0 Nras1
This adjustment is for connection from remote computer which is connecting through a modem line. The first letter B tells the BSB to use balancing limit of data download speed
This is a simple list of IP-addresses. Default restrictions, defined in section [Config], will be used for connections from these IP-addresses. The name user_1 is associated with the first address and other IP-addresses have no associated names, so in log-files the minus sign (-) will be used instead of a name.
So. For each IP-address it is possible to specify individual adjustments of restriction of speed with using of only one of parameters: B or Lnumber. Restriction of the weekly traffic is set by parameter Wnumber. Restriction of number of simultaneous connections is set by parameter Cnumber. Using the parameter Nany_symbols_without_spaces it is possible to specify some name associated with IP-address for its registration in log-files. Parameters should follow in a string in the listed above order and may be absent.
BSB Client Informer--------------------------------------------------------------------------------
This auxiliary program is intended for running on the computer of the user that connects to the Internet through a proxy-server with installed program BSB.
Before startup of the program it is necessary to specify in its command line a name (address) of a proxy-server, on which the program BSB is installed and is running, and number of port. I.e. bsbcl.exe your_bsb_computer bsb_port. Since the user usually do not know such details it is better to create a shared directory on any server in a network with elementary batch file or a shortcut, which helps the user to start "BSB Client Informer". If current Windows locale is Russian then the interface of the program is Russian, otherwise the interface is English. You can switch the program to Russian interface by specifying the last parameter: ru. I.e. bsbcl.exe your_bsb_computer bsb_port ru.
After the start of the program in status area on taskbar new icon appears: the character i on a background of green, yellow-green or brown color. If you click once on this icon with the left button of the mouse, a window with the detailed information will appear. This window can be moved and can be resized. To hide this window from the screen you may just click on the icon of the program again.
If you click on the icon with the right button of the mouse then a popup menu appears with a command to exit from the program "BSB Client Informer" and with items for adjustment of amount of the information in the window, for example, it is possible to hide information about IP-address of the computer or about current speed limit etc.
The background color of the icon signals about a degree of use by the given computer of weekly traffic limit for downloaded data from the Internet.
If background color is green then it means that there is no limit for computer or that the computer has downloaded just a few data. If some weekly traffic limit is set for IP-address of the computer then a yellow bar grows from the bottom of the icon on the background color upwards. When all limit of traffic is used, the background color of the icon becomes brown .
The interval of polling of the server, i.e. of the program BSB, for reception of the current information about statistics is 1 minute if the window is not open and is 15 seconds otherwise. And if you make double click with the left button of the mouse in a rectangle of the window of "BSB Client Informer" then the program momentary executes request for fresh statistic information. The icon changes during the executing of the request for the information about statistics.
Here is the link to download the latest version of BSB : BSB(1.7)