CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@Kaustubh Katdare • 31 Oct, 2008
I've had my experience of losing about 600 mb of ubuntu .iso file while downloading from the Internet. So I'm now thinking can anyone explain how the 'resume download' works?

What I want to know is this -

1. How does server/client software keep track of bytes transferred. I've noted that the server must also support 'resume download' functionality.

2. How does the download resumes exactly the place where the download was paused [​IMG].

I think not many have ever cared to know how it works.
@parihar888 • 31 Oct, 2008 hi big k

while sending any msg or any data like resume at both end of server / client
the is a role play of parity bit in the header if both the bits received at the end are same then downloading is OK ,.,.
@sriramchandrk • 03 Nov, 2008 1. Let me start with how download manager gets to know the size of the requesed file and if server supports resume download.

Similar to GET header to get the required html page, we have something called as HEAD header.

When you send a HEAD request for an URL we get a set of values for the URL

Example: if you want to know details of

Send a head command to the URL
the response will be
Date: Mon, 03 Nov 2008 06:29:09 GMT
Accept-Ranges: bytes
ETag: "156046f-11889-3a578cd2bf2c0"
Server: Apache
Content-Length: 71817
Content-Type: application/pdf
Last-Modified: Thu, 11 Jul 2002 04:53:07 GMT
Client-Date: Mon, 03 Nov 2008 06:29:10 GMT
Client-Response-Num: 1
Intresting Values:Accept-Ranges, Content-Length

Accept-Ranges: bytes 'tells that server is ready to give files part by part as requested!'

If this doesn't appear then most probably the server will not allow resume download.

This tells the size of the pdf file. Useful to find how much is still left to download while resuming. (infact from which byte we need to download.

2. Now since download manager knows that this server supports download by parts(resuming as well).

Explaining Steps done by Download manager(for only one split):
1. Connects to on port 80(where ever http is running) using a tcp connection.
2. Sends following text.

GET /chromatic/perl/IntroTestMore.pdf\n\n
3. The server starts sending some headers followed with file contents.
4. If you stop the download though the interface given the
- download manager disconnects the connectino
- prepares the temp file for the file downloaded (partly) and also keeps a track for how much got downloaded for example let it be 10000 bytes.

Now when you click on resume download the download manager does:
Step 1. same as above
2. Sends the following text
GET /chromatic/perl/IntroTestMore.pdf\n
RANGE: bytes-unit = 10001\n\n
here bytes-unit specifies from which byte the files is required.
There are called range byte headers.

3. The server starts sending some headers followed with file contents(starting from 10001 byte instead of from beginning of file!).
4. Download manager starts appending the bytes recieved to previous temp
5. Once total file is downloaded the DM changes the temp file to actual file name which could be used (file is now usable).

You can see http rfc for more details.

Now you could think how the splits work.
Actuall each download manager thread downloads part of file by specifying ranges and once everyone is done they join all the splits to give a complete file.
Thanks & Regards

Related Posts

@prachicivil · Jul 29, 2012

i want some good topics of group discussion in civil engg.

@shiva6 · Feb 6, 2015

I am currently in my last (8th) semester of B.Tech. and I have been selected by Mphasis as software trainee on my campus placement. The joining could be anytime between...

@surendhran · Mar 10, 2015

Project Abstract / Summary : ABSTRACT This project “EL-BOW TRANSMISSION” being compact and portable equipment, which is skilful and is having practice in transmitting power at right angle without any...

@Sharvari Panchbhai · May 23, 2015

The researchers at the University of Maryland (UMD) and Temple University have discovered a new class of magnets called ‘non-Joulian magnets’. The unique property of this kind of magnets is...

@Sharvari Panchbhai · Feb 14, 2015

Last year, NASA had announced its proposal to develop a conceptual design of a possible submersible autonomous vehicle (submarine) for performing autonomous detailed scientific investigations of the liquid methane/ethane seas...