Re: Bandwidth Allocation



Thanks Peter
I am working on a trading application, and there is 1 MB link on
trading server. Normally at a time 25 to 30 TCP clients are connecting
to server. If more than 30 clients (TCP connection) connect to the
server, then perform is going down.

Trading server sends stock market feeds to clients on request, on
client side there is a timer which sending 'a request for feed' to
server after specific time interval and then server sends the feed to
client.
Hops you all understand the problem.

Salman Ali


On Sep 15, 10:43 pm, Peter Duniho <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
salman wrote:
I am developing a server and I want to view and change the the clients
TCP connection bandwidth.

It's not really clear from your question what you want to do. However,
assuming you want to do the possible rather than the impossible, the
basic idea is simple:

* Displaying bandwidth requires that you count how many bytes have
been transferred over a certain amount of time. How exactly to
calculate this depends on what you want to display to the user. If you
want to display total cumulative bandwidth, you'll just note the
starting time for a transfer, count total bytes, and calculate the
current bandwidth based on the ratio of the two.

If you want some sort of trailing average, you'll have to decide how
often to update the average and for how many of those intervals back you
want to calculate the average. One technique would be to keep a list of
the byte count for each interval so that you can subtract the oldest
byte count at each interval (the time part will be constant, based on
the interval length and number).

Alternatively, you can do some sort of weighted average, in which all of
your bytes are counted, but the most recent ones are weighted more
heavily; this would allow you to calculate the trailing average without
keeping track of all of the byte counts for some fixed number of intervals.

* Changing the bandwidth is a little more complicated, but not
much. Obviously you can only restrict bandwidth; if the user wants more
bandwidth than their network will support, you can't provide that.

For restricting bandwidth, you'll simply calculate a maximum number of
bytes to transfer in some period of time, and when you reach that limit,
wait until the period of time has expired. The period of time should be
long enough that you can still send a reasonable amount of data in each
"burst", but short enough that the network transfer is reasonably smooth.

The basic idea here is that if you have some requirement to not send
data faster than, say, 100K per second then you include logic in your
code that counts bytes sent and only allows 100K to go through for any
one second interval (or 50K in a half second interval, or 200K in a two
second interval, etc.).

Pete


.



Relevant Pages

  • RE: No internet for clients
    ... I understand that the internal clients ... Please rerun the CEICW to make sure your SBS 2003 server have right ... How to configure Internet access in Windows Small Business Server 2003 ... Two network adapters - manual router connection to broadband ...
    (microsoft.public.windows.server.sbs)
  • RE: SBS VPN connects but no shares..
    ... VPN clients can no longer access internal resources after you install ... Windows Server 2003 Service Pack 1 on a computer that is running ISA Server ... How to configure a VPN connection to your corporate network in Windows XP ...
    (microsoft.public.windows.server.sbs)
  • Re: Problem
    ... the remote site and see if they have the connection manager installed. ... So...whichever is easier to set up on the router. ... location B need to connect individually via VPN to the SBS server at ... server - not sure of the clients ip scheme - but I think it is ...
    (microsoft.public.windows.server.sbs)
  • RE: Cant remote desktop to clients connected via VPN
    ... that the VPN connection works well. ... that RDP does not work to clients connected via VPN (to all other clients it ... > the SBS 2003, but from your IP configuration, I found your DNS server is ...
    (microsoft.public.windows.server.sbs)
  • Re: Bandwidth Problems
    ... I recomend you to set the load tester connection rate to quite slow... ... the load testing PC (and server) to validate the usage of bandwith. ... On this I tested with the Windows Media Load Simulator. ... But I do have a 1000 KBit/s bandwidth. ...
    (microsoft.public.windowsmedia.server)