Re: downloading a single file using multiple threads

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message news:MPG.2074c5b62953c42a98da42@xxxxxxxxxxxxxxxxxxxxxxx
Willy Denoyette [MVP] <willy.denoyette@xxxxxxxxxx> wrote:

<snip>

I know that down-load managers claim to work over HTTP, but that
doesn't mean they support multi-part parallel request handling over
the same or multiple connections, I don't even know if the protocol
allows you to issue new range request when you have a range requests
pending (on the same logical connection).

I'm not sure what you mean by a "logical" connection, but you can
certainly do it over multiple "real" TCP connections.

Sorry, I'm talking about connections in terms of ISO layers, a logical connection is an end to end socket connection, a connection at the session layer (HTTP is operating at this layer - and it's called a session). I would call a "real connection", a TCP connection, that is a connection at the transport layer (connected to a 'port' in TCP/IP terms), say a connection to www.contoso.com port 80.

Agreed, you can have multiple range requests on separate "real connections" or "logical" (same or different port, different sockets), however, I'm not sure you can have overlapping range requests on a *single* an HTTP "session".


a connection with a client connection is the connection
> There is no theoretical reason why it wouldn't work. There's
> nothing about HTTP that requires servers to restrict their
> communications to a given client to a single connection, and
> there's nothing about HTTP that stipulates that an HTTP server
> needs to coordinate communications on independent connections. If
> on one connection the client asks for the first megabyte and on a
> second connection the same client asks for the second megabyte,
> then if the server is capable of servicing both requests at the
> same time, there's no reason the client can't wind up receiving
> both the first and second megabytes in parallel.

Agreed, but what's the advantage in a simple client server scenario?
With simple I mean a simple PC connected over a dedicated LAN to an
HTTP server.

Agreed, it's not useful in that case.

> And of course if the HTTP server is configured to throttle the
> transfer for each connection, it is often also configured to
> disallow multiple connections from the same client IP address.

They better do ;-)

Most shouldn't, IMO. If I connect to the BBC and download the home page
which has multiple small images in, it makes sense to use a few
connections to get those images in parallel, given that a lot of the
time will be taken by latency rather than bandwidth.


Yep, but IMO the different images will be requested by different ovelapped get requests (not range requests) over a single connection or at most two connection as per HTTP1.1 (see below) .

Disallowing multiple connections from the same IP address to fetch the
same file would make sense, or having a limit on the number of
connections to allow from each IP address.


This limit is advised by HTTP1.1 (a configurable default for a client obeying the terms of the protocol) to be a max. of 2 connections to the same server address. We have our backbone routers configured to impose this maximum, in order to prevent some people to monopolize the network resources.

Willy.



.



Relevant Pages

  • Re: downloading a single file using multiple threads
    ... The multi part requests in HTTP1.1 are meant to request a single part or multiple parts in a single request, but you can't requests multiple parts in parallel from multiple client threads. ... I know that down-load managers claim to work over HTTP, but that doesn't mean they support multi-part parallel request handling over the same or multiple connections, I don't even know if the protocol allows you to issue new range request when you have a range requests pending. ... If on one connection the client asks for the first megabyte and on a second connection the same client asks for the second megabyte, then if the server is capable of servicing both requests at the same time, there's no reason the client can't wind up receiving both the first and second megabytes in parallel. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Learning how to use "Remote Login"
    ... for client connection requests. ... "listening", by your definition. ... who listens for client requests. ...
    (comp.sys.mac.system)
  • Re: Underlying connection was closed
    ... Because it is possible for an application to use the connection without being authenticated, you need to be sure that there is no security vulnerability in your ... If your application sends requests for multiple users and relies on authentication to protect ... I've written a client application which fires off multiple threads ...
    (microsoft.public.dotnet.framework.webservices)
  • SSL POST connection with client authentification dropped by IIS 5/W2000 Server
    ... We have a problem with a client installation when SSL POST connections with client authentification are sometimes dropped by IIS 5/W2000 Server. ... Drops means a TCP FIN sent by IIS once the client has finished sending his POST data, with not a single byte of data going from server to client. ... Except the exact length/content of the request, nothing differentiates those requests from the other requests that are going through all right. ... The client opens the connection, negotiates an SSL session, send the header data in one package, IIS requests to renegotiate the connection with an "HelloRequest", the client send the rest of the data, and after sending all of it begins renegotiation. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Learning how to use "Remote Login"
    ... for client connection requests. ... "listening", by your definition. ... who listens for client requests. ...
    (comp.sys.mac.system)